galaxy-commits
Threads by month
- ----- 2026 -----
- October
- 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/1034c973ec1d/
Changeset: 1034c973ec1d
Branch: next-stable
User: guerler
Date: 2014-12-01 17:52:01+00:00
Summary: Pages: Sanitize name column in items grid
Affected #: 1 file
diff -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee -r 1034c973ec1d2ce424f711d750ecc6de582d02aa lib/galaxy/webapps/galaxy/controllers/page.py
--- a/lib/galaxy/webapps/galaxy/controllers/page.py
+++ b/lib/galaxy/webapps/galaxy/controllers/page.py
@@ -8,6 +8,7 @@
from galaxy import util
from galaxy.util.sanitize_html import sanitize_html, _BaseHTMLProcessor
from galaxy.util.json import loads
+from markupsafe import escape
def format_bool( b ):
if b:
@@ -89,9 +90,9 @@
class NameColumn( grids.TextColumn ):
def get_value(self, trans, grid, item):
if hasattr( item, "get_display_name" ):
- return item.get_display_name()
+ return escape(item.get_display_name())
else:
- return item.name
+ return escape(item.name)
# Grid definition.
show_item_checkboxes = True
https://bitbucket.org/galaxy/galaxy-central/commits/5393f6389105/
Changeset: 5393f6389105
User: guerler
Date: 2014-12-01 17:52:17+00:00
Summary: Merge
Affected #: 1 file
diff -r d094b6d5953c1379a69050d4cadef03c55413f06 -r 5393f6389105d22bc8791f908075c152f11a4d2e lib/galaxy/webapps/galaxy/controllers/page.py
--- a/lib/galaxy/webapps/galaxy/controllers/page.py
+++ b/lib/galaxy/webapps/galaxy/controllers/page.py
@@ -8,6 +8,7 @@
from galaxy import util
from galaxy.util.sanitize_html import sanitize_html, _BaseHTMLProcessor
from galaxy.util.json import loads
+from markupsafe import escape
def format_bool( b ):
if b:
@@ -89,9 +90,9 @@
class NameColumn( grids.TextColumn ):
def get_value(self, trans, grid, item):
if hasattr( item, "get_display_name" ):
- return item.get_display_name()
+ return escape(item.get_display_name())
else:
- return item.name
+ return escape(item.name)
# Grid definition.
show_item_checkboxes = True
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
[galaxyproject/usegalaxy-playbook] 8806f0: Update galaxy role from ansible-galaxy.
by GitHub 01 Dec '14
by GitHub 01 Dec '14
01 Dec '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 8806f00147b362ccecca457f346abd1e309338fc
https://github.com/galaxyproject/usegalaxy-playbook/commit/8806f00147b362cc…
Author: Dannon <dannon.baker(a)gmail.com>
Date: 2014-12-01 (Mon, 01 Dec 2014)
Changed paths:
M roles/galaxyprojectdotorg.galaxy/meta/.galaxy_install_info
M roles/galaxyprojectdotorg.galaxy/tasks/clone.yml
Log Message:
-----------
Update galaxy role from ansible-galaxy.
1
0
Branch: refs/tags/0.4
Home: https://github.com/galaxyproject/ansible-galaxy
1
0
[galaxyproject/ansible-galaxy] 6906b2: universe_wsgi.ini.sample is not useful for detecti...
by GitHub 01 Dec '14
by GitHub 01 Dec '14
01 Dec '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/ansible-galaxy
Commit: 6906b2bed6bd73f2c63b5b3e5046bba6da2bcc82
https://github.com/galaxyproject/ansible-galaxy/commit/6906b2bed6bd73f2c63b…
Author: dannon <dannon.baker(a)gmail.com>
Date: 2014-12-01 (Mon, 01 Dec 2014)
Changed paths:
M tasks/clone.yml
Log Message:
-----------
universe_wsgi.ini.sample is not useful for detecting existence of Galaxy anymore, switch to run.sh
Commit: c9559f7d9c4cd7d289a0569a3059c943bfd689ba
https://github.com/galaxyproject/ansible-galaxy/commit/c9559f7d9c4cd7d289a0…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-12-01 (Mon, 01 Dec 2014)
Changed paths:
M tasks/clone.yml
Log Message:
-----------
Merge pull request #1 from dannon/master
universe_wsgi.ini.sample is not useful for detecting existence of Galaxy...
Compare: https://github.com/galaxyproject/ansible-galaxy/compare/aa1a0e0e0b87...c955…
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4569b8f31c88/
Changeset: 4569b8f31c88
Branch: next-stable
User: jmchilton
Date: 2014-12-01 16:26:20+00:00
Summary: Merge stable.
Affected #: 9 files
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-acc8d1e2bc88530aa8d8651cf5f88649f6769304 latest_2014.10.06
+acb2548443ae42d39ef200d035ccc0481d6b930c latest_2014.10.06
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/display_base.mako
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -214,7 +214,7 @@
%else:
Private ${get_class_display_name( item.__class__ )}
%endif
- | ${get_item_name( item )}
+ | ${get_item_name( item ) | h}
<div style="float: right">
${self.render_item_links( item )}
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/embed_base.mako
--- a/templates/embed_base.mako
+++ b/templates/embed_base.mako
@@ -49,7 +49,7 @@
<div style="float: right;">
${self.render_item_links( item )}
</div>
- <h4><a class="toggle-embed" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item )}</a></h4>
+ <h4><a class="toggle-embed" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item ) | h}</a></h4>
%if hasattr( item, "annotation") and item.annotation:
<div class="annotation">${item.annotation}</div>
%endif
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/export_base.mako
--- a/templates/export_base.mako
+++ b/templates/export_base.mako
@@ -42,7 +42,7 @@
</%def><%def name="title()">
- Export ${get_class_display_name( item.__class__ )} '${get_item_name( item )}'
+ Export ${get_class_display_name( item.__class__ )} '${get_item_name( item ) | h}'
</%def><%def name="stylesheets()">
@@ -108,7 +108,7 @@
<%
item_name = get_item_name(item)
%>
- <h2>Download or Export ${self.item_class_name} '${item_name}'</h2>
+ <h2>Download or Export ${self.item_class_name} '${item_name | h}'</h2>
${self.render_download_to_file(item)}
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/ind_share_base.mako
--- a/templates/ind_share_base.mako
+++ b/templates/ind_share_base.mako
@@ -83,7 +83,7 @@
%><div class="toolForm">
- <div class="toolFormTitle">Share ${item_class_name} '${item_name}' with Another User</div>
+ <div class="toolFormTitle">Share ${item_class_name} '${item_name | h}' with Another User</div><div class="toolFormBody"><form action="${h.url_for(controller=item_controller, action='share', id=trans.security.encode_id( item.id ) )}" method="POST"><div class="form-row">
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/sharing_base.mako
--- a/templates/sharing_base.mako
+++ b/templates/sharing_base.mako
@@ -35,7 +35,7 @@
</%def><%def name="title()">
- Sharing and Publishing ${get_class_display_name( item.__class__ )} '${get_item_name( item )}'
+ Sharing and Publishing ${get_class_display_name( item.__class__ )} '${get_item_name( item ) | h}'
</%def><%def name="javascripts()">
@@ -122,7 +122,7 @@
item_name = get_item_name(item)
%>
- <h2>Share or Publish ${item_class_name} '${item_name}'</h2>
+ <h2>Share or Publish ${item_class_name} '${item_name | h}'</h2>
## Require that user have a public username before sharing or publishing an item.
%if trans.get_user().username is None or trans.get_user().username is "":
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/webapps/galaxy/history/embed.mako
--- a/templates/webapps/galaxy/history/embed.mako
+++ b/templates/webapps/galaxy/history/embed.mako
@@ -19,7 +19,7 @@
</div><h4><a class="toggle-embed" href="${display_href}" title="Show or hide history contents">
- Galaxy History | ${get_item_name( item )}
+ Galaxy History | ${get_item_name( item ) | h}
</a></h4>
%if hasattr( item, "annotation") and item.annotation:
diff -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 -r 4569b8f31c883e6f38f6b04c665f93cb2af534ee templates/webapps/galaxy/mobile/history/list.mako
--- a/templates/webapps/galaxy/mobile/history/list.mako
+++ b/templates/webapps/galaxy/mobile/history/list.mako
@@ -20,7 +20,7 @@
<li><a href="${h.url_for(controller='mobile', action="history_detail", id=history.id )}">
- ${history.name}
+ ${history.name | h}
<div class="secondary">${h.date.distance_of_time_in_words( history.update_time, h.date.datetime.utcnow() )} ago</div>
https://bitbucket.org/galaxy/galaxy-central/commits/d094b6d5953c/
Changeset: d094b6d5953c
User: jmchilton
Date: 2014-12-01 16:26:58+00:00
Summary: Merge next-stable.
Affected #: 9 files
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-acc8d1e2bc88530aa8d8651cf5f88649f6769304 latest_2014.10.06
+acb2548443ae42d39ef200d035ccc0481d6b930c latest_2014.10.06
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/display_base.mako
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -214,7 +214,7 @@
%else:
Private ${get_class_display_name( item.__class__ )}
%endif
- | ${get_item_name( item )}
+ | ${get_item_name( item ) | h}
<div style="float: right">
${self.render_item_links( item )}
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/embed_base.mako
--- a/templates/embed_base.mako
+++ b/templates/embed_base.mako
@@ -49,7 +49,7 @@
<div style="float: right;">
${self.render_item_links( item )}
</div>
- <h4><a class="toggle-embed" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item )}</a></h4>
+ <h4><a class="toggle-embed" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item ) | h}</a></h4>
%if hasattr( item, "annotation") and item.annotation:
<div class="annotation">${item.annotation}</div>
%endif
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/export_base.mako
--- a/templates/export_base.mako
+++ b/templates/export_base.mako
@@ -42,7 +42,7 @@
</%def><%def name="title()">
- Export ${get_class_display_name( item.__class__ )} '${get_item_name( item )}'
+ Export ${get_class_display_name( item.__class__ )} '${get_item_name( item ) | h}'
</%def><%def name="stylesheets()">
@@ -108,7 +108,7 @@
<%
item_name = get_item_name(item)
%>
- <h2>Download or Export ${self.item_class_name} '${item_name}'</h2>
+ <h2>Download or Export ${self.item_class_name} '${item_name | h}'</h2>
${self.render_download_to_file(item)}
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/ind_share_base.mako
--- a/templates/ind_share_base.mako
+++ b/templates/ind_share_base.mako
@@ -83,7 +83,7 @@
%><div class="toolForm">
- <div class="toolFormTitle">Share ${item_class_name} '${item_name}' with Another User</div>
+ <div class="toolFormTitle">Share ${item_class_name} '${item_name | h}' with Another User</div><div class="toolFormBody"><form action="${h.url_for(controller=item_controller, action='share', id=trans.security.encode_id( item.id ) )}" method="POST"><div class="form-row">
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/sharing_base.mako
--- a/templates/sharing_base.mako
+++ b/templates/sharing_base.mako
@@ -35,7 +35,7 @@
</%def><%def name="title()">
- Sharing and Publishing ${get_class_display_name( item.__class__ )} '${get_item_name( item )}'
+ Sharing and Publishing ${get_class_display_name( item.__class__ )} '${get_item_name( item ) | h}'
</%def><%def name="javascripts()">
@@ -122,7 +122,7 @@
item_name = get_item_name(item)
%>
- <h2>Share or Publish ${item_class_name} '${item_name}'</h2>
+ <h2>Share or Publish ${item_class_name} '${item_name | h}'</h2>
## Require that user have a public username before sharing or publishing an item.
%if trans.get_user().username is None or trans.get_user().username is "":
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/webapps/galaxy/history/embed.mako
--- a/templates/webapps/galaxy/history/embed.mako
+++ b/templates/webapps/galaxy/history/embed.mako
@@ -19,7 +19,7 @@
</div><h4><a class="toggle-embed" href="${display_href}" title="Show or hide history contents">
- Galaxy History | ${get_item_name( item )}
+ Galaxy History | ${get_item_name( item ) | h}
</a></h4>
%if hasattr( item, "annotation") and item.annotation:
diff -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 -r d094b6d5953c1379a69050d4cadef03c55413f06 templates/webapps/galaxy/mobile/history/list.mako
--- a/templates/webapps/galaxy/mobile/history/list.mako
+++ b/templates/webapps/galaxy/mobile/history/list.mako
@@ -20,7 +20,7 @@
<li><a href="${h.url_for(controller='mobile', action="history_detail", id=history.id )}">
- ${history.name}
+ ${history.name | h}
<div class="secondary">${h.date.distance_of_time_in_words( history.update_time, h.date.datetime.utcnow() )} ago</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: ToolForm: Add baseurl, fix dynamic drill down options
by commits-noreply@bitbucket.org 01 Dec '14
by commits-noreply@bitbucket.org 01 Dec '14
01 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7b208a4b38f9/
Changeset: 7b208a4b38f9
User: guerler
Date: 2014-12-01 06:18:16+00:00
Summary: ToolForm: Add baseurl, fix dynamic drill down options
Affected #: 7 files
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -342,6 +342,11 @@
case 'drill_down':
field = this._fieldDrilldown(input_def);
break;
+
+ // base url field
+ case 'baseurl':
+ field = this._fieldHidden(input_def);
+ break;
// field not found
default:
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -16,8 +16,7 @@
*/
_templateOption: function(name, value, selected) {
return '<div>' +
- '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
- Utils.sanitize(name) +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' + name +
'<div/>';
},
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -650,6 +650,11 @@
def get_label( self ):
# BaseURLToolParameters are ultimately "hidden" parameters
return None
+
+ def to_dict( self, trans, view='collection', value_mapper=None ):
+ d = super( BaseURLToolParameter, self ).to_dict( trans )
+ d['value'] = self.get_value( trans )
+ return d
DEFAULT_VALUE_MAP = lambda x: x
@@ -1606,13 +1611,13 @@
"""
return self.filtered.keys()
- def to_dict( self, trans, view='collection', value_mapper=None, context={} ):
+ def to_dict( self, trans, view='collection', value_mapper=None, other_values={} ):
# skip SelectToolParameter (the immediate parent) bc we need to get options in a different way here
d = ToolParameter.to_dict( self, trans )
options = []
try:
- options = self.get_options( trans, context )
+ options = self.get_options( trans=trans, other_values=other_values )
except KeyError:
# will sometimes error if self.is_dynamic and self.filtered
# bc we dont/cant fill out other_values above ({})
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -342,6 +342,11 @@
case 'drill_down':
field = this._fieldDrilldown(input_def);
break;
+
+ // base url field
+ case 'baseurl':
+ field = this._fieldHidden(input_def);
+ break;
// field not found
default:
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 static/scripts/mvc/ui/ui-drilldown.js
--- a/static/scripts/mvc/ui/ui-drilldown.js
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -16,8 +16,7 @@
*/
_templateOption: function(name, value, selected) {
return '<div>' +
- '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
- Utils.sanitize(name) +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' + name +
'<div/>';
},
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;case"baseurl":i=this._fieldHidden(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r a1fff5e41925f99d95def300a162e12db0f4b8c7 -r 7b208a4b38f934cdea8f4f331f2721adcc7c1166 static/scripts/packed/mvc/ui/ui-drilldown.js
--- a/static/scripts/packed/mvc/ui/ui-drilldown.js
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+d+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ 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
commit/galaxy-central: guerler: ToolForm: Fix select2 value selection
by commits-noreply@bitbucket.org 01 Dec '14
by commits-noreply@bitbucket.org 01 Dec '14
01 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a1fff5e41925/
Changeset: a1fff5e41925
User: guerler
Date: 2014-12-01 05:21:40+00:00
Summary: ToolForm: Fix select2 value selection
Affected #: 9 files
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -23,7 +23,7 @@
/** Template to create options tree
*/
- _templateOptions: function(data, current) {
+ _templateOptions: function(options) {
// link this
var self = this;
@@ -48,10 +48,10 @@
}
// recursive function which iterates through options
- function iterate ($tmpl, data) {
- for (i in data) {
+ function iterate ($tmpl, options) {
+ for (i in options) {
// current option level in hierarchy
- var level = data[i];
+ var level = options[i];
// check for options
var has_options = level.options.length > 0;
@@ -84,7 +84,7 @@
// iterate through options and create dom
var $tmpl = $('<div/>');
- iterate($tmpl, data);
+ iterate($tmpl, options);
return $tmpl;
},
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -7,7 +7,6 @@
initialize: function(options) {
// options
this.optionsDefault = {
- value : [],
visible : true,
data : [],
id : Utils.uuid(),
@@ -38,7 +37,7 @@
this.update(this.options.data);
// set initial value
- if (this.options.value) {
+ if (this.options.value !== undefined) {
this.value(this.options.value);
}
@@ -88,13 +87,13 @@
/** Return/Set current value
*/
value: function (new_value) {
- // check if its an array
- if (typeof new_value === 'string') {
- new_value = [new_value];
- }
-
- // set new value
+ // set new value if provided
if (new_value !== undefined) {
+ // check if its an array
+ if (!(new_value instanceof Array)) {
+ new_value = [new_value];
+ }
+
// reset selection
this.$el.find('input').prop('checked', false);
@@ -111,12 +110,14 @@
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
- if (typeof value === 'string') {
- value = [value];
- }
- for (var i in value) {
- if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
- return true;
+ if (value !== undefined) {
+ if (!(value instanceof Array)) {
+ value = [value];
+ }
+ for (var i in value) {
+ if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
+ return true;
+ }
}
}
return false;
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -75,6 +75,9 @@
value : function (new_value) {
if (new_value !== undefined) {
this.$select.val(new_value);
+ if (this.$select.select2) {
+ this.$select.select2('val', new_value);
+ }
}
return this.$select.val();
},
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/mvc/ui/ui-drilldown.js
--- a/static/scripts/mvc/ui/ui-drilldown.js
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -23,7 +23,7 @@
/** Template to create options tree
*/
- _templateOptions: function(data, current) {
+ _templateOptions: function(options) {
// link this
var self = this;
@@ -48,10 +48,10 @@
}
// recursive function which iterates through options
- function iterate ($tmpl, data) {
- for (i in data) {
+ function iterate ($tmpl, options) {
+ for (i in options) {
// current option level in hierarchy
- var level = data[i];
+ var level = options[i];
// check for options
var has_options = level.options.length > 0;
@@ -84,7 +84,7 @@
// iterate through options and create dom
var $tmpl = $('<div/>');
- iterate($tmpl, data);
+ iterate($tmpl, options);
return $tmpl;
},
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -7,7 +7,6 @@
initialize: function(options) {
// options
this.optionsDefault = {
- value : [],
visible : true,
data : [],
id : Utils.uuid(),
@@ -38,7 +37,7 @@
this.update(this.options.data);
// set initial value
- if (this.options.value) {
+ if (this.options.value !== undefined) {
this.value(this.options.value);
}
@@ -88,13 +87,13 @@
/** Return/Set current value
*/
value: function (new_value) {
- // check if its an array
- if (typeof new_value === 'string') {
- new_value = [new_value];
- }
-
- // set new value
+ // set new value if provided
if (new_value !== undefined) {
+ // check if its an array
+ if (!(new_value instanceof Array)) {
+ new_value = [new_value];
+ }
+
// reset selection
this.$el.find('input').prop('checked', false);
@@ -111,12 +110,14 @@
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
- if (typeof value === 'string') {
- value = [value];
- }
- for (var i in value) {
- if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
- return true;
+ if (value !== undefined) {
+ if (!(value instanceof Array)) {
+ value = [value];
+ }
+ for (var i in value) {
+ if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
+ return true;
+ }
}
}
return false;
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -75,6 +75,9 @@
value : function (new_value) {
if (new_value !== undefined) {
this.$select.val(new_value);
+ if (this.$select.select2) {
+ this.$select.select2('val', new_value);
+ }
}
return this.$select.val();
},
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/packed/mvc/ui/ui-drilldown.js
--- a/static/scripts/packed/mvc/ui/ui-drilldown.js
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(g,h){var e=this;function f(l,m){function k(n){if(n){m.fadeIn("fast");l.removeClass("toggle-expand");l.addClass("toggle");l.is_expanded=true}else{m.hide();l.removeClass("toggle");l.addClass("toggle-expand");l.is_expanded=false}}l.on("click",function(){k(!l.is_expanded)})}function d(q,o){for(i in o){var r=o[i];var m=r.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var k=$("<div/>");k.append(n);k.append(e._templateOption(r.name,r.value));l.append(k);var p=$('<div style="display: none; margin-left: 25px;"/>');d(p,r.options);l.append(p);f(n,p)}else{l.append(e._templateOption(r.name,r.value))}q.append(l)}}var j=$("<div/>");d(j,g);return j},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(typeof g==="string"){g=[g]}if(g!==undefined){this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd -r a1fff5e41925f99d95def300a162e12db0f4b8c7 static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c);if(this.$select.select2){this.$select.select2("val",c)}}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ 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
commit/galaxy-central: guerler: ToolForm: Add drill down element
by commits-noreply@bitbucket.org 01 Dec '14
by commits-noreply@bitbucket.org 01 Dec '14
01 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3ecc2541d8fc/
Changeset: 3ecc2541d8fc
User: guerler
Date: 2014-12-01 04:40:38+00:00
Summary: ToolForm: Add drill down element
Affected #: 25 files
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -211,7 +211,7 @@
this.tree.matchModel(new_model, function(input_id, node) {
var input = self.input_list[input_id];
if (input && input.options) {
- if (JSON.stringify(input.options) != JSON.stringify(node.options)) {
+ if (!_.isEqual(input.options, node.options)) {
// backup new options
input.options = node.options;
@@ -223,6 +223,9 @@
case 'data':
new_options = input.options;
break;
+ case 'drill_down':
+ new_options = input.options;
+ break;
default:
for (var i in node.options) {
var opt = node.options[i];
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -337,7 +337,12 @@
input_def.searchable = true;
field = this._fieldSelect(input_def);
break;
-
+
+ // drill down field
+ case 'drill_down':
+ field = this._fieldDrilldown(input_def);
+ break;
+
// field not found
default:
// flag
@@ -417,6 +422,20 @@
});
},
+ /** Drill down options field
+ */
+ _fieldDrilldown : function (input_def) {
+ var self = this;
+ return new Ui.Drilldown.View({
+ id : 'field-' + input_def.id,
+ data : input_def.options,
+ display : input_def.display,
+ onchange : function() {
+ self.app.refresh();
+ }
+ });
+ },
+
/** Text input field
*/
_fieldText : function(input_def) {
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/tools/tools-select-content.js
--- a/client/galaxy/scripts/mvc/tools/tools-select-content.js
+++ b/client/galaxy/scripts/mvc/tools/tools-select-content.js
@@ -90,6 +90,11 @@
// update options
this.update(options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// refresh view
this.refresh();
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -0,0 +1,102 @@
+// dependencies
+define(['utils/utils', 'mvc/ui/ui-options'], function(Utils, Options) {
+
+/**
+ * This class creates/wraps a drill down element.
+ */
+var View = Options.Base.extend({
+ // initialize
+ initialize: function(options) {
+ this.display = options.display || 'checkbox';
+ options.multiple = (this.display == 'checkbox');
+ Options.Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for input field
+ */
+ _templateOption: function(name, value, selected) {
+ return '<div>' +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
+ Utils.sanitize(name) +
+ '<div/>';
+ },
+
+ /** Template to create options tree
+ */
+ _templateOptions: function(data, current) {
+ // link this
+ var self = this;
+
+ // attach show/hide event
+ function attachEvents($button, $subgroup) {
+ function setVisibility (visible) {
+ if (visible) {
+ $subgroup.fadeIn('fast')
+ $button.removeClass('toggle-expand');
+ $button.addClass('toggle');
+ $button.is_expanded = true;
+ } else {
+ $subgroup.hide();
+ $button.removeClass('toggle');
+ $button.addClass('toggle-expand');
+ $button.is_expanded = false;
+ }
+ };
+ $button.on('click', function() {
+ setVisibility(!$button.is_expanded);
+ });
+ }
+
+ // recursive function which iterates through options
+ function iterate ($tmpl, data) {
+ for (i in data) {
+ // current option level in hierarchy
+ var level = data[i];
+
+ // check for options
+ var has_options = level.options.length > 0;
+
+ // build template
+ var $group = $('<div/>');
+ if (has_options) {
+ // create button and add flag
+ var $button = $('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');
+
+ // add expand group
+ var $buttongroup = $('<div/>');
+ $buttongroup.append($button);
+ $buttongroup.append(self._templateOption(level.name, level.value));
+ $group.append($buttongroup);
+
+ // add sub group
+ var $subgroup = $('<div style="display: none; margin-left: 25px;"/>');
+ iterate($subgroup, level.options);
+ $group.append($subgroup);
+
+ // attach click event to collapse/expand hierarchy
+ attachEvents($button, $subgroup);
+ } else {
+ $group.append(self._templateOption(level.name, level.value));
+ }
+ $tmpl.append($group);
+ }
+ }
+
+ // iterate through options and create dom
+ var $tmpl = $('<div/>');
+ iterate($tmpl, data);
+ return $tmpl;
+ },
+
+ /** Template for drill down view
+ */
+ _template: function(options) {
+ return '<div class="ui-options drilldown-container" id="' + options.id + '"/>';
+ }
+});
+
+return {
+ View: View
+}
+
+});
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -1,6 +1,6 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
- function(Utils, Select, Slider, Options, ButtonMenu, Modal) {
+define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-drilldown', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
+ function(Utils, Select, Slider, Options, Drilldown, ButtonMenu, Modal) {
/**
* This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc.
@@ -339,7 +339,6 @@
var Input = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
type : 'text',
placeholder : '',
disabled : false,
@@ -356,6 +355,11 @@
// create new element
this.setElement(this._template(this.options));
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// disable input field
if (this.options.disabled) {
this.$el.prop('disabled', true);
@@ -395,18 +399,18 @@
// plugin
var Hidden = Backbone.View.extend({
- // options
- optionsDefault: {
- value : ''
- },
-
// initialize
initialize : function(options) {
// configure options
- this.options = Utils.merge(options, this.optionsDefault);
+ this.options = options;
// create new element
this.setElement(this._template(this.options));
+
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
},
// value
@@ -441,6 +445,7 @@
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
- Slider : Slider
+ Slider : Slider,
+ Drilldown : Drilldown
}
});
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -2,7 +2,7 @@
define(['utils/utils'], function(Utils) {
/** Base class for options based ui elements **/
-var OptionsBase = Backbone.View.extend({
+var Base = Backbone.View.extend({
// initialize
initialize: function(options) {
// options
@@ -56,16 +56,19 @@
var current = this._getValue();
// remove all options
- this.$el.find('.ui-option').remove();
+ this.$options.empty();
- // add new options
- for (var key in options) {
- // load option template
- var $option = $(this._templateOption(options[key]));
- $option.addClass('ui-option');
-
- // append to dom
- this.$options.append($option);
+ // add new options using single option templates or full template
+ if (this._templateOptions) {
+ // rebuild options using full template
+ this.$options.append(this._templateOptions(options));
+ } else {
+ // rebuild options using single option templates
+ for (var key in options) {
+ var $option = $(this._templateOption(options[key]));
+ $option.addClass('ui-option');
+ this.$options.append($option);
+ }
}
// add change events
@@ -82,6 +85,29 @@
this.value(current);
},
+ /** Return/Set current value
+ */
+ value: function (new_value) {
+ // check if its an array
+ if (typeof new_value === 'string') {
+ new_value = [new_value];
+ }
+
+ // set new value
+ if (new_value !== undefined) {
+ // reset selection
+ this.$el.find('input').prop('checked', false);
+
+ // update to new selection
+ for (var i in new_value) {
+ this.$el.find('input[value="' + new_value[i] + '"]').first().prop('checked', true);
+ };
+ }
+
+ // get and return value
+ return this._getValue();
+ },
+
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
@@ -198,46 +224,6 @@
*/
_messageHide: function() {
this.$message.hide();
- }
-});
-
-/** Radio button field **/
-var Radio = {};
-Radio.View = OptionsBase.extend({
- // initialize
- initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
- },
-
- /** Return/Set current value
- */
- value: function (new_val) {
- // check if its an array
- if (typeof new_val === 'string') {
- new_val = [new_val];
- }
-
- // set new value
- if (new_val !== undefined) {
- // reset selection
- this.$el.find('input').prop('checked', false);
-
- // update to new selection
- for (var i in new_val) {
- this.$el.find('input[value="' + new_val[i] + '"]').prop('checked', true);
- };
- }
-
- // get and return value
- return this._getValue();
- },
-
- /** Template for options
- */
- _templateOption: function(pair) {
- return '<div>' +
- '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
- '</div>';
},
/** Main template function
@@ -247,16 +233,33 @@
}
});
+/** Radio button field **/
+var Radio = {};
+Radio.View = Base.extend({
+ // initialize
+ initialize: function(options) {
+ Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for a single option
+ */
+ _templateOption: function(pair) {
+ return '<div>' +
+ '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
+ '</div>';
+ }
+});
+
/** Checkbox options field **/
var Checkbox = {};
-Checkbox.View = Radio.View.extend({
+Checkbox.View = Base.extend({
// initialize
initialize: function(options) {
options.multiple = true;
- Radio.View.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
return '<div>' +
@@ -267,27 +270,27 @@
/** Radio button options field styled as classic buttons **/
var RadioButton = {};
-RadioButton.View = OptionsBase.extend({
+RadioButton.View = Base.extend({
// initialize
initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
/** Return/Set current value
*/
- value: function (new_val) {
+ value: function (new_value) {
// set new value
- if (new_val !== undefined) {
+ if (new_value !== undefined) {
this.$el.find('input').prop('checked', false);
this.$el.find('label').removeClass('active');
- this.$el.find('[value="' + new_val + '"]').prop('checked', true).closest('label').addClass('active');
+ this.$el.find('[value="' + new_value + '"]').prop('checked', true).closest('label').addClass('active');
}
// get and return value
return this._getValue();
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
var tmpl = '<label class="btn btn-default">';
@@ -307,6 +310,7 @@
});
return {
+ Base : Base,
Radio : Radio,
RadioButton : RadioButton,
Checkbox : Checkbox
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -41,6 +41,11 @@
// refresh
this.update(this.options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// show/hide
if (!this.options.visible) {
this.hide();
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd client/galaxy/scripts/mvc/ui/ui-slider.js
--- a/client/galaxy/scripts/mvc/ui/ui-slider.js
+++ b/client/galaxy/scripts/mvc/ui/ui-slider.js
@@ -5,7 +5,6 @@
var View = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
min : null,
max : null,
step : null,
@@ -49,6 +48,11 @@
// link text input field
this.$text = this.$el.find('#text');
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// add text field event
this.$text.on('change', function () {
self.value($(this).val());
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1606,19 +1606,20 @@
"""
return self.filtered.keys()
- def to_dict( self, trans, view='collection', value_mapper=None ):
+ def to_dict( self, trans, view='collection', value_mapper=None, context={} ):
# skip SelectToolParameter (the immediate parent) bc we need to get options in a different way here
d = ToolParameter.to_dict( self, trans )
options = []
try:
- options = self.get_options( trans, {} )
+ options = self.get_options( trans, context )
except KeyError:
# will sometimes error if self.is_dynamic and self.filtered
# bc we dont/cant fill out other_values above ({})
pass
-
d[ 'options' ] = options
+ d[ 'display' ] = self.display
+ d[ 'is_dynamic' ] = self.is_dynamic
return d
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -211,7 +211,7 @@
this.tree.matchModel(new_model, function(input_id, node) {
var input = self.input_list[input_id];
if (input && input.options) {
- if (JSON.stringify(input.options) != JSON.stringify(node.options)) {
+ if (!_.isEqual(input.options, node.options)) {
// backup new options
input.options = node.options;
@@ -223,6 +223,9 @@
case 'data':
new_options = input.options;
break;
+ case 'drill_down':
+ new_options = input.options;
+ break;
default:
for (var i in node.options) {
var opt = node.options[i];
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -337,7 +337,12 @@
input_def.searchable = true;
field = this._fieldSelect(input_def);
break;
-
+
+ // drill down field
+ case 'drill_down':
+ field = this._fieldDrilldown(input_def);
+ break;
+
// field not found
default:
// flag
@@ -417,6 +422,20 @@
});
},
+ /** Drill down options field
+ */
+ _fieldDrilldown : function (input_def) {
+ var self = this;
+ return new Ui.Drilldown.View({
+ id : 'field-' + input_def.id,
+ data : input_def.options,
+ display : input_def.display,
+ onchange : function() {
+ self.app.refresh();
+ }
+ });
+ },
+
/** Text input field
*/
_fieldText : function(input_def) {
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/tools/tools-select-content.js
--- a/static/scripts/mvc/tools/tools-select-content.js
+++ b/static/scripts/mvc/tools/tools-select-content.js
@@ -90,6 +90,11 @@
// update options
this.update(options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// refresh view
this.refresh();
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -0,0 +1,102 @@
+// dependencies
+define(['utils/utils', 'mvc/ui/ui-options'], function(Utils, Options) {
+
+/**
+ * This class creates/wraps a drill down element.
+ */
+var View = Options.Base.extend({
+ // initialize
+ initialize: function(options) {
+ this.display = options.display || 'checkbox';
+ options.multiple = (this.display == 'checkbox');
+ Options.Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for input field
+ */
+ _templateOption: function(name, value, selected) {
+ return '<div>' +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
+ Utils.sanitize(name) +
+ '<div/>';
+ },
+
+ /** Template to create options tree
+ */
+ _templateOptions: function(data, current) {
+ // link this
+ var self = this;
+
+ // attach show/hide event
+ function attachEvents($button, $subgroup) {
+ function setVisibility (visible) {
+ if (visible) {
+ $subgroup.fadeIn('fast')
+ $button.removeClass('toggle-expand');
+ $button.addClass('toggle');
+ $button.is_expanded = true;
+ } else {
+ $subgroup.hide();
+ $button.removeClass('toggle');
+ $button.addClass('toggle-expand');
+ $button.is_expanded = false;
+ }
+ };
+ $button.on('click', function() {
+ setVisibility(!$button.is_expanded);
+ });
+ }
+
+ // recursive function which iterates through options
+ function iterate ($tmpl, data) {
+ for (i in data) {
+ // current option level in hierarchy
+ var level = data[i];
+
+ // check for options
+ var has_options = level.options.length > 0;
+
+ // build template
+ var $group = $('<div/>');
+ if (has_options) {
+ // create button and add flag
+ var $button = $('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');
+
+ // add expand group
+ var $buttongroup = $('<div/>');
+ $buttongroup.append($button);
+ $buttongroup.append(self._templateOption(level.name, level.value));
+ $group.append($buttongroup);
+
+ // add sub group
+ var $subgroup = $('<div style="display: none; margin-left: 25px;"/>');
+ iterate($subgroup, level.options);
+ $group.append($subgroup);
+
+ // attach click event to collapse/expand hierarchy
+ attachEvents($button, $subgroup);
+ } else {
+ $group.append(self._templateOption(level.name, level.value));
+ }
+ $tmpl.append($group);
+ }
+ }
+
+ // iterate through options and create dom
+ var $tmpl = $('<div/>');
+ iterate($tmpl, data);
+ return $tmpl;
+ },
+
+ /** Template for drill down view
+ */
+ _template: function(options) {
+ return '<div class="ui-options drilldown-container" id="' + options.id + '"/>';
+ }
+});
+
+return {
+ View: View
+}
+
+});
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -1,6 +1,6 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
- function(Utils, Select, Slider, Options, ButtonMenu, Modal) {
+define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-drilldown', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
+ function(Utils, Select, Slider, Options, Drilldown, ButtonMenu, Modal) {
/**
* This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc.
@@ -339,7 +339,6 @@
var Input = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
type : 'text',
placeholder : '',
disabled : false,
@@ -356,6 +355,11 @@
// create new element
this.setElement(this._template(this.options));
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// disable input field
if (this.options.disabled) {
this.$el.prop('disabled', true);
@@ -395,18 +399,18 @@
// plugin
var Hidden = Backbone.View.extend({
- // options
- optionsDefault: {
- value : ''
- },
-
// initialize
initialize : function(options) {
// configure options
- this.options = Utils.merge(options, this.optionsDefault);
+ this.options = options;
// create new element
this.setElement(this._template(this.options));
+
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
},
// value
@@ -441,6 +445,7 @@
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
- Slider : Slider
+ Slider : Slider,
+ Drilldown : Drilldown
}
});
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -2,7 +2,7 @@
define(['utils/utils'], function(Utils) {
/** Base class for options based ui elements **/
-var OptionsBase = Backbone.View.extend({
+var Base = Backbone.View.extend({
// initialize
initialize: function(options) {
// options
@@ -56,16 +56,19 @@
var current = this._getValue();
// remove all options
- this.$el.find('.ui-option').remove();
+ this.$options.empty();
- // add new options
- for (var key in options) {
- // load option template
- var $option = $(this._templateOption(options[key]));
- $option.addClass('ui-option');
-
- // append to dom
- this.$options.append($option);
+ // add new options using single option templates or full template
+ if (this._templateOptions) {
+ // rebuild options using full template
+ this.$options.append(this._templateOptions(options));
+ } else {
+ // rebuild options using single option templates
+ for (var key in options) {
+ var $option = $(this._templateOption(options[key]));
+ $option.addClass('ui-option');
+ this.$options.append($option);
+ }
}
// add change events
@@ -82,6 +85,29 @@
this.value(current);
},
+ /** Return/Set current value
+ */
+ value: function (new_value) {
+ // check if its an array
+ if (typeof new_value === 'string') {
+ new_value = [new_value];
+ }
+
+ // set new value
+ if (new_value !== undefined) {
+ // reset selection
+ this.$el.find('input').prop('checked', false);
+
+ // update to new selection
+ for (var i in new_value) {
+ this.$el.find('input[value="' + new_value[i] + '"]').first().prop('checked', true);
+ };
+ }
+
+ // get and return value
+ return this._getValue();
+ },
+
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
@@ -198,46 +224,6 @@
*/
_messageHide: function() {
this.$message.hide();
- }
-});
-
-/** Radio button field **/
-var Radio = {};
-Radio.View = OptionsBase.extend({
- // initialize
- initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
- },
-
- /** Return/Set current value
- */
- value: function (new_val) {
- // check if its an array
- if (typeof new_val === 'string') {
- new_val = [new_val];
- }
-
- // set new value
- if (new_val !== undefined) {
- // reset selection
- this.$el.find('input').prop('checked', false);
-
- // update to new selection
- for (var i in new_val) {
- this.$el.find('input[value="' + new_val[i] + '"]').prop('checked', true);
- };
- }
-
- // get and return value
- return this._getValue();
- },
-
- /** Template for options
- */
- _templateOption: function(pair) {
- return '<div>' +
- '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
- '</div>';
},
/** Main template function
@@ -247,16 +233,33 @@
}
});
+/** Radio button field **/
+var Radio = {};
+Radio.View = Base.extend({
+ // initialize
+ initialize: function(options) {
+ Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for a single option
+ */
+ _templateOption: function(pair) {
+ return '<div>' +
+ '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
+ '</div>';
+ }
+});
+
/** Checkbox options field **/
var Checkbox = {};
-Checkbox.View = Radio.View.extend({
+Checkbox.View = Base.extend({
// initialize
initialize: function(options) {
options.multiple = true;
- Radio.View.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
return '<div>' +
@@ -267,27 +270,27 @@
/** Radio button options field styled as classic buttons **/
var RadioButton = {};
-RadioButton.View = OptionsBase.extend({
+RadioButton.View = Base.extend({
// initialize
initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
/** Return/Set current value
*/
- value: function (new_val) {
+ value: function (new_value) {
// set new value
- if (new_val !== undefined) {
+ if (new_value !== undefined) {
this.$el.find('input').prop('checked', false);
this.$el.find('label').removeClass('active');
- this.$el.find('[value="' + new_val + '"]').prop('checked', true).closest('label').addClass('active');
+ this.$el.find('[value="' + new_value + '"]').prop('checked', true).closest('label').addClass('active');
}
// get and return value
return this._getValue();
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
var tmpl = '<label class="btn btn-default">';
@@ -307,6 +310,7 @@
});
return {
+ Base : Base,
Radio : Radio,
RadioButton : RadioButton,
Checkbox : Checkbox
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -41,6 +41,11 @@
// refresh
this.update(this.options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// show/hide
if (!this.options.visible) {
this.hide();
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/mvc/ui/ui-slider.js
--- a/static/scripts/mvc/ui/ui-slider.js
+++ b/static/scripts/mvc/ui/ui-slider.js
@@ -5,7 +5,6 @@
var View = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
min : null,
max : null,
step : null,
@@ -49,6 +48,11 @@
// link text input field
this.$text = this.$el.find('#text');
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// add text field event
this.$text.on('change', function () {
self.value($(this).val());
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(this.is_dynamic){var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})}},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(JSON.stringify(p.options)!=JSON.stringify(u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,cls:"ui-portlet-slim",operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(this.is_dynamic){var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})}},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(!_.isEqual(p.options,u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;case"drill_down":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,cls:"ui-portlet-slim",operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/tools/tools-select-content.js
--- a/static/scripts/packed/mvc/tools/tools-select-content.js
+++ b/static/scripts/packed/mvc/tools/tools-select-content.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(k,g){this.app=k;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(!g.multiple){this.current="single"}else{this.current="multiple"}if(!g.multiple){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"};j.push({icon:"fa-folder-o",label:"List of datasets",value:"collection"});this.select_collection=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"};this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());this.$el.append(c.wrap(this.button_type.$el));for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple.update(l);this.select_collection.update(f);this.app.content.add(g)},value:function(m){if(m&&m.values){try{var l=[];for(var h in m.values){l.push(m.values[h].id)}if(m&&m.values.length>0&&m.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(l.length>1||this.options.multiple){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}this.refresh();var g=this._select();if(!g.validate()){g.value(g.first())}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:!this.options.multiple&&this.current!="single",values:[]};for(var h in j){f.values.push({id:j[h],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.current!="single"&&!this.options.multiple){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(k,g){this.app=k;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(!g.multiple){this.current="single"}else{this.current="multiple"}if(!g.multiple){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"};j.push({icon:"fa-folder-o",label:"List of datasets",value:"collection"});this.select_collection=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"};this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());this.$el.append(c.wrap(this.button_type.$el));for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);if(this.options.value!==undefined){this.value(this.options.value)}this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple.update(l);this.select_collection.update(f);this.app.content.add(g)},value:function(m){if(m&&m.values){try{var l=[];for(var h in m.values){l.push(m.values[h].id)}if(m&&m.values.length>0&&m.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(l.length>1||this.options.multiple){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}this.refresh();var g=this._select();if(!g.validate()){g.value(g.first())}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:!this.options.multiple&&this.current!="single",values:[]};for(var h in j){f.values.push({id:j[h],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.current!="single"&&!this.options.multiple){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -0,0 +1,1 @@
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(g,h){var e=this;function f(l,m){function k(n){if(n){m.fadeIn("fast");l.removeClass("toggle-expand");l.addClass("toggle");l.is_expanded=true}else{m.hide();l.removeClass("toggle");l.addClass("toggle-expand");l.is_expanded=false}}l.on("click",function(){k(!l.is_expanded)})}function d(q,o){for(i in o){var r=o[i];var m=r.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var k=$("<div/>");k.append(n);k.append(e._templateOption(r.name,r.value));l.append(k);var p=$('<div style="display: none; margin-left: 25px;"/>');d(p,r.options);l.append(p);f(n,p)}else{l.append(e._templateOption(r.name,r.value))}q.append(l)}}var j=$("<div/>");d(j,g);return j},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/ui/ui-misc.js
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,n,p,l){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(q){return'<img class="ui-image '+q.cls+'" src="'+q.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},title:function(q){this.$el.html(q)},_template:function(q){return'<label class="ui-label '+q.cls+'">'+q.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){return'<div><span class="fa '+q.icon+'" class="ui-icon"/> '+q.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(q.onclick){q.onclick()}});$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){var r='<button id="'+q.id+'" type="submit" style="float: '+q.floating+';" type="button" class="'+q.cls+'">';if(q.icon){r+='<i class="icon fa '+q.icon+'"></i> '}r+=q.title+"</button>";return r}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var q=this;$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick&&!q.disabled){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(q){var r="";if(q.title){r="width: auto;"}var s='<div id="'+q.id+'" style="float: '+q.floating+"; "+r+'" class="'+q.cls+'">';if(q.title){s+='<div class="button"><i class="icon fa '+q.icon+'"/> <span class="title">'+q.title+"</span></div>"}else{s+='<i class="icon fa '+q.icon+'"/>'}s+="</div>";return s}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",q.onclick)},_template:function(q){return'<div><a href="javascript:void(0)" class="ui-anchor '+q.cls+'">'+q.title+"</a></div>"}});var m=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement("<div></div>")},update:function(r){this.options=k.merge(r,this.optionsDefault);if(r.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(r.message);this.$el.fadeIn();if(!r.persistent){var q=this;window.setTimeout(function(){if(q.$el.is(":visible")){q.$el.fadeOut()}else{q.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(q){return'<div class="ui-message alert alert-'+q.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));var q=this;if(this.options.onclick){this.$el.on("submit",function(t){var s=q.$el.find("#search");q.options.onclick(s.val())})}},_template:function(q){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+q.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var q=this;this.$el.on("input",function(){if(q.options.onchange){q.options.onchange(q.$el.val())}})},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){if(q.area){return'<textarea id="'+q.id+'" class="ui-textarea '+q.cls+'"></textarea>'}else{return'<input id="'+q.id+'" type="'+q.type+'" value="'+q.value+'" placeholder="'+q.placeholder+'" class="ui-input '+q.cls+'">'}}});var o=Backbone.View.extend({optionsDefault:{value:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){return'<hidden id="'+q.id+'" value="'+q.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:p,Icon:c,Image:d,Input:i,Label:j,Message:m,Modal:l,RadioButton:n.RadioButton,Checkbox:n.Checkbox,Radio:n.Radio,Searchbox:a,Select:b,Hidden:o,Slider:e}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,o,l,q,m){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="'+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var r=this;$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick&&!r.disabled){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="'+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var n=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement("<div></div>")},update:function(s){this.options=k.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(!s.persistent){var r=this;window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){if(r.area){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'"></textarea>'}else{return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}}});var p=Backbone.View.extend({initialize:function(r){this.options=r;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){return'<hidden id="'+r.id+'" value="'+r.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:i,Label:j,Message:n,Modal:m,RadioButton:o.RadioButton,Checkbox:o.Checkbox,Radio:o.Radio,Searchbox:a,Select:b,Hidden:p,Slider:e,Drilldown:l}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$el.find(".ui-option").remove();for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(typeof f==="string"){f=[f]}if(f!==undefined){this.$el.find("input").prop("checked",false);for(var g in f){this.$el.find('input[value="'+f[g]+'"]').prop("checked",true)}}return this._getValue()},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"},_template:function(){return'<div class="ui-options"/>'}});var c={};c.View=d.View.extend({initialize:function(f){f.multiple=true;d.View.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(typeof g==="string"){g=[g]}if(g!==undefined){this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
diff -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 -r 3ecc2541d8fc5170d9337f06b206ec09557f3afd static/scripts/packed/mvc/ui/ui-slider.js
--- a/static/scripts/packed/mvc/ui/ui-slider.js
+++ b/static/scripts/packed/mvc/ui/ui-slider.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{value:"",min:null,max:null,step:null,precise:false,split:10000},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.useslider=this.options.max!==null&&this.options.min!==null&&this.options.max>this.options.min;if(this.options.step===null){this.options.step=1;if(this.options.precise&&this.useslider){this.options.step=(this.options.max-this.options.min)/this.options.split}}if(this.useslider){this.$slider=this.$el.find("#slider");this.$slider.slider(this.options);this.$slider.on("slide",function(f,g){c.value(g.value)})}else{this.$el.find(".ui-form-slider-text").css("width","100%")}this.$text=this.$el.find("#text");this.$text.on("change",function(){c.value($(this).val())});var e=[];this.$text.on("keyup",function(f){e[f.which]=false});this.$text.on("keydown",function(g){var f=g.which;e[f]=true;if(!(f==8||f==9||f==13||f==37||f==39||(f>=48&&f<=57)||(f==190&&$(this).val().indexOf(".")==-1&&c.options.precise)||(f==189&&$(this).val().indexOf("-")==-1)||e[91]||e[17])){event.preventDefault()}})},value:function(c){if(c!==undefined){if(isNaN(c)){c=0}if(this.options.max!==null){c=Math.min(c,this.options.max)}if(this.options.min!==null){c=Math.max(c,this.options.min)}if(this.options.onchange){this.options.onchange(c)}this.$slider&&this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{min:null,max:null,step:null,precise:false,split:10000},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.useslider=this.options.max!==null&&this.options.min!==null&&this.options.max>this.options.min;if(this.options.step===null){this.options.step=1;if(this.options.precise&&this.useslider){this.options.step=(this.options.max-this.options.min)/this.options.split}}if(this.useslider){this.$slider=this.$el.find("#slider");this.$slider.slider(this.options);this.$slider.on("slide",function(f,g){c.value(g.value)})}else{this.$el.find(".ui-form-slider-text").css("width","100%")}this.$text=this.$el.find("#text");if(this.options.value!==undefined){this.value(this.options.value)}this.$text.on("change",function(){c.value($(this).val())});var e=[];this.$text.on("keyup",function(f){e[f.which]=false});this.$text.on("keydown",function(g){var f=g.which;e[f]=true;if(!(f==8||f==9||f==13||f==37||f==39||(f>=48&&f<=57)||(f==190&&$(this).val().indexOf(".")==-1&&c.options.precise)||(f==189&&$(this).val().indexOf("-")==-1)||e[91]||e[17])){event.preventDefault()}})},value:function(c){if(c!==undefined){if(isNaN(c)){c=0}if(this.options.max!==null){c=Math.min(c,this.options.max)}if(this.options.min!==null){c=Math.max(c,this.options.min)}if(this.options.onchange){this.options.onchange(c)}this.$slider&&this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ 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
commit/galaxy-central: natefoo: Update tag latest_2014.10.06 for changeset acb2548443ae
by commits-noreply@bitbucket.org 27 Nov '14
by commits-noreply@bitbucket.org 27 Nov '14
27 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/26aab19109ce/
Changeset: 26aab19109ce
Branch: stable
User: natefoo
Date: 2014-11-27 14:00:14+00:00
Summary: Update tag latest_2014.10.06 for changeset acb2548443ae
Affected #: 1 file
diff -r acb2548443ae42d39ef200d035ccc0481d6b930c -r 26aab19109ce7956f29bfc4f5877e6950c0fae56 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -20,4 +20,4 @@
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
548ab24667d6206780237bd807f7d857a484c461 latest_2014.08.11
2092948937ac30ef82f71463a235c66d34987088 release_2014.10.06
-adc4aa8b3d9ad77ef85f8b0d7e4d90bd29775167 latest_2014.10.06
+acb2548443ae42d39ef200d035ccc0481d6b930c latest_2014.10.06
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
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 49ee6f1dff6ade330d324428197fdc1674963b6f
https://github.com/galaxyproject/usegalaxy-playbook/commit/49ee6f1dff6ade33…
Author: dannon <dannon.baker(a)gmail.com>
Date: 2014-11-26 (Wed, 26 Nov 2014)
Changed paths:
M files/galaxy/test.galaxyproject.org/var/integrated_tool_panel.xml
M stage/group_vars/all.yml
Log Message:
-----------
Update Test.
1
0
26 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3975b317ffdc/
Changeset: 3975b317ffdc
User: dannon
Date: 2014-11-26 18:25:30+00:00
Summary: Merge next-stable.
Affected #: 1 file
diff -r c5321f66c314cdfcaeb0aaedcc65c479558abf3a -r 3975b317ffdcbaa6c8dcb4b2b52404bfa34edbc2 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -148,7 +148,7 @@
"""
raise TypeError( "Abstract method" )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
""" Determine the runtime state (potentially different from self.state
which describes configuration state). This (again unlike self.state) is
currently always a `DefaultToolState` object.
@@ -259,7 +259,7 @@
errors[ name ] = error
return errors
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
if step_updates and "tool_state" in step_updates:
# Fix this for multiple inputs
state = self.decode_runtime_state( trans, step_updates.pop( "tool_state" ) )
@@ -716,7 +716,7 @@
def check_and_update_state( self ):
return self.tool.check_and_update_param_values( self.state.inputs, self.trans, allow_workflow_parameters=True )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
# Warning: This method destructively modifies existing step state.
step_errors = None
state = self.state
@@ -727,7 +727,7 @@
old_errors = state.inputs.pop( "__errors__", {} )
# Update the state
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
- update_only=True, old_errors=old_errors, source="json" )
+ update_only=True, old_errors=old_errors, source=source )
return state, step_errors
def execute( self, trans, progress, invocation, step ):
@@ -956,7 +956,7 @@
def __init__( self, trans ):
self.trans = trans
- def inject( self, step, step_args=None ):
+ def inject( self, step, step_args=None, source="html" ):
""" Pre-condition: `step` is an ORM object coming from the database, if
supplied `step_args` is the representation of the inputs for that step
supplied via web form.
@@ -998,7 +998,7 @@
# are not persisted so we need to do it every time)
module.add_dummy_datasets( connections=step.input_connections )
- state, step_errors = module.compute_runtime_state( trans, step_args )
+ state, step_errors = module.compute_runtime_state( trans, step_args, source=source )
step.state = state
return step_errors
@@ -1011,7 +1011,7 @@
module_injector = WorkflowModuleInjector( trans )
for step in workflow.steps:
step_args = param_map.get( step.id, {} )
- step_errors = module_injector.inject( step, step_args=step_args )
+ step_errors = module_injector.inject( step, step_args=step_args, source="json" )
if step.type == 'tool' or step.type is None:
if step_errors:
message = "Workflow cannot be run because of validation errors in some steps: %s" % step_errors
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: jmchilton: Fix boolean parameter handling at workflow runtime.
by commits-noreply@bitbucket.org 26 Nov '14
by commits-noreply@bitbucket.org 26 Nov '14
26 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3a30a79840d4/
Changeset: 3a30a79840d4
Branch: next-stable
User: jmchilton
Date: 2014-11-26 17:42:00+00:00
Summary: Fix boolean parameter handling at workflow runtime.
Broken with 011c8b2118be778eaf1ba952730ff876d6447ba9.
Note to self - update pause module when merging into next-stable.
Affected #: 1 file
diff -r d94fef1095439d5cf7145ca6eb13b9f12f453874 -r 3a30a79840d4e5e4896910dcf2f161a38d7977b0 lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -148,7 +148,7 @@
"""
raise TypeError( "Abstract method" )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
""" Determine the runtime state (potentially different from self.state
which describes configuration state). This (again unlike self.state) is
currently always a `DefaultToolState` object.
@@ -259,7 +259,7 @@
errors[ name ] = error
return errors
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
if step_updates and "tool_state" in step_updates:
# Fix this for multiple inputs
state = self.decode_runtime_state( trans, step_updates.pop( "tool_state" ) )
@@ -716,7 +716,7 @@
def check_and_update_state( self ):
return self.tool.check_and_update_param_values( self.state.inputs, self.trans, allow_workflow_parameters=True )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
# Warning: This method destructively modifies existing step state.
step_errors = None
state = self.state
@@ -727,7 +727,7 @@
old_errors = state.inputs.pop( "__errors__", {} )
# Update the state
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
- update_only=True, old_errors=old_errors, source="json" )
+ update_only=True, old_errors=old_errors, source=source )
return state, step_errors
def execute( self, trans, progress, invocation, step ):
@@ -956,7 +956,7 @@
def __init__( self, trans ):
self.trans = trans
- def inject( self, step, step_args=None ):
+ def inject( self, step, step_args=None, source="html" ):
""" Pre-condition: `step` is an ORM object coming from the database, if
supplied `step_args` is the representation of the inputs for that step
supplied via web form.
@@ -998,7 +998,7 @@
# are not persisted so we need to do it every time)
module.add_dummy_datasets( connections=step.input_connections )
- state, step_errors = module.compute_runtime_state( trans, step_args )
+ state, step_errors = module.compute_runtime_state( trans, step_args, source=source )
step.state = state
return step_errors
@@ -1011,7 +1011,7 @@
module_injector = WorkflowModuleInjector( trans )
for step in workflow.steps:
step_args = param_map.get( step.id, {} )
- step_errors = module_injector.inject( step, step_args=step_args )
+ step_errors = module_injector.inject( step, step_args=step_args, source="json" )
if step.type == 'tool' or step.type is None:
if step_errors:
message = "Workflow cannot be run because of validation errors in some steps: %s" % step_errors
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: jmchilton: Fix boolean parameter handling at workflow runtime.
by commits-noreply@bitbucket.org 26 Nov '14
by commits-noreply@bitbucket.org 26 Nov '14
26 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/acb2548443ae/
Changeset: acb2548443ae
Branch: stable
User: jmchilton
Date: 2014-11-26 17:42:00+00:00
Summary: Fix boolean parameter handling at workflow runtime.
Broken with 011c8b2118be778eaf1ba952730ff876d6447ba9.
Note to self - update pause module when merging into next-stable.
Affected #: 1 file
diff -r c50a228167b0a1a4541f46bb19b8d67c9010248d -r acb2548443ae42d39ef200d035ccc0481d6b930c lib/galaxy/workflow/modules.py
--- a/lib/galaxy/workflow/modules.py
+++ b/lib/galaxy/workflow/modules.py
@@ -147,7 +147,7 @@
"""
raise TypeError( "Abstract method" )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
""" Determine the runtime state (potentially different from self.state
which describes configuration state). This (again unlike self.state) is
currently always a `DefaultToolState` object.
@@ -258,7 +258,7 @@
errors[ name ] = error
return errors
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
if step_updates:
# Fix this for multiple inputs
state = self.decode_runtime_state( trans, step_updates.pop( "tool_state" ) )
@@ -598,7 +598,7 @@
def check_and_update_state( self ):
return self.tool.check_and_update_param_values( self.state.inputs, self.trans, allow_workflow_parameters=True )
- def compute_runtime_state( self, trans, step_updates=None ):
+ def compute_runtime_state( self, trans, step_updates=None, source="html" ):
# Warning: This method destructively modifies existing step state.
step_errors = None
state = self.state
@@ -609,7 +609,7 @@
old_errors = state.inputs.pop( "__errors__", {} )
# Update the state
step_errors = tool.update_state( trans, tool.inputs, state.inputs, step_updates,
- update_only=True, old_errors=old_errors, source="json" )
+ update_only=True, old_errors=old_errors, source=source )
return state, step_errors
def execute( self, trans, progress, invocation, step ):
@@ -784,7 +784,7 @@
def __init__( self, trans ):
self.trans = trans
- def inject( self, step, step_args=None ):
+ def inject( self, step, step_args=None, source="html" ):
""" Pre-condition: `step` is an ORM object coming from the database, if
supplied `step_args` is the representation of the inputs for that step
supplied via web form.
@@ -827,7 +827,7 @@
# are not persisted so we need to do it every time)
module.add_dummy_datasets( connections=step.input_connections )
- state, step_errors = module.compute_runtime_state( trans, step_args )
+ state, step_errors = module.compute_runtime_state( trans, step_args, source=source )
step.state = state
return step_errors
@@ -840,7 +840,7 @@
module_injector = WorkflowModuleInjector( trans )
for step in workflow.steps:
step_args = param_map.get( step.id, {} )
- step_errors = module_injector.inject( step, step_args=step_args )
+ step_errors = module_injector.inject( step, step_args=step_args, source="json" )
if step.type == 'tool' or step.type is None:
if step_errors:
message = "Workflow cannot be run because of validation errors in some steps: %s" % step_errors
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/d94fef109543/
Changeset: d94fef109543
Branch: next-stable
User: guerler
Date: 2014-11-26 17:42:46+00:00
Summary: ToolForm: Ensure that the correct definition for booleans is used
Affected #: 1 file
diff -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 -r d94fef1095439d5cf7145ca6eb13b9f12f453874 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -587,7 +587,7 @@
error = 'State validation failed.'
try:
# resolves the inconsistent definition of boolean parameters (see base.py) without modifying shared code
- if input.type == 'boolean':
+ if input.type == 'boolean' and isinstance(default_value, basestring):
value, error = [util.string_as_bool(default_value), None]
else:
value, error = check_param(trans, input, default_value, context)
https://bitbucket.org/galaxy/galaxy-central/commits/c5321f66c314/
Changeset: c5321f66c314
User: guerler
Date: 2014-11-26 17:43:05+00:00
Summary: Merge
Affected #: 1 file
diff -r 5f178251e9b579f62ceb172ab562d67d1c841b73 -r c5321f66c314cdfcaeb0aaedcc65c479558abf3a lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -594,7 +594,7 @@
error = 'State validation failed.'
try:
# resolves the inconsistent definition of boolean parameters (see base.py) without modifying shared code
- if input.type == 'boolean':
+ if input.type == 'boolean' and isinstance(default_value, basestring):
value, error = [util.string_as_bool(default_value), None]
else:
value, error = check_param(trans, input, default_value, context)
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5f178251e9b5/
Changeset: 5f178251e9b5
User: carlfeberhard
Date: 2014-11-26 17:29:18+00:00
Summary: merge
Affected #: 18 files
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 client/galaxy/scripts/mvc/annotations.js
--- a/client/galaxy/scripts/mvc/annotations.js
+++ b/client/galaxy/scripts/mvc/annotations.js
@@ -56,7 +56,7 @@
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
- annotation,
+ _.escape( annotation ),
'</div>'
].join( '' );
},
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 client/galaxy/scripts/mvc/tags.js
--- a/client/galaxy/scripts/mvc/tags.js
+++ b/client/galaxy/scripts/mvc/tags.js
@@ -56,7 +56,9 @@
if( !_.isArray( tagsArray ) || _.isEmpty( tagsArray ) ){
return '';
}
- return tagsArray.sort().join( ',' );
+ return tagsArray.map( function( tag ){
+ return _.escape( tag );
+ }).sort().join( ',' );
},
/** @returns {jQuery} the input for this view */
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 static/scripts/mvc/annotations.js
--- a/static/scripts/mvc/annotations.js
+++ b/static/scripts/mvc/annotations.js
@@ -56,7 +56,7 @@
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
- annotation,
+ _.escape( annotation ),
'</div>'
].join( '' );
},
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 static/scripts/mvc/tags.js
--- a/static/scripts/mvc/tags.js
+++ b/static/scripts/mvc/tags.js
@@ -56,7 +56,9 @@
if( !_.isArray( tagsArray ) || _.isEmpty( tagsArray ) ){
return '';
}
- return tagsArray.sort().join( ',' );
+ return tagsArray.map( function( tag ){
+ return _.escape( tag );
+ }).sort().join( ',' );
},
/** @returns {jQuery} the input for this view */
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 static/scripts/packed/mvc/annotations.js
--- a/static/scripts/packed/mvc/annotations.js
+++ b/static/scripts/packed/mvc/annotations.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(a,c){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(d){d=d||{};this.tooltipConfig=d.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(e){d.$annotation().text(e);d.model.save({annotation:e},{silent:true}).fail(function(){d.$annotation().text(d.model.previous("annotation"))})}});return this},_template:function(){var d=this.model.get("annotation");return['<label class="prompt">',c("Annotation"),"</label>",'<div class="annotation" title="',c("Edit annotation"),'">',d,"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(a,c){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(d){d=d||{};this.tooltipConfig=d.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(e){d.$annotation().text(e);d.model.save({annotation:e},{silent:true}).fail(function(){d.$annotation().text(d.model.previous("annotation"))})}});return this},_template:function(){var d=this.model.get("annotation");return['<label class="prompt">',c("Annotation"),"</label>",'<div class="annotation" title="',c("Edit annotation"),'">',_.escape(d),"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:b}});
\ No newline at end of file
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 static/scripts/packed/mvc/tags.js
--- a/static/scripts/packed/mvc/tags.js
+++ b/static/scripts/packed/mvc/tags.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(d){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return d._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',b("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var d=this.model.get("tags");if(!_.isArray(d)||_.isEmpty(d)){return""}return d.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var d=this;this.$input().on("change",function(e){d.model.save({tags:e.val},{silent:true});if(e.added){d._addNewTagToTagsUsed(e.added.text+"")}})},_addNewTagToTagsUsed:function(d){var e=Galaxy.currUser.get("tags_used");if(!_.contains(e,d)){e.push(d);e.sort();Galaxy.currUser.set("tags_used",e)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:c}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(d){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return d._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',b("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var d=this.model.get("tags");if(!_.isArray(d)||_.isEmpty(d)){return""}return d.map(function(e){return _.escape(e)}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var d=this;this.$input().on("change",function(e){d.model.save({tags:e.val},{silent:true});if(e.added){d._addNewTagToTagsUsed(e.added.text+"")}})},_addNewTagToTagsUsed:function(d){var e=Galaxy.currUser.get("tags_used");if(!_.contains(e,d)){e.push(d);e.sort();Galaxy.currUser.set("tags_used",e)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:c}});
\ No newline at end of file
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/copy_view.mako
--- a/templates/webapps/galaxy/dataset/copy_view.mako
+++ b/templates/webapps/galaxy/dataset/copy_view.mako
@@ -53,7 +53,7 @@
%><option value="${trans.security.encode_id(hist.id)}" ${selected}>
- ${i + 1}: ${h.truncate(util.unicodify( hist.name ), 30)}${current_history_text}
+ ${i + 1}: ${h.truncate(util.unicodify( hist.name ), 30) | h}${current_history_text}
</option>
%endfor
</select>
@@ -70,7 +70,7 @@
%><div class="form-row"><input type="checkbox" name="source_content_ids" id="${input_id}" value="${input_id}"${checked}/>
- <label for="${input_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name)}</label>
+ <label for="${input_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name) | h}</label></div>
%endfor
%else:
@@ -95,7 +95,7 @@
if encoded_id == target_history_id:
selected = " selected='selected'"
%>
- <option value="${encoded_id}"${selected}>${i + 1}: ${h.truncate( util.unicodify( hist.name ), 30)}${source_history_text}</option>
+ <option value="${encoded_id}"${selected}>${i + 1}: ${h.truncate( util.unicodify( hist.name ), 30) | h}${source_history_text}</option>
%endfor
</select><br /><br /><a style="margin-left: 10px;" href="javascript:void(0);" id="select-multiple">Choose multiple histories</a>
@@ -110,7 +110,7 @@
%><div class="form-row"><input type="checkbox" name="target_history_ids" id="hist_${encoded_id}" value="${encoded_id}"/>
- <label for="hist_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${ util.unicodify( hist.name ) }${cur_history_text}</label>
+ <label for="hist_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${ util.unicodify( hist.name ) | h }${cur_history_text}</label></div>
%endfor
</div>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -26,13 +26,11 @@
data.createTabularDatasetChunkedView({
// TODO: encode id.
dataset_config:
- _.extend( ${h.dumps( item.to_dict() )},
- {
- chunk_url: "${h.url_for( controller='/dataset', action='display',
- dataset_id=trans.security.encode_id( item.id ))}",
- first_data_chunk: ${first_chunk}
- }
- ),
+ _.extend( ${h.dumps( item.to_dict() )}, {
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
+ dataset_id=trans.security.encode_id( item.id ))}",
+ first_data_chunk: ${first_chunk}
+ }),
parent_elt: $('.page-body')
});
});
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/embed.mako
--- a/templates/webapps/galaxy/dataset/embed.mako
+++ b/templates/webapps/galaxy/dataset/embed.mako
@@ -4,10 +4,13 @@
%><%def name="render_item_links( dataset )">
- <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}" title="Save dataset" class="icon-button disk"></a>
+ <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}"
+ title="Save dataset" class="icon-button disk"></a>
## Links for importing and viewing an item.
- <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}" title="Import dataset" class="icon-button import"></a>
- <a class="icon-button go-to-full-screen" href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}" title="Go to dataset"></a>
+ <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}"
+ title="Import dataset" class="icon-button import"></a>
+ <a href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}"
+ title="Go to dataset" class="icon-button go-to-full-screen"></a></%def>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/errors.mako
--- a/templates/webapps/galaxy/dataset/errors.mako
+++ b/templates/webapps/galaxy/dataset/errors.mako
@@ -49,7 +49,7 @@
<body><h2>Dataset generation errors</h2>
- <p><b>Dataset ${hda.hid}: ${hda.display_name()}</b></p>
+ <p><b>Dataset ${hda.hid}: ${hda.display_name() | h}</b></p><% job = hda.creating_job %>
%if job:
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/security_common.mako
--- a/templates/webapps/galaxy/dataset/security_common.mako
+++ b/templates/webapps/galaxy/dataset/security_common.mako
@@ -77,7 +77,7 @@
else:
current_actions = []
permitted_actions = {}.items()
- obj_str = 'unknown object %s' %obj_name
+ obj_str = 'unknown object %s' % obj_name
obj_type = ''
%><script type="text/javascript">
@@ -104,7 +104,7 @@
});
</script><div class="toolForm">
- <div class="toolFormTitle">Manage ${obj_type} permissions on ${obj_str}</div>
+ <div class="toolFormTitle">Manage ${obj_type} permissions on ${obj_str | h}</div><div class="toolFormBody"><form name="edit_role_associations" id="edit_role_associations" action="${form_url}" method="post"><div class="form-row"></div>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -15,14 +15,12 @@
}
});
- require(['mvc/data'], function(data) {
+ require([ 'mvc/data' ], function( data ) {
data.createTabularDatasetChunkedView({
- dataset_config: _.extend( ${h.dumps( trans.security.encode_dict_ids( dataset.to_dict() ) )},
- {
- first_data_chunk: ${chunk}
- }
- ),
- parent_elt: $('body')
+ dataset_config : _.extend( ${ h.dumps( trans.security.encode_dict_ids( dataset.to_dict() ) )}, {
+ first_data_chunk: ${ chunk }
+ }),
+ parent_elt : $( 'body' )
});
});
</script>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/history/embed.mako
--- a/templates/webapps/galaxy/history/embed.mako
+++ b/templates/webapps/galaxy/history/embed.mako
@@ -23,7 +23,7 @@
</a></h4>
%if hasattr( item, "annotation") and item.annotation:
- <div class="annotation">${item.annotation}</div>
+ <div class="annotation">${item.annotation | h}</div>
%endif
</div><div class='summary-content'>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/history/history_panel.mako
--- a/templates/webapps/galaxy/history/history_panel.mako
+++ /dev/null
@@ -1,14 +0,0 @@
-## shortcuts for script tags that create history panels
-## ----------------------------------------------------------------------------
-<%def name="current_history_panel( selector_to_attach_to=None, options )">
-</%def>
-
-
-## ----------------------------------------------------------------------------
-<%def name="history_panel( history_id, selector_to_attach_to=None, options )">
-</%def>
-
-
-## ----------------------------------------------------------------------------
-<%def name="bootstrapped_history_panel( history, hdas, selector_to_attach_to=None, options )">
-</%def>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/history/share.mako
--- a/templates/webapps/galaxy/history/share.mako
+++ b/templates/webapps/galaxy/history/share.mako
@@ -20,7 +20,7 @@
<tr><td><input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- ${ util.unicodify( history.name )}
+ ${ util.unicodify( history.name ) | h }
</td><td>
%if len( history.datasets ) < 1:
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/history/view.mako
--- a/templates/webapps/galaxy/history/view.mako
+++ b/templates/webapps/galaxy/history/view.mako
@@ -1,4 +1,4 @@
-<%namespace file="/galaxy.masthead.mako" import="get_user_json" />
+<%namespace file="/galaxy_client_app.mako" import="get_user_json" />
## ----------------------------------------------------------------------------
<%!
@@ -166,9 +166,9 @@
// use_panels effects where the the center_panel() is rendered:
// w/o it renders to the body, w/ it renders to #center - we need to adjust a few things for scrolling to work
var hasMasthead = ${ 'true' if use_panels else 'false' },
- userIsOwner = ${'true' if user_is_owner else 'false'},
- historyJSON = ${h.dumps( history )},
- hdaJSON = ${h.dumps( hdas )},
+ userIsOwner = ${ 'true' if user_is_owner else 'false' },
+ historyJSON = ${ h.dumps( history ) },
+ hdaJSON = ${ h.dumps( hdas ) },
panelToUse = ( userIsOwner )?
//TODO: change class names
({ location: 'mvc/history/history-panel-edit', className: 'HistoryPanelEdit' }):
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/page/editor.mako
--- a/templates/webapps/galaxy/page/editor.mako
+++ b/templates/webapps/galaxy/page/editor.mako
@@ -47,7 +47,7 @@
<a id="close-button" class="panel-header-button">Close</a></div><div class="unified-panel-header-inner">
- Page Editor <span style="font-weight: normal">| Title : ${page.title}</span>
+ Page Editor <span style="font-weight: normal">| Title : ${page.title | h}</span></div></div>
diff -r d32c333831cc36c13430ca17ab893cab79554873 -r 5f178251e9b579f62ceb172ab562d67d1c841b73 templates/webapps/galaxy/page/index.mako
--- a/templates/webapps/galaxy/page/index.mako
+++ b/templates/webapps/galaxy/page/index.mako
@@ -30,7 +30,7 @@
<% page = association.page %><tr><td>
- <a class="menubutton" id="shared-${i}-popup" href="${h.url_for(controller='page', action='display_by_username_and_slug', username=page.user.username, slug=page.slug)}">${page.title}</a>
+ <a class="menubutton" id="shared-${i}-popup" href="${h.url_for(controller='page', action='display_by_username_and_slug', username=page.user.username, slug=page.slug)}">${page.title | h}</a></td><td>${page.user.username}</td><td>
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: carlfeberhard: Security, UI: minor fixes to history, dataset, and page escaping; escape js tag and annotation displays
by commits-noreply@bitbucket.org 26 Nov '14
by commits-noreply@bitbucket.org 26 Nov '14
26 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9dc543bfedd7/
Changeset: 9dc543bfedd7
Branch: next-stable
User: carlfeberhard
Date: 2014-11-26 17:28:28+00:00
Summary: Security, UI: minor fixes to history, dataset, and page escaping; escape js tag and annotation displays
Affected #: 18 files
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 client/galaxy/scripts/mvc/annotations.js
--- a/client/galaxy/scripts/mvc/annotations.js
+++ b/client/galaxy/scripts/mvc/annotations.js
@@ -56,7 +56,7 @@
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
- annotation,
+ _.escape( annotation ),
'</div>'
].join( '' );
},
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 client/galaxy/scripts/mvc/tags.js
--- a/client/galaxy/scripts/mvc/tags.js
+++ b/client/galaxy/scripts/mvc/tags.js
@@ -56,7 +56,9 @@
if( !_.isArray( tagsArray ) || _.isEmpty( tagsArray ) ){
return '';
}
- return tagsArray.sort().join( ',' );
+ return tagsArray.map( function( tag ){
+ return _.escape( tag );
+ }).sort().join( ',' );
},
/** @returns {jQuery} the input for this view */
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 static/scripts/mvc/annotations.js
--- a/static/scripts/mvc/annotations.js
+++ b/static/scripts/mvc/annotations.js
@@ -56,7 +56,7 @@
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
- annotation,
+ _.escape( annotation ),
'</div>'
].join( '' );
},
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 static/scripts/mvc/tags.js
--- a/static/scripts/mvc/tags.js
+++ b/static/scripts/mvc/tags.js
@@ -56,7 +56,9 @@
if( !_.isArray( tagsArray ) || _.isEmpty( tagsArray ) ){
return '';
}
- return tagsArray.sort().join( ',' );
+ return tagsArray.map( function( tag ){
+ return _.escape( tag );
+ }).sort().join( ',' );
},
/** @returns {jQuery} the input for this view */
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 static/scripts/packed/mvc/annotations.js
--- a/static/scripts/packed/mvc/annotations.js
+++ b/static/scripts/packed/mvc/annotations.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(a,c){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(d){d=d||{};this.tooltipConfig=d.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(e){d.$annotation().text(e);d.model.save({annotation:e},{silent:true}).fail(function(){d.$annotation().text(d.model.previous("annotation"))})}});return this},_template:function(){var d=this.model.get("annotation");return['<label class="prompt">',c("Annotation"),"</label>",'<div class="annotation" title="',c("Edit annotation"),'">',d,"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(a,c){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(d){d=d||{};this.tooltipConfig=d.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(e){d.$annotation().text(e);d.model.save({annotation:e},{silent:true}).fail(function(){d.$annotation().text(d.model.previous("annotation"))})}});return this},_template:function(){var d=this.model.get("annotation");return['<label class="prompt">',c("Annotation"),"</label>",'<div class="annotation" title="',c("Edit annotation"),'">',_.escape(d),"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:b}});
\ No newline at end of file
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 static/scripts/packed/mvc/tags.js
--- a/static/scripts/packed/mvc/tags.js
+++ b/static/scripts/packed/mvc/tags.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(d){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return d._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',b("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var d=this.model.get("tags");if(!_.isArray(d)||_.isEmpty(d)){return""}return d.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var d=this;this.$input().on("change",function(e){d.model.save({tags:e.val},{silent:true});if(e.added){d._addNewTagToTagsUsed(e.added.text+"")}})},_addNewTagToTagsUsed:function(d){var e=Galaxy.currUser.get("tags_used");if(!_.contains(e,d)){e.push(d);e.sort();Galaxy.currUser.set("tags_used",e)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:c}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(d){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(d.$activator,d)},render:function(){var d=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return d._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',b("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var d=this.model.get("tags");if(!_.isArray(d)||_.isEmpty(d)){return""}return d.map(function(e){return _.escape(e)}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var d=this;this.$input().on("change",function(e){d.model.save({tags:e.val},{silent:true});if(e.added){d._addNewTagToTagsUsed(e.added.text+"")}})},_addNewTagToTagsUsed:function(d){var e=Galaxy.currUser.get("tags_used");if(!_.contains(e,d)){e.push(d);e.sort();Galaxy.currUser.set("tags_used",e)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:c}});
\ No newline at end of file
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/copy_view.mako
--- a/templates/webapps/galaxy/dataset/copy_view.mako
+++ b/templates/webapps/galaxy/dataset/copy_view.mako
@@ -53,7 +53,7 @@
%><option value="${trans.security.encode_id(hist.id)}" ${selected}>
- ${i + 1}: ${h.truncate(util.unicodify( hist.name ), 30)}${current_history_text}
+ ${i + 1}: ${h.truncate(util.unicodify( hist.name ), 30) | h}${current_history_text}
</option>
%endfor
</select>
@@ -70,7 +70,7 @@
%><div class="form-row"><input type="checkbox" name="source_content_ids" id="${input_id}" value="${input_id}"${checked}/>
- <label for="${input_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name)}</label>
+ <label for="${input_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name) | h}</label></div>
%endfor
%else:
@@ -95,7 +95,7 @@
if encoded_id == target_history_id:
selected = " selected='selected'"
%>
- <option value="${encoded_id}"${selected}>${i + 1}: ${h.truncate( util.unicodify( hist.name ), 30)}${source_history_text}</option>
+ <option value="${encoded_id}"${selected}>${i + 1}: ${h.truncate( util.unicodify( hist.name ), 30) | h}${source_history_text}</option>
%endfor
</select><br /><br /><a style="margin-left: 10px;" href="javascript:void(0);" id="select-multiple">Choose multiple histories</a>
@@ -110,7 +110,7 @@
%><div class="form-row"><input type="checkbox" name="target_history_ids" id="hist_${encoded_id}" value="${encoded_id}"/>
- <label for="hist_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${ util.unicodify( hist.name ) }${cur_history_text}</label>
+ <label for="hist_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${ util.unicodify( hist.name ) | h }${cur_history_text}</label></div>
%endfor
</div>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -26,13 +26,11 @@
data.createTabularDatasetChunkedView({
// TODO: encode id.
dataset_config:
- _.extend( ${h.dumps( item.to_dict() )},
- {
- chunk_url: "${h.url_for( controller='/dataset', action='display',
- dataset_id=trans.security.encode_id( item.id ))}",
- first_data_chunk: ${first_chunk}
- }
- ),
+ _.extend( ${h.dumps( item.to_dict() )}, {
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
+ dataset_id=trans.security.encode_id( item.id ))}",
+ first_data_chunk: ${first_chunk}
+ }),
parent_elt: $('.page-body')
});
});
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/embed.mako
--- a/templates/webapps/galaxy/dataset/embed.mako
+++ b/templates/webapps/galaxy/dataset/embed.mako
@@ -4,10 +4,13 @@
%><%def name="render_item_links( dataset )">
- <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}" title="Save dataset" class="icon-button disk"></a>
+ <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}"
+ title="Save dataset" class="icon-button disk"></a>
## Links for importing and viewing an item.
- <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}" title="Import dataset" class="icon-button import"></a>
- <a class="icon-button go-to-full-screen" href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}" title="Go to dataset"></a>
+ <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}"
+ title="Import dataset" class="icon-button import"></a>
+ <a href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}"
+ title="Go to dataset" class="icon-button go-to-full-screen"></a></%def>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/errors.mako
--- a/templates/webapps/galaxy/dataset/errors.mako
+++ b/templates/webapps/galaxy/dataset/errors.mako
@@ -49,7 +49,7 @@
<body><h2>Dataset generation errors</h2>
- <p><b>Dataset ${hda.hid}: ${hda.display_name()}</b></p>
+ <p><b>Dataset ${hda.hid}: ${hda.display_name() | h}</b></p><% job = hda.creating_job %>
%if job:
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/security_common.mako
--- a/templates/webapps/galaxy/dataset/security_common.mako
+++ b/templates/webapps/galaxy/dataset/security_common.mako
@@ -77,7 +77,7 @@
else:
current_actions = []
permitted_actions = {}.items()
- obj_str = 'unknown object %s' %obj_name
+ obj_str = 'unknown object %s' % obj_name
obj_type = ''
%><script type="text/javascript">
@@ -104,7 +104,7 @@
});
</script><div class="toolForm">
- <div class="toolFormTitle">Manage ${obj_type} permissions on ${obj_str}</div>
+ <div class="toolFormTitle">Manage ${obj_type} permissions on ${obj_str | h}</div><div class="toolFormBody"><form name="edit_role_associations" id="edit_role_associations" action="${form_url}" method="post"><div class="form-row"></div>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -15,14 +15,12 @@
}
});
- require(['mvc/data'], function(data) {
+ require([ 'mvc/data' ], function( data ) {
data.createTabularDatasetChunkedView({
- dataset_config: _.extend( ${h.dumps( trans.security.encode_dict_ids( dataset.to_dict() ) )},
- {
- first_data_chunk: ${chunk}
- }
- ),
- parent_elt: $('body')
+ dataset_config : _.extend( ${ h.dumps( trans.security.encode_dict_ids( dataset.to_dict() ) )}, {
+ first_data_chunk: ${ chunk }
+ }),
+ parent_elt : $( 'body' )
});
});
</script>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/history/embed.mako
--- a/templates/webapps/galaxy/history/embed.mako
+++ b/templates/webapps/galaxy/history/embed.mako
@@ -23,7 +23,7 @@
</a></h4>
%if hasattr( item, "annotation") and item.annotation:
- <div class="annotation">${item.annotation}</div>
+ <div class="annotation">${item.annotation | h}</div>
%endif
</div><div class='summary-content'>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/history/history_panel.mako
--- a/templates/webapps/galaxy/history/history_panel.mako
+++ /dev/null
@@ -1,14 +0,0 @@
-## shortcuts for script tags that create history panels
-## ----------------------------------------------------------------------------
-<%def name="current_history_panel( selector_to_attach_to=None, options )">
-</%def>
-
-
-## ----------------------------------------------------------------------------
-<%def name="history_panel( history_id, selector_to_attach_to=None, options )">
-</%def>
-
-
-## ----------------------------------------------------------------------------
-<%def name="bootstrapped_history_panel( history, hdas, selector_to_attach_to=None, options )">
-</%def>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/history/share.mako
--- a/templates/webapps/galaxy/history/share.mako
+++ b/templates/webapps/galaxy/history/share.mako
@@ -20,7 +20,7 @@
<tr><td><input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- ${ util.unicodify( history.name )}
+ ${ util.unicodify( history.name ) | h }
</td><td>
%if len( history.datasets ) < 1:
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/history/view.mako
--- a/templates/webapps/galaxy/history/view.mako
+++ b/templates/webapps/galaxy/history/view.mako
@@ -1,4 +1,4 @@
-<%namespace file="/galaxy.masthead.mako" import="get_user_json" />
+<%namespace file="/galaxy_client_app.mako" import="get_user_json" />
## ----------------------------------------------------------------------------
<%!
@@ -166,9 +166,9 @@
// use_panels effects where the the center_panel() is rendered:
// w/o it renders to the body, w/ it renders to #center - we need to adjust a few things for scrolling to work
var hasMasthead = ${ 'true' if use_panels else 'false' },
- userIsOwner = ${'true' if user_is_owner else 'false'},
- historyJSON = ${h.dumps( history )},
- hdaJSON = ${h.dumps( hdas )},
+ userIsOwner = ${ 'true' if user_is_owner else 'false' },
+ historyJSON = ${ h.dumps( history ) },
+ hdaJSON = ${ h.dumps( hdas ) },
panelToUse = ( userIsOwner )?
//TODO: change class names
({ location: 'mvc/history/history-panel-edit', className: 'HistoryPanelEdit' }):
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/page/editor.mako
--- a/templates/webapps/galaxy/page/editor.mako
+++ b/templates/webapps/galaxy/page/editor.mako
@@ -47,7 +47,7 @@
<a id="close-button" class="panel-header-button">Close</a></div><div class="unified-panel-header-inner">
- Page Editor <span style="font-weight: normal">| Title : ${page.title}</span>
+ Page Editor <span style="font-weight: normal">| Title : ${page.title | h}</span></div></div>
diff -r 06100e9a5626c38f3182e353470e882c29564c63 -r 9dc543bfedd7121cecb0e3f5a980fa387b09ff10 templates/webapps/galaxy/page/index.mako
--- a/templates/webapps/galaxy/page/index.mako
+++ b/templates/webapps/galaxy/page/index.mako
@@ -30,7 +30,7 @@
<% page = association.page %><tr><td>
- <a class="menubutton" id="shared-${i}-popup" href="${h.url_for(controller='page', action='display_by_username_and_slug', username=page.user.username, slug=page.slug)}">${page.title}</a>
+ <a class="menubutton" id="shared-${i}-popup" href="${h.url_for(controller='page', action='display_by_username_and_slug', username=page.user.username, slug=page.slug)}">${page.title | h}</a></td><td>${page.user.username}</td><td>
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/06100e9a5626/
Changeset: 06100e9a5626
Branch: next-stable
User: jmchilton
Date: 2014-11-26 13:57:49+00:00
Summary: galaxy.ini.sample doc clarifications.
Fix typo caught by Martin. Add warning message about why public servers should not disable sanitize_all_html.
Affected #: 1 file
diff -r 9925a5adf6c4b65d3242d99bc16138839ad7ef21 -r 06100e9a5626c38f3182e353470e882c29564c63 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -523,13 +523,14 @@
# it faster on the fly.
#upstream_gzip = False
-# The following default adds a header to web request responses that will cause
-# modern web browsers to not allow Galaxy to be embedded in the frames of web
-# applications hosted at other hosts - this can help prevent a class of attack
-# called clickjacking (https://www.owasp.org/index.php/Clickjacking) If you
-# configuring a proxy to sit infront of Galaxy - please ensure this header
-# remains intact to protect your users. Uncomment and leave empty to not set
-# the `X-Frame-Options` header.
+# The following default adds a header to web request responses that
+# will cause modern web browsers to not allow Galaxy to be embedded in
+# the frames of web applications hosted at other hosts - this can help
+# prevent a class of attack called clickjacking
+# (https://www.owasp.org/index.php/Clickjacking) If you configure a
+# proxy in front of Galaxy - please ensure this header remains intact
+# to protect your users. Uncomment and leave empty to not set the
+# `X-Frame-Options` header.
#x_frame_options = SAMEORIGIN
# nginx can also handle file uploads (user-to-Galaxy) via nginx_upload_module.
@@ -586,10 +587,11 @@
# log_events and log_actions functionality will eventually be merged.
#log_actions = True
-# Sanitize All HTML Tool Output
-# By default, all tool output served as 'text/html' will be sanitized
-# thoroughly. This can be disabled if you have special tools that require
-# unaltered output.
+# Sanitize All HTML Tool Output By default, all tool output served as
+# 'text/html' will be sanitized thoroughly. This can be disabled if
+# you have special tools that require unaltered output. WARNING:
+# Disabling this does make the Galxy instance susceptible to XSS
+# attacks initiated by your users.
#sanitize_all_html = True
# By default Galaxy will serve non-HTML tool output that may potentially
https://bitbucket.org/galaxy/galaxy-central/commits/d32c333831cc/
Changeset: d32c333831cc
User: jmchilton
Date: 2014-11-26 13:58:14+00:00
Summary: Merge next-stable.
Affected #: 1 file
diff -r bf6fe8748b4d6f9096e9aa11f5abe7abcd372e27 -r d32c333831cc36c13430ca17ab893cab79554873 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -523,13 +523,14 @@
# it faster on the fly.
#upstream_gzip = False
-# The following default adds a header to web request responses that will cause
-# modern web browsers to not allow Galaxy to be embedded in the frames of web
-# applications hosted at other hosts - this can help prevent a class of attack
-# called clickjacking (https://www.owasp.org/index.php/Clickjacking) If you
-# configuring a proxy to sit infront of Galaxy - please ensure this header
-# remains intact to protect your users. Uncomment and leave empty to not set
-# the `X-Frame-Options` header.
+# The following default adds a header to web request responses that
+# will cause modern web browsers to not allow Galaxy to be embedded in
+# the frames of web applications hosted at other hosts - this can help
+# prevent a class of attack called clickjacking
+# (https://www.owasp.org/index.php/Clickjacking) If you configure a
+# proxy in front of Galaxy - please ensure this header remains intact
+# to protect your users. Uncomment and leave empty to not set the
+# `X-Frame-Options` header.
#x_frame_options = SAMEORIGIN
# nginx can also handle file uploads (user-to-Galaxy) via nginx_upload_module.
@@ -586,10 +587,11 @@
# log_events and log_actions functionality will eventually be merged.
#log_actions = True
-# Sanitize All HTML Tool Output
-# By default, all tool output served as 'text/html' will be sanitized
-# thoroughly. This can be disabled if you have special tools that require
-# unaltered output.
+# Sanitize All HTML Tool Output By default, all tool output served as
+# 'text/html' will be sanitized thoroughly. This can be disabled if
+# you have special tools that require unaltered output. WARNING:
+# Disabling this does make the Galxy instance susceptible to XSS
+# attacks initiated by your users.
#sanitize_all_html = True
# By default Galaxy will serve non-HTML tool output that may potentially
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/1d43f611d5a9/
Changeset: 1d43f611d5a9
Branch: next-stable
User: jmchilton
Date: 2014-11-26 04:02:05+00:00
Summary: Skip galaxy.tools.watcher test if watchdog unavailable.
Instead of failing.
Affected #: 1 file
diff -r c16fea918b33fd4e1ec52c3b5c38981d9c88cfa0 -r 1d43f611d5a98003c7d3b488bdb6a3ba9e982d8a test/unit/tools/test_watcher.py
--- a/test/unit/tools/test_watcher.py
+++ b/test/unit/tools/test_watcher.py
@@ -9,6 +9,10 @@
def test_watcher():
+ if not watcher.can_watch:
+ from nose.plugins.skip import SkipTest
+ raise SkipTest()
+
with __test_directory() as t:
tool_path = path.join(t, "test.xml")
toolbox = Toolbox()
https://bitbucket.org/galaxy/galaxy-central/commits/9925a5adf6c4/
Changeset: 9925a5adf6c4
Branch: next-stable
User: jmchilton
Date: 2014-11-26 04:02:05+00:00
Summary: Attempt fix of test/unit/test_lazy_process.py which transiently fails.
Affected #: 1 file
diff -r 1d43f611d5a98003c7d3b488bdb6a3ba9e982d8a -r 9925a5adf6c4b65d3242d99bc16138839ad7ef21 test/unit/test_lazy_process.py
--- a/test/unit/test_lazy_process.py
+++ b/test/unit/test_lazy_process.py
@@ -11,9 +11,8 @@
lazy_process = LazyProcess(["bash", "-c", "touch %s; sleep 100" % t.name])
assert not os.path.exists(t.name)
lazy_process.start_process()
- time.sleep(.02)
+ while not os.path.exists(t.name):
+ time.sleep(.01)
assert lazy_process.process.poll() is None
- assert os.path.exists(t.name)
lazy_process.shutdown()
- time.sleep(.02)
assert lazy_process.process.poll()
https://bitbucket.org/galaxy/galaxy-central/commits/bf6fe8748b4d/
Changeset: bf6fe8748b4d
User: jmchilton
Date: 2014-11-26 04:03:03+00:00
Summary: Merge next-stable.
Affected #: 2 files
diff -r 30132ca365effac14fe5fd419ed39d20b83fcbc6 -r bf6fe8748b4d6f9096e9aa11f5abe7abcd372e27 test/unit/test_lazy_process.py
--- a/test/unit/test_lazy_process.py
+++ b/test/unit/test_lazy_process.py
@@ -11,9 +11,8 @@
lazy_process = LazyProcess(["bash", "-c", "touch %s; sleep 100" % t.name])
assert not os.path.exists(t.name)
lazy_process.start_process()
- time.sleep(.02)
+ while not os.path.exists(t.name):
+ time.sleep(.01)
assert lazy_process.process.poll() is None
- assert os.path.exists(t.name)
lazy_process.shutdown()
- time.sleep(.02)
assert lazy_process.process.poll()
diff -r 30132ca365effac14fe5fd419ed39d20b83fcbc6 -r bf6fe8748b4d6f9096e9aa11f5abe7abcd372e27 test/unit/tools/test_watcher.py
--- a/test/unit/tools/test_watcher.py
+++ b/test/unit/tools/test_watcher.py
@@ -9,6 +9,10 @@
def test_watcher():
+ if not watcher.can_watch:
+ from nose.plugins.skip import SkipTest
+ raise SkipTest()
+
with __test_directory() as t:
tool_path = path.join(t, "test.xml")
toolbox = Toolbox()
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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b040f24f2dff/
Changeset: b040f24f2dff
User: gvk
Date: 2014-11-21 18:35:02+00:00
Summary: Enhance the collect_primary_datasets() method to allow assignment of the defined output parameter for 3rd-party tools that manage tool outputs internally.
Affected #: 1 file
diff -r 7cb167299a13cc273a794f19363f32083096efdb -r b040f24f2dff8e748ff4385637916363d43ce1e2 lib/galaxy/tools/parameters/output_collect.py
--- a/lib/galaxy/tools/parameters/output_collect.py
+++ b/lib/galaxy/tools/parameters/output_collect.py
@@ -5,7 +5,6 @@
import glob
import json
-
from galaxy import jobs
from galaxy import util
from galaxy.util import odict
@@ -30,8 +29,10 @@
# Loop through output file names, looking for generated primary
# datasets in form of:
# 'primary_associatedWithDatasetID_designation_visibility_extension(_DBKEY)'
+ primary_output_assigned = False
+ new_outdata_name = None
primary_datasets = {}
- for name, outdata in output.items():
+ for output_index, ( name, outdata ) in enumerate( output.items() ):
dataset_collectors = tool.outputs[ name ].dataset_collectors if name in tool.outputs else [ DEFAULT_DATASET_COLLECTOR ]
filenames = odict.odict()
if 'new_file_path' in app.config.collect_outputs_from:
@@ -56,14 +57,20 @@
continue
if extra_file_collector.match( outdata, filename ):
filenames[ path ] = extra_file_collector
- for filename, extra_file_collector in filenames.iteritems():
- if not name in primary_datasets:
- primary_datasets[name] = {}
+ for filename_index, ( filename, extra_file_collector ) in enumerate( filenames.iteritems() ):
fields_match = extra_file_collector.match( outdata, os.path.basename( filename ) )
if not fields_match:
# Before I guess pop() would just have thrown an IndexError
raise Exception( "Problem parsing metadata fields for file %s" % filename )
designation = fields_match.designation
+ if filename_index == 0 and extra_file_collector.assign_primary_output and output_index == 0:
+ new_outdata_name = fields_match.name or "%s (%s)" % ( outdata.name, designation )
+ # Move data from temp location to dataset location
+ app.object_store.update_from_file( outdata.dataset, file_name=filename, create=True )
+ primary_output_assigned = True
+ continue
+ if not name in primary_datasets:
+ primary_datasets[ name ] = {}
visible = fields_match.visible
ext = fields_match.ext
if ext == "input":
@@ -145,6 +152,13 @@
dataset.history.add_dataset( new_data )
sa_session.add( new_data )
sa_session.flush()
+ if primary_output_assigned:
+ outdata.name = new_outdata_name
+ outdata.init_meta()
+ outdata.set_meta()
+ outdata.set_peek()
+ sa_session.add( outdata )
+ sa_session.flush()
return primary_datasets
@@ -178,6 +192,7 @@
self.default_ext = kwargs.get( "ext", None )
self.default_visible = util.asbool( kwargs.get( "visible", None ) )
self.directory = kwargs.get( "directory", None )
+ self.assign_primary_output = util.asbool( kwargs.get( 'assign_primary_output', False ) )
def pattern_for_dataset( self, dataset_instance=None ):
token_replacement = r'\d+'
https://bitbucket.org/galaxy/galaxy-central/commits/45f92195479a/
Changeset: 45f92195479a
User: jmchilton
Date: 2014-11-26 03:01:49+00:00
Summary: Make dynamic discovery of output datasets deterministic.
Should aid in testing and ... lets say ... reproducibility because that is popular in these parts.
Affected #: 1 file
diff -r b040f24f2dff8e748ff4385637916363d43ce1e2 -r 45f92195479ad49c8bf5a9564bfc6078dbc59bc1 lib/galaxy/tools/parameters/output_collect.py
--- a/lib/galaxy/tools/parameters/output_collect.py
+++ b/lib/galaxy/tools/parameters/output_collect.py
@@ -51,7 +51,7 @@
raise Exception( "Problem with tool configuration, attempting to pull in datasets from outside working directory." )
if not os.path.isdir( directory ):
continue
- for filename in os.listdir( directory ):
+ for filename in sorted( os.listdir( directory ) ):
path = os.path.join( directory, filename )
if not os.path.isfile( path ):
continue
https://bitbucket.org/galaxy/galaxy-central/commits/ef0e65b55ebb/
Changeset: ef0e65b55ebb
User: jmchilton
Date: 2014-11-26 03:13:17+00:00
Summary: Implement tool test demonstrating pull request 569.
The new assign_primary_output attribute on discover_datasets tag.
Affected #: 2 files
diff -r 45f92195479ad49c8bf5a9564bfc6078dbc59bc1 -r ef0e65b55ebba822c8420f825e4b306e8018d7cb test/functional/tools/multi_output_assign_primary.xml
--- /dev/null
+++ b/test/functional/tools/multi_output_assign_primary.xml
@@ -0,0 +1,34 @@
+<tool id="multi_output_assign_primary" name="multi_output_assign_primary" description="multi_output_assign_primary" version="0.1.0">
+ <command>
+ echo "1" > sample1.report.tsv;
+ echo "2" > sample2.report.tsv;
+ echo "3" > sample3.report.tsv;
+ </command>
+ <inputs>
+ <param name="num_param" type="integer" value="7" />
+ <param name="input" type="data" />
+ </inputs>
+ <outputs>
+ <data format="tabular" name="sample">
+ <discover_datasets pattern="(?P<designation>.+)\.report\.tsv" ext="tabular" visible="true" assign_primary_output="true" />
+ </data>
+ </outputs>
+ <tests>
+ <test>
+ <param name="num_param" value="7" />
+ <param name="input" ftype="txt" value="simple_line.txt"/>
+ <output name="sample">
+ <assert_contents>
+ <has_line line="1" />
+ </assert_contents>
+ <!-- no sample1 it was consumed by named output "sample" -->
+ <discovered_dataset designation="sample2" ftype="tabular">
+ <assert_contents><has_line line="2" /></assert_contents>
+ </discovered_dataset>
+ <discovered_dataset designation="sample3" ftype="tabular">
+ <assert_contents><has_line line="3" /></assert_contents>
+ </discovered_dataset>
+ </output>
+ </test>
+ </tests>
+</tool>
diff -r 45f92195479ad49c8bf5a9564bfc6078dbc59bc1 -r ef0e65b55ebba822c8420f825e4b306e8018d7cb test/functional/tools/samples_tool_conf.xml
--- a/test/functional/tools/samples_tool_conf.xml
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -9,6 +9,7 @@
<tool file="multi_select.xml" /><tool file="multi_output.xml" /><tool file="multi_output_configured.xml" />
+ <tool file="multi_output_assign_primary.xml" /><tool file="composite_output.xml" /><tool file="metadata.xml" /><tool file="output_order.xml" />
https://bitbucket.org/galaxy/galaxy-central/commits/30132ca365ef/
Changeset: 30132ca365ef
User: jmchilton
Date: 2014-11-26 03:14:18+00:00
Summary: Merge pull request 569 with test implemented to demonstrate.
Affected #: 3 files
diff -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 -r 30132ca365effac14fe5fd419ed39d20b83fcbc6 lib/galaxy/tools/parameters/output_collect.py
--- a/lib/galaxy/tools/parameters/output_collect.py
+++ b/lib/galaxy/tools/parameters/output_collect.py
@@ -5,7 +5,6 @@
import glob
import json
-
from galaxy import jobs
from galaxy import util
from galaxy.util import odict
@@ -30,8 +29,10 @@
# Loop through output file names, looking for generated primary
# datasets in form of:
# 'primary_associatedWithDatasetID_designation_visibility_extension(_DBKEY)'
+ primary_output_assigned = False
+ new_outdata_name = None
primary_datasets = {}
- for name, outdata in output.items():
+ for output_index, ( name, outdata ) in enumerate( output.items() ):
dataset_collectors = tool.outputs[ name ].dataset_collectors if name in tool.outputs else [ DEFAULT_DATASET_COLLECTOR ]
filenames = odict.odict()
if 'new_file_path' in app.config.collect_outputs_from:
@@ -50,20 +51,26 @@
raise Exception( "Problem with tool configuration, attempting to pull in datasets from outside working directory." )
if not os.path.isdir( directory ):
continue
- for filename in os.listdir( directory ):
+ for filename in sorted( os.listdir( directory ) ):
path = os.path.join( directory, filename )
if not os.path.isfile( path ):
continue
if extra_file_collector.match( outdata, filename ):
filenames[ path ] = extra_file_collector
- for filename, extra_file_collector in filenames.iteritems():
- if not name in primary_datasets:
- primary_datasets[name] = {}
+ for filename_index, ( filename, extra_file_collector ) in enumerate( filenames.iteritems() ):
fields_match = extra_file_collector.match( outdata, os.path.basename( filename ) )
if not fields_match:
# Before I guess pop() would just have thrown an IndexError
raise Exception( "Problem parsing metadata fields for file %s" % filename )
designation = fields_match.designation
+ if filename_index == 0 and extra_file_collector.assign_primary_output and output_index == 0:
+ new_outdata_name = fields_match.name or "%s (%s)" % ( outdata.name, designation )
+ # Move data from temp location to dataset location
+ app.object_store.update_from_file( outdata.dataset, file_name=filename, create=True )
+ primary_output_assigned = True
+ continue
+ if not name in primary_datasets:
+ primary_datasets[ name ] = {}
visible = fields_match.visible
ext = fields_match.ext
if ext == "input":
@@ -145,6 +152,13 @@
dataset.history.add_dataset( new_data )
sa_session.add( new_data )
sa_session.flush()
+ if primary_output_assigned:
+ outdata.name = new_outdata_name
+ outdata.init_meta()
+ outdata.set_meta()
+ outdata.set_peek()
+ sa_session.add( outdata )
+ sa_session.flush()
return primary_datasets
@@ -178,6 +192,7 @@
self.default_ext = kwargs.get( "ext", None )
self.default_visible = util.asbool( kwargs.get( "visible", None ) )
self.directory = kwargs.get( "directory", None )
+ self.assign_primary_output = util.asbool( kwargs.get( 'assign_primary_output', False ) )
def pattern_for_dataset( self, dataset_instance=None ):
token_replacement = r'\d+'
diff -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 -r 30132ca365effac14fe5fd419ed39d20b83fcbc6 test/functional/tools/multi_output_assign_primary.xml
--- /dev/null
+++ b/test/functional/tools/multi_output_assign_primary.xml
@@ -0,0 +1,34 @@
+<tool id="multi_output_assign_primary" name="multi_output_assign_primary" description="multi_output_assign_primary" version="0.1.0">
+ <command>
+ echo "1" > sample1.report.tsv;
+ echo "2" > sample2.report.tsv;
+ echo "3" > sample3.report.tsv;
+ </command>
+ <inputs>
+ <param name="num_param" type="integer" value="7" />
+ <param name="input" type="data" />
+ </inputs>
+ <outputs>
+ <data format="tabular" name="sample">
+ <discover_datasets pattern="(?P<designation>.+)\.report\.tsv" ext="tabular" visible="true" assign_primary_output="true" />
+ </data>
+ </outputs>
+ <tests>
+ <test>
+ <param name="num_param" value="7" />
+ <param name="input" ftype="txt" value="simple_line.txt"/>
+ <output name="sample">
+ <assert_contents>
+ <has_line line="1" />
+ </assert_contents>
+ <!-- no sample1 it was consumed by named output "sample" -->
+ <discovered_dataset designation="sample2" ftype="tabular">
+ <assert_contents><has_line line="2" /></assert_contents>
+ </discovered_dataset>
+ <discovered_dataset designation="sample3" ftype="tabular">
+ <assert_contents><has_line line="3" /></assert_contents>
+ </discovered_dataset>
+ </output>
+ </test>
+ </tests>
+</tool>
diff -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 -r 30132ca365effac14fe5fd419ed39d20b83fcbc6 test/functional/tools/samples_tool_conf.xml
--- a/test/functional/tools/samples_tool_conf.xml
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -9,6 +9,7 @@
<tool file="multi_select.xml" /><tool file="multi_output.xml" /><tool file="multi_output_configured.xml" />
+ <tool file="multi_output_assign_primary.xml" /><tool file="composite_output.xml" /><tool file="metadata.xml" /><tool file="output_order.xml" />
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: jmchilton: PEP-8 fixes for test.base.asserts.
by commits-noreply@bitbucket.org 26 Nov '14
by commits-noreply@bitbucket.org 26 Nov '14
26 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e4e1f70bc2d1/
Changeset: e4e1f70bc2d1
User: jmchilton
Date: 2014-11-26 01:57:56+00:00
Summary: PEP-8 fixes for test.base.asserts.
Some of the first Python code I ever wrote - and one can tell :).
Affected #: 4 files
diff -r bfa13d090966889c74512497bfcaafb732c08a41 -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 test/base/asserts/__init__.py
--- a/test/base/asserts/__init__.py
+++ b/test/base/asserts/__init__.py
@@ -8,7 +8,7 @@
# Code for loading modules containing assertion checking functions, to
# create a new module of assertion functions, create the needed python
# source file "test/base/asserts/<MODULE_NAME>.py" and add
-# <MODULE_NAME> to the list of assertion module names defined above.
+# <MODULE_NAME> to the list of assertion module names defined above.
assertion_modules = []
for assertion_module_name in assertion_module_names:
full_assertion_module_name = 'base.asserts.' + assertion_module_name
@@ -19,7 +19,8 @@
assertion_module = sys.modules[full_assertion_module_name]
assertion_modules.append(assertion_module)
except Exception, e:
- log.exception( 'Failed to load assertion module: %s %s' % (assertion_module_name, str(e)))
+ log.exception('Failed to load assertion module: %s %s' % (assertion_module_name, str(e)))
+
def verify_assertions(data, assertion_description_list):
""" This function takes a list of assertions and a string to check
@@ -27,6 +28,7 @@
for assertion_description in assertion_description_list:
verify_assertion(data, assertion_description)
+
def verify_assertion(data, assertion_description):
tag = assertion_description["tag"]
assert_function_name = "assert_" + tag
@@ -73,4 +75,3 @@
# TODO: Verify all needed function arguments are specified.
assert_function(**args)
-
diff -r bfa13d090966889c74512497bfcaafb732c08a41 -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 test/base/asserts/tabular.py
--- a/test/base/asserts/tabular.py
+++ b/test/base/asserts/tabular.py
@@ -1,13 +1,15 @@
import re
+
def get_first_line(output):
- match = re.search("^(.*)$", output, flags = re.MULTILINE)
+ match = re.search("^(.*)$", output, flags=re.MULTILINE)
if match is None:
return None
else:
return match.group(1)
-def assert_has_n_columns(output, n, sep = '\t'):
+
+def assert_has_n_columns(output, n, sep='\t'):
""" Asserts the tabular output contains n columns. The optional
sep argument specifies the column seperator used to determine the
number of columns."""
diff -r bfa13d090966889c74512497bfcaafb732c08a41 -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 test/base/asserts/text.py
--- a/test/base/asserts/text.py
+++ b/test/base/asserts/text.py
@@ -1,30 +1,34 @@
import re
+
def assert_has_text(output, text):
""" Asserts specified output contains the substring specified by
the argument text."""
assert output.find(text) >= 0, "Output file did not contain expected text '%s' (ouptut '%s')" % (text, output)
-
+
+
def assert_not_has_text(output, text):
""" Asserts specified output does not contain the substring
specified the argument text."""
assert output.find(text) < 0, "Output file contains unexpected text '%s'" % text
+
def assert_has_line(output, line):
""" Asserts the specified output contains the line specified the
argument line."""
- match = re.search("^%s$" % re.escape(line), output, flags = re.MULTILINE)
- assert match != None, "No line of output file was '%s' (output was '%s') " % (line, output)
+ match = re.search("^%s$" % re.escape(line), output, flags=re.MULTILINE)
+ assert match is not None, "No line of output file was '%s' (output was '%s') " % (line, output)
+
def assert_has_text_matching(output, expression):
""" Asserts the specified output contains text matching the
regular expression specified by the argument expression."""
match = re.search(expression, output)
- assert match != None, "No text matching expression '%s' was found in output file." % expression
+ assert match is not None, "No text matching expression '%s' was found in output file." % expression
+
def assert_has_line_matching(output, expression):
""" Asserts the specified output contains a line matching the
regular expression specified by the argument expression."""
- match = re.search("^%s$" % expression, output, flags = re.MULTILINE)
- assert match != None, "No line matching expression '%s' was found in output file." % expression
-
+ match = re.search("^%s$" % expression, output, flags=re.MULTILINE)
+ assert match is not None, "No line matching expression '%s' was found in output file." % expression
diff -r bfa13d090966889c74512497bfcaafb732c08a41 -r e4e1f70bc2d1a84219038b7e58b933a94b424da7 test/base/asserts/xml.py
--- a/test/base/asserts/xml.py
+++ b/test/base/asserts/xml.py
@@ -1,77 +1,88 @@
import elementtree.ElementTree
import re
+
# Helper functions used to work with XML output.
def to_xml(output):
- return elementtree.ElementTree.fromstring(output)
+ return elementtree.ElementTree.fromstring(output)
+
def xml_find_text(output, path):
- xml = to_xml(output)
- text = xml.findtext(path)
- return text
+ xml = to_xml(output)
+ text = xml.findtext(path)
+ return text
+
def xml_find(output, path):
- xml = to_xml(output)
- return xml.find(path)
+ xml = to_xml(output)
+ return xml.find(path)
+
def assert_is_valid_xml(output):
- """ Simple assertion that just verifies the specified output
- is valid XML."""
- try:
- to_xml(output)
- except Exception, e:
- # TODO: Narrow caught exception to just parsing failure
- raise AssertionError("Expected valid XML, but could not parse output. %s" % str(e))
+ """ Simple assertion that just verifies the specified output
+ is valid XML."""
+ try:
+ to_xml(output)
+ except Exception, e:
+ # TODO: Narrow caught exception to just parsing failure
+ raise AssertionError("Expected valid XML, but could not parse output. %s" % str(e))
+
def assert_has_element_with_path(output, path):
- """ Asserts the specified output has at least one XML element with a
- path matching the specified path argument. Valid paths are the
- simplified subsets of XPath implemented by elementtree (currently
- Galaxy makes use of elementtree 1.2). See
- http://effbot.org/zone/element-xpath.htm for more information."""
- if xml_find(output, path) is None:
- errmsg = "Expected to find XML element matching expression %s, not such match was found." % path
- raise AssertionError(errmsg)
+ """ Asserts the specified output has at least one XML element with a
+ path matching the specified path argument. Valid paths are the
+ simplified subsets of XPath implemented by elementtree (currently
+ Galaxy makes use of elementtree 1.2). See
+ http://effbot.org/zone/element-xpath.htm for more information."""
+ if xml_find(output, path) is None:
+ errmsg = "Expected to find XML element matching expression %s, not such match was found." % path
+ raise AssertionError(errmsg)
+
def assert_has_n_elements_with_path(output, path, n):
- """ Asserts the specified output has exactly n elements matching the
- path specified."""
- xml = to_xml(output)
- n = int(n)
- num_elements = len(xml.findall(path))
- if num_elements != n:
- errmsg = "Expected to find %d elements with path %s, but %d were found." % (n, path, num_elements)
- raise AssertionError(errmsg)
+ """ Asserts the specified output has exactly n elements matching the
+ path specified."""
+ xml = to_xml(output)
+ n = int(n)
+ num_elements = len(xml.findall(path))
+ if num_elements != n:
+ errmsg = "Expected to find %d elements with path %s, but %d were found." % (n, path, num_elements)
+ raise AssertionError(errmsg)
+
def assert_element_text_matches(output, path, expression):
- """ Asserts the text of the first element matching the specified
- path matches the specified regular expression."""
- text = xml_find_text(output, path)
- if re.match(expression, text) is None:
- errmsg = "Expected element with path '%s' to contain text matching '%s', instead text '%s' was found." % (path, text, actual_text)
- raise AssertionError(errmsg)
+ """ Asserts the text of the first element matching the specified
+ path matches the specified regular expression."""
+ text = xml_find_text(output, path)
+ if re.match(expression, text) is None:
+ errmsg = "Expected element with path '%s' to contain text matching '%s', instead text '%s' was found." % (path, expression, text)
+ raise AssertionError(errmsg)
+
def assert_element_text_is(output, path, text):
- """ Asserts the text of the first element matching the specified
- path matches exactly the specified text. """
- assert_element_text_matches(output, path, re.escape(text))
+ """ Asserts the text of the first element matching the specified
+ path matches exactly the specified text. """
+ assert_element_text_matches(output, path, re.escape(text))
+
def assert_attribute_matches(output, path, attribute, expression):
- """ Asserts the specified attribute of the first element matching
- the specified path matches the specified regular expression."""
- xml = xml_find(output, path)
- attribute_value = xml.attrib[attribute]
- if re.match(expression, attribute_value) is None:
- errmsg = "Expected attribute '%s' on element with path '%s' to match '%s', instead attribute value was '%s'." % (attribute, path, expression, attribute_value)
- raise AssertionError(errmsg)
+ """ Asserts the specified attribute of the first element matching
+ the specified path matches the specified regular expression."""
+ xml = xml_find(output, path)
+ attribute_value = xml.attrib[attribute]
+ if re.match(expression, attribute_value) is None:
+ errmsg = "Expected attribute '%s' on element with path '%s' to match '%s', instead attribute value was '%s'." % (attribute, path, expression, attribute_value)
+ raise AssertionError(errmsg)
+
def assert_attribute_is(output, path, attribute, text):
- """ Asserts the specified attribute of the first element matching
- the specified path matches exactly the specified text."""
- assert_attribute_matches(output, path, attribute, re.escape(text))
+ """ Asserts the specified attribute of the first element matching
+ the specified path matches exactly the specified text."""
+ assert_attribute_matches(output, path, attribute, re.escape(text))
+
def assert_element_text(output, path, verify_assertions_function, children):
- """ Recursively checks the specified assertions against the text of
- the first element matching the specified path."""
- text = xml_find_text(output, path)
- verify_assertions_function(text, children)
+ """ Recursively checks the specified assertions against the text of
+ the first element matching the specified path."""
+ text = xml_find_text(output, path)
+ verify_assertions_function(text, children)
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/c16fea918b33/
Changeset: c16fea918b33
Branch: next-stable
User: jmchilton
Date: 2014-11-26 01:52:30+00:00
Summary: Fixes for /dataset_collections API endpoint.
Guess this is not as utilized as the variant under /histories.
Affected #: 1 file
diff -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a -r c16fea918b33fd4e1ec52c3b5c38981d9c88cfa0 lib/galaxy/webapps/galaxy/api/dataset_collections.py
--- a/lib/galaxy/webapps/galaxy/api/dataset_collections.py
+++ b/lib/galaxy/webapps/galaxy/api/dataset_collections.py
@@ -56,7 +56,8 @@
@expose_api
def show( self, trans, instance_type, id, **kwds ):
- dataset_collection_instance = self.__service( trans ).get(
+ dataset_collection_instance = self.__service( trans ).get_dataset_collection_instance(
+ trans,
id=id,
instance_type=instance_type,
)
@@ -67,7 +68,12 @@
else:
trans.status = 501
return
- return dictify_dataset_collection_instance( trans, dataset_collection_instance, parent )
+ return dictify_dataset_collection_instance(
+ dataset_collection_instance,
+ security=trans.security,
+ parent=parent,
+ view='element'
+ )
def __service( self, trans ):
service = trans.app.dataset_collections_service
https://bitbucket.org/galaxy/galaxy-central/commits/bfa13d090966/
Changeset: bfa13d090966
User: jmchilton
Date: 2014-11-26 01:53:50+00:00
Summary: Merge next-stable into default.
Affected #: 12 files
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/api/dataset_collections.py
--- a/lib/galaxy/webapps/galaxy/api/dataset_collections.py
+++ b/lib/galaxy/webapps/galaxy/api/dataset_collections.py
@@ -56,7 +56,8 @@
@expose_api
def show( self, trans, instance_type, id, **kwds ):
- dataset_collection_instance = self.__service( trans ).get(
+ dataset_collection_instance = self.__service( trans ).get_dataset_collection_instance(
+ trans,
id=id,
instance_type=instance_type,
)
@@ -67,7 +68,12 @@
else:
trans.status = 501
return
- return dictify_dataset_collection_instance( trans, dataset_collection_instance, parent )
+ return dictify_dataset_collection_instance(
+ dataset_collection_instance,
+ security=trans.security,
+ parent=parent,
+ view='element'
+ )
def __service( self, trans ):
service = trans.app.dataset_collections_service
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/controllers/dataset.py
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -9,8 +9,7 @@
from galaxy.util.sanitize_html import sanitize_html
from galaxy.util.json import loads
from galaxy.web.base.controller import BaseUIController, ERROR, SUCCESS, url_for, UsesHistoryDatasetAssociationMixin, UsesHistoryMixin, UsesExtendedMetadataMixin
-from galaxy.web.framework.helpers import grids, iff, time_ago
-from galaxy.web.framework.helpers import to_unicode
+from galaxy.web.framework.helpers import grids, iff, time_ago, to_unicode, escape
from galaxy.tools.errors import EmailErrorReporter
eggs.require( "Paste" )
@@ -506,7 +505,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
# Error checking.
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -19,7 +19,7 @@
from galaxy.web.base.controller import ExportsHistoryMixin
from galaxy.web.base.controller import ImportsHistoryMixin
from galaxy.web.base.controller import ERROR, INFO, SUCCESS, WARNING
-from galaxy.web.framework.helpers import grids, iff, time_ago
+from galaxy.web.framework.helpers import grids, iff, time_ago, escape
log = logging.getLogger( __name__ )
@@ -1291,7 +1291,7 @@
else:
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -611,8 +611,8 @@
else:
refresh_frames = [ 'masthead' ]
trans.handle_user_logout( logout_all=logout_all )
- message = 'You have been logged out.<br>You can log in again, <a target="_top" href="%s">go back to the page you were visiting</a> or <a target="_top" href="%s">go to the home page</a>.' % \
- ( trans.request.referer, url_for( '/' ) )
+ message = 'You have been logged out.<br>To log in again <a target="_top" href="%s">go to the home page</a>.' % \
+ ( url_for( '/' ) )
if biostar.biostar_logged_in( trans ):
biostar_url = biostar.biostar_logout( trans )
if biostar_url:
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -9,7 +9,7 @@
from galaxy import model, web
from galaxy.model.item_attrs import UsesAnnotations, UsesItemRatings
from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesVisualizationMixin
-from galaxy.web.framework.helpers import time_ago, grids
+from galaxy.web.framework.helpers import time_ago, grids, escape
from galaxy import util
from galaxy.datatypes.interval import Bed
from galaxy.util.json import loads
@@ -123,7 +123,7 @@
# or_( "metadata like '%%\"dbkey\": [\"?\"]%%'", "metadata like '%%\"dbkey\": \"?\"%%'" ) \
# )
# )
-
+
class HistoryColumn( grids.GridColumn ):
""" Column for filtering by history id. """
@@ -360,7 +360,7 @@
@web.expose
@web.require_login( "use Galaxy visualizations", use_panels=True )
def list( self, trans, *args, **kwargs ):
-
+
# Handle operation
if 'operation' in kwargs and 'id' in kwargs:
session = trans.sa_session
@@ -388,7 +388,7 @@
kwargs[ 'embedded' ] = True
grid = self._user_list_grid( trans, *args, **kwargs )
return trans.fill_template( "visualization/list.mako", embedded_grid=grid, shared_by_others=shared_by_others )
-
+
#
# -- Functions for operating on visualizations. --
#
@@ -459,7 +459,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % web.url_for( '/' )
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -22,8 +22,7 @@
from galaxy.web import error, url_for
from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesStoredWorkflowMixin
from galaxy.web.framework.formbuilder import form
-from galaxy.web.framework.helpers import grids, time_ago
-from galaxy.web.framework.helpers import to_unicode
+from galaxy.web.framework.helpers import grids, time_ago, to_unicode, escape
from galaxy.workflow.modules import WorkflowModuleInjector
from galaxy.workflow.modules import MissingToolException
from galaxy.workflow.modules import module_factory, is_tool_module_type
@@ -389,7 +388,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 static/scripts/galaxy.masthead.js
--- a/static/scripts/galaxy.masthead.js
+++ b/static/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 static/scripts/packed/galaxy.masthead.js
--- a/static/scripts/packed/galaxy.masthead.js
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content!==undefined&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r ce8a617dcdb199e97e7d4249f548e78a4530d18a -r bfa13d090966889c74512497bfcaafb732c08a41 static/scripts/packed/galaxy.menu.js
--- a/static/scripts/packed/galaxy.menu.js
+++ b/static/scripts/packed/galaxy.menu.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
+define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ 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/ba9188b955ef/
Changeset: ba9188b955ef
Branch: next-stable
User: dannon
Date: 2014-11-25 20:14:25+00:00
Summary: Referer-in-okmessage reflective xss fix
Affected #: 4 files
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r ba9188b955ef5fadbf261271555297b7ba57c162 lib/galaxy/webapps/galaxy/controllers/dataset.py
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -9,8 +9,7 @@
from galaxy.util.sanitize_html import sanitize_html
from galaxy.util.json import loads
from galaxy.web.base.controller import BaseUIController, ERROR, SUCCESS, url_for, UsesHistoryDatasetAssociationMixin, UsesHistoryMixin, UsesExtendedMetadataMixin
-from galaxy.web.framework.helpers import grids, iff, time_ago
-from galaxy.web.framework.helpers import to_unicode
+from galaxy.web.framework.helpers import grids, iff, time_ago, to_unicode, escape
from galaxy.tools.errors import EmailErrorReporter
eggs.require( "Paste" )
@@ -506,7 +505,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
# Error checking.
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r ba9188b955ef5fadbf261271555297b7ba57c162 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -19,7 +19,7 @@
from galaxy.web.base.controller import ExportsHistoryMixin
from galaxy.web.base.controller import ImportsHistoryMixin
from galaxy.web.base.controller import ERROR, INFO, SUCCESS, WARNING
-from galaxy.web.framework.helpers import grids, iff, time_ago
+from galaxy.web.framework.helpers import grids, iff, time_ago, escape
log = logging.getLogger( __name__ )
@@ -1291,7 +1291,7 @@
else:
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r ba9188b955ef5fadbf261271555297b7ba57c162 lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -9,7 +9,7 @@
from galaxy import model, web
from galaxy.model.item_attrs import UsesAnnotations, UsesItemRatings
from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesVisualizationMixin
-from galaxy.web.framework.helpers import time_ago, grids
+from galaxy.web.framework.helpers import time_ago, grids, escape
from galaxy import util
from galaxy.datatypes.interval import Bed
from galaxy.util.json import loads
@@ -123,7 +123,7 @@
# or_( "metadata like '%%\"dbkey\": [\"?\"]%%'", "metadata like '%%\"dbkey\": \"?\"%%'" ) \
# )
# )
-
+
class HistoryColumn( grids.GridColumn ):
""" Column for filtering by history id. """
@@ -360,7 +360,7 @@
@web.expose
@web.require_login( "use Galaxy visualizations", use_panels=True )
def list( self, trans, *args, **kwargs ):
-
+
# Handle operation
if 'operation' in kwargs and 'id' in kwargs:
session = trans.sa_session
@@ -388,7 +388,7 @@
kwargs[ 'embedded' ] = True
grid = self._user_list_grid( trans, *args, **kwargs )
return trans.fill_template( "visualization/list.mako", embedded_grid=grid, shared_by_others=shared_by_others )
-
+
#
# -- Functions for operating on visualizations. --
#
@@ -459,7 +459,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % web.url_for( '/' )
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r ba9188b955ef5fadbf261271555297b7ba57c162 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -22,8 +22,7 @@
from galaxy.web import error, url_for
from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesStoredWorkflowMixin
from galaxy.web.framework.formbuilder import form
-from galaxy.web.framework.helpers import grids, time_ago
-from galaxy.web.framework.helpers import to_unicode
+from galaxy.web.framework.helpers import grids, time_ago, to_unicode, escape
from galaxy.workflow.modules import WorkflowModuleInjector
from galaxy.workflow.modules import MissingToolException
from galaxy.workflow.modules import module_factory, is_tool_module_type
@@ -389,7 +388,7 @@
# Set referer message.
referer = trans.request.referer
if referer is not "":
- referer_message = "<a href='%s'>return to the previous page</a>" % referer
+ referer_message = "<a href='%s'>return to the previous page</a>" % escape(referer)
else:
referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' )
https://bitbucket.org/galaxy/galaxy-central/commits/7c635c1a08ad/
Changeset: 7c635c1a08ad
Branch: next-stable
User: dannon
Date: 2014-11-25 20:14:58+00:00
Summary: Referer-in-logout reflective xss fix.
Affected #: 1 file
diff -r ba9188b955ef5fadbf261271555297b7ba57c162 -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -611,8 +611,8 @@
else:
refresh_frames = [ 'masthead' ]
trans.handle_user_logout( logout_all=logout_all )
- message = 'You have been logged out.<br>You can log in again, <a target="_top" href="%s">go back to the page you were visiting</a> or <a target="_top" href="%s">go to the home page</a>.' % \
- ( trans.request.referer, url_for( '/' ) )
+ message = 'You have been logged out.<br>To log in again <a target="_top" href="%s">go to the home page</a>.' % \
+ ( url_for( '/' ) )
if biostar.biostar_logged_in( trans ):
biostar_url = biostar.biostar_logout( trans )
if biostar_url:
https://bitbucket.org/galaxy/galaxy-central/commits/2d80e9cfb833/
Changeset: 2d80e9cfb833
Branch: next-stable
User: dannon
Date: 2014-11-25 20:25:25+00:00
Summary: Merge.
Affected #: 6 files
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a static/scripts/galaxy.masthead.js
--- a/static/scripts/galaxy.masthead.js
+++ b/static/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a static/scripts/packed/galaxy.masthead.js
--- a/static/scripts/packed/galaxy.masthead.js
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content!==undefined&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r 7c635c1a08adb89bc968bffb1a57bdf4ed1f825d -r 2d80e9cfb833b7cf50d5f60ae77368bc966ca29a static/scripts/packed/galaxy.menu.js
--- a/static/scripts/packed/galaxy.menu.js
+++ b/static/scripts/packed/galaxy.menu.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
+define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ 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
commit/galaxy-central: martenson: fix the behavior of masthead.js when passed an empty string as a item content (link target)
by commits-noreply@bitbucket.org 25 Nov '14
by commits-noreply@bitbucket.org 25 Nov '14
25 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/15f7c2ef93c1/
Changeset: 15f7c2ef93c1
Branch: next-stable
User: martenson
Date: 2014-11-25 20:19:08+00:00
Summary: fix the behavior of masthead.js when passed an empty string as a item content (link target)
Affected #: 6 files
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b static/scripts/galaxy.masthead.js
--- a/static/scripts/galaxy.masthead.js
+++ b/static/scripts/galaxy.masthead.js
@@ -251,28 +251,31 @@
},
// initialize
- initialize: function (options){
+ initialize: function ( options ){
// read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
+ if ( options ){
+ this.options = _.defaults( options, this.options );
+ }
+
// update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
+ if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = galaxy_config.root + this.options.content;
+ }
// add template for tab
- this.setElement($(this._template(this.options)));
+ this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
- if (this.options.disabled){
- $(this.el).find('.root').addClass('disabled');
+ if ( this.options.disabled ){
+ $( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
- if (!this.options.visible)
+ if ( !this.options.visible ){
this.hide();
+ }
},
// show
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -167,7 +167,7 @@
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
- content : "admin/index",
+ content : "admin",
extra_class : "admin-only",
title_attribute : 'Administer this Galaxy'
});
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b static/scripts/packed/galaxy.masthead.js
--- a/static/scripts/packed/galaxy.masthead.js
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;$(window).on("beforeunload",function(){var g="";for(key in d.list){if(d.list[key].options.onunload){var f=d.list[key].options.onunload();if(f){g+=f+" "}}}if(g!=""){return g}})},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){var e=d.brand?("/ "+d.brand):"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,onclick:function(){alert("clicked")},onunload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.onclick);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,onunload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content!==undefined&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="'+galaxy_config.root+'/user/login">log in</a> or <a href="'+galaxy_config.root+'/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 -r 15f7c2ef93c1296aa61607fcceb190d94eb2701b static/scripts/packed/galaxy.menu.js
--- a/static/scripts/packed/galaxy.menu.js
+++ b/static/scripts/packed/galaxy.menu.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin/index",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ No newline at end of file
+define(["galaxy.masthead"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var e=new b.GalaxyMastheadTab({id:"analysis",title:"Analyze Data",content:"",title_attribute:"Analysis home view"});this.masthead.append(e);var g={id:"workflow",title:"Workflow",content:"workflow",title_attribute:"Chain tools into workflows"};if(!this.options.user.valid){g.disabled=true}var d=new b.GalaxyMastheadTab(g);this.masthead.append(d);var i=new b.GalaxyMastheadTab({id:"shared",title:"Shared Data",content:"library/index",title_attribute:"Access published resources"});i.add({title:"Data Libraries",content:"library/index"});i.add({title:"Data Libraries Beta",content:"library/list",divider:true});i.add({title:"Published Histories",content:"history/list_published"});i.add({title:"Published Workflows",content:"workflow/list_published"});i.add({title:"Published Visualizations",content:"visualization/list_published"});i.add({title:"Published Pages",content:"page/list_published"});this.masthead.append(i);if(this.options.user.requests){var j=new b.GalaxyMastheadTab({id:"lab",title:"Lab"});j.add({title:"Sequencing Requests",content:"requests/index"});j.add({title:"Find Samples",content:"requests/find_samples_index"});j.add({title:"Help",content:this.options.lims_doc_url});this.masthead.append(j)}var c={id:"visualization",title:"Visualization",content:"visualization/list",title_attribute:"Visualize datasets"};if(!this.options.user.valid){c.disabled=true}var m=new b.GalaxyMastheadTab(c);if(this.options.user.valid){m.add({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});m.add({title:"Saved Visualizations",content:"visualization/list",target:"_frame"})}this.masthead.append(m);if(this.options.enable_cloud_launch){var f=new b.GalaxyMastheadTab({id:"cloud",title:"Cloud",content:"cloudlaunch/index"});f.add({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(f)}if(this.options.is_admin_user){var h=new b.GalaxyMastheadTab({id:"admin",title:"Admin",content:"admin",extra_class:"admin-only",title_attribute:"Administer this Galaxy"});this.masthead.append(h)}var l=new b.GalaxyMastheadTab({id:"help",title:"Help",title_attribute:"Support, contact, and community hubs"});if(this.options.biostar_url){l.add({title:"Galaxy Biostar",content:this.options.biostar_url_redirect,target:"_blank"});l.add({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}l.add({title:"Support",content:this.options.support_url,target:"_blank"});l.add({title:"Search",content:this.options.search_url,target:"_blank"});l.add({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});l.add({title:"Videos",content:this.options.screencasts_url,target:"_blank"});l.add({title:"Wiki",content:this.options.wiki_url,target:"_blank"});l.add({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(this.options.terms_url){l.add({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(l);if(!this.options.user.valid){var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedout-only",title_attribute:"Account registration or login"});k.add({title:"Login",content:"user/login",target:"galaxy_main"});if(this.options.allow_user_creation){k.add({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(k)}else{var k=new b.GalaxyMastheadTab({id:"user",title:"User",extra_class:"loggedin-only",title_attribute:"Account preferences and saved data"});k.add({title:"Logged in as "+this.options.user.email});k.add({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});k.add({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});k.add({title:"Logout",content:"user/logout",target:"_top",divider:true});k.add({title:"Saved Histories",content:"history/list",target:"galaxy_main"});k.add({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});k.add({title:"Saved Pages",content:"page/list",target:"_top"});k.add({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){k.add({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(k)}if(this.options.active_view){this.masthead.highlight(this.options.active_view)}}});return{GalaxyMenu:a}});
\ 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
25 Nov '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ce8a617dcdb1/
Changeset: ce8a617dcdb1
User: dannon
Date: 2014-11-25 19:35:25+00:00
Summary: Merge next stable.
Affected #: 2 files
diff -r 720b9c3936980d5af25df714c5c65e5d4793327c -r ce8a617dcdb199e97e7d4249f548e78a4530d18a lib/galaxy/web/framework/helpers/__init__.py
--- a/lib/galaxy/web/framework/helpers/__init__.py
+++ b/lib/galaxy/web/framework/helpers/__init__.py
@@ -3,13 +3,13 @@
"""
import time
-from cgi import escape
from datetime import datetime, timedelta
from galaxy import eggs
from galaxy.util import hash_util
from galaxy.util.json import safe_dumps as dumps
eggs.require( "MarkupSafe" ) #required by WebHelpers
eggs.require( "WebHelpers" )
+from markupsafe import escape
from webhelpers import date
from webhelpers.html.tags import stylesheet_link, javascript_link
diff -r 720b9c3936980d5af25df714c5c65e5d4793327c -r ce8a617dcdb199e97e7d4249f548e78a4530d18a lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -15,8 +15,8 @@
from galaxy.tools.parameters.basic import UnvalidatedValue
from galaxy.util.bunch import Bunch
from galaxy.util.hash_util import is_hashable
-from galaxy.web import error
-from galaxy.web import url_for
+from galaxy.web import error, url_for
+from galaxy.web.framework.helpers import escape
from galaxy.web.base.controller import BaseUIController
import tool_shed.util.shed_util_common as suc
@@ -57,7 +57,7 @@
return trans.response.send_redirect( url_for( controller="root", action="welcome" ) )
# When the tool form is initially loaded, the received kwd will not include a 'refresh'
# entry (which only is included when another option is selected in the tool_version_select_field),
- # so the default selected option should be the most recent version of the tool. The following
+ # so the default selected option should be the most recent version of the tool. The following
# check will mae sure this occurs.
refreshed_on_change = kwd.get( 'refresh', False )
tool_version_select_field, tools, tool = self.__get_tool_components( tool_id,
@@ -69,7 +69,7 @@
log.error( "index called with tool id '%s' but no such tool exists", tool_id )
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
- return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
+ return trans.show_error_message("Tool '%s' does not exist." % ( escape(tool_id) ))
if tool.require_login and not trans.user:
message = "You must be logged in to use this tool."
status = "info"
@@ -291,7 +291,7 @@
log.error( "data_source_redirect called with tool id '%s' but no such tool exists", tool_id )
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
- return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
+ return trans.show_error_message("Tool '%s' does not exist." % ( escape(tool_id) ))
if isinstance( tool, DataSourceTool ):
link = url_for( tool.action, **tool.get_static_param_values( trans ) )
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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4ecb1efececd/
Changeset: 4ecb1efececd
Branch: next-stable
User: dannon
Date: 2014-11-25 19:26:52+00:00
Summary: Prevent XSS in unknown tool display, update to actually use show_error_message instead of replying with plain text.
Affected #: 2 files
diff -r c53f747732a115c7ec6ed3e192bb059d12266865 -r 4ecb1efececdb58d16087a58d1f168851899aa4a lib/galaxy/web/framework/helpers/__init__.py
--- a/lib/galaxy/web/framework/helpers/__init__.py
+++ b/lib/galaxy/web/framework/helpers/__init__.py
@@ -3,13 +3,13 @@
"""
import time
-from cgi import escape
from datetime import datetime, timedelta
from galaxy import eggs
from galaxy.util import hash_util
from galaxy.util.json import safe_dumps as dumps
eggs.require( "MarkupSafe" ) #required by WebHelpers
eggs.require( "WebHelpers" )
+from markupsafe import escape
from webhelpers import date
from webhelpers.html.tags import stylesheet_link, javascript_link
diff -r c53f747732a115c7ec6ed3e192bb059d12266865 -r 4ecb1efececdb58d16087a58d1f168851899aa4a lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -15,8 +15,8 @@
from galaxy.tools.parameters.basic import UnvalidatedValue
from galaxy.util.bunch import Bunch
from galaxy.util.hash_util import is_hashable
-from galaxy.web import error
-from galaxy.web import url_for
+from galaxy.web import error, url_for
+from galaxy.web.framework.helpers import escape
from galaxy.web.base.controller import BaseUIController
import tool_shed.util.shed_util_common as suc
@@ -57,7 +57,7 @@
return trans.response.send_redirect( url_for( controller="root", action="welcome" ) )
# When the tool form is initially loaded, the received kwd will not include a 'refresh'
# entry (which only is included when another option is selected in the tool_version_select_field),
- # so the default selected option should be the most recent version of the tool. The following
+ # so the default selected option should be the most recent version of the tool. The following
# check will mae sure this occurs.
refreshed_on_change = kwd.get( 'refresh', False )
tool_version_select_field, tools, tool = self.__get_tool_components( tool_id,
@@ -69,7 +69,7 @@
log.error( "index called with tool id '%s' but no such tool exists", tool_id )
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
- return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
+ return trans.show_error_message("Tool '%s' does not exist." % ( escape(tool_id) ))
if tool.require_login and not trans.user:
message = "You must be logged in to use this tool."
status = "info"
https://bitbucket.org/galaxy/galaxy-central/commits/988dd20de45b/
Changeset: 988dd20de45b
Branch: next-stable
User: dannon
Date: 2014-11-25 19:27:04+00:00
Summary: Merge.
Affected #: 8 files
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 lib/galaxy/tags/tag_handler.py
--- a/lib/galaxy/tags/tag_handler.py
+++ b/lib/galaxy/tags/tag_handler.py
@@ -1,5 +1,7 @@
-import re, logging
-from sqlalchemy.sql.expression import func, and_
+import re
+import logging
+from sqlalchemy.sql.expression import func
+from sqlalchemy.sql.expression import and_
from sqlalchemy.sql import select
log = logging.getLogger( __name__ )
@@ -25,12 +27,15 @@
self.key_value_separators = "=:"
# Initialize with known classes - add to this in subclasses.
self.item_tag_assoc_info = {}
+
def get_tag_assoc_class( self, item_class ):
"""Returns tag association class for item class."""
return self.item_tag_assoc_info[item_class.__name__].tag_assoc_class
+
def get_id_col_in_item_tag_assoc_table( self, item_class ):
"""Returns item id column in class' item-tag association table."""
return self.item_tag_assoc_info[item_class.__name__].item_id_col
+
def get_community_tags( self, trans, item=None, limit=None ):
"""Returns community tags for an item."""
# Get item-tag association class.
@@ -58,6 +63,7 @@
tag_id = row[0]
community_tags.append( self.get_tag_by_id( trans, tag_id ) )
return community_tags
+
def get_tool_tags( self, trans ):
result_set = trans.sa_session.execute( select( columns=[ trans.app.model.ToolTagAssociation.table.c.tag_id ],
from_obj=trans.app.model.ToolTagAssociation.table ).distinct() )
@@ -67,6 +73,7 @@
tag_id = row[0]
tags.append( self.get_tag_by_id( trans, tag_id ) )
return tags
+
def remove_item_tag( self, trans, user, item, tag_name ):
"""Remove a tag from an item."""
# Get item tag association.
@@ -78,6 +85,7 @@
item.tags.remove( item_tag_assoc )
return True
return False
+
def delete_item_tags( self, trans, user, item ):
"""Delete tags from an item."""
# Delete item-tag associations.
@@ -85,6 +93,7 @@
trans.sa_session.delete( tag )
# Delete tags from item.
del item.tags[:]
+
def item_has_tag( self, trans, user, item, tag ):
"""Returns true if item is has a given tag."""
# Get tag name.
@@ -97,6 +106,7 @@
if item_tag_assoc:
return True
return False
+
def apply_item_tag( self, trans, user, item, name, value=None ):
# Use lowercase name for searching/creating tag.
lc_name = name.lower()
@@ -124,6 +134,7 @@
item_tag_assoc.user_value = value
item_tag_assoc.value = lc_value
return item_tag_assoc
+
def apply_item_tags( self, trans, user, item, tags_str ):
"""Apply tags to an item."""
# Parse tags.
@@ -131,6 +142,7 @@
# Apply each tag.
for name, value in parsed_tags.items():
self.apply_item_tag( trans, user, item, name, value )
+
def get_tags_str( self, tags ):
"""Build a string from an item's tags."""
# Return empty string if there are no tags.
@@ -144,14 +156,17 @@
tag_str += ":" + tag.user_value
tags_str_list.append( tag_str )
return ", ".join( tags_str_list )
+
def get_tag_by_id( self, trans, tag_id ):
"""Get a Tag object from a tag id."""
return trans.sa_session.query( trans.app.model.Tag ).filter_by( id=tag_id ).first()
+
def get_tag_by_name( self, trans, tag_name ):
"""Get a Tag object from a tag name (string)."""
if tag_name:
return trans.sa_session.query( trans.app.model.Tag ).filter_by( name=tag_name.lower() ).first()
return None
+
def _create_tag( self, trans, tag_str ):
"""Create a Tag object from a tag string."""
tag_hierarchy = tag_str.split( self.hierarchy_separator )
@@ -169,6 +184,7 @@
parent_tag = tag
tag_prefix = tag.name + self.hierarchy_separator
return tag
+
def _get_or_create_tag( self, trans, tag_str ):
"""Get or create a Tag object from a tag string."""
# Scrub tag; if tag is None after being scrubbed, return None.
@@ -181,6 +197,7 @@
if tag is None:
tag = self._create_tag( trans, scrubbed_tag_str )
return tag
+
def _get_item_tag_assoc( self, user, item, tag_name ):
"""
Return ItemTagAssociation object for a user, item, and tag string; returns None if there is
@@ -191,6 +208,7 @@
if ( item_tag_assoc.user == user ) and ( item_tag_assoc.user_tname == scrubbed_tag_name ):
return item_tag_assoc
return None
+
def parse_tags( self, tag_str ):
"""
Returns a list of raw (tag-name, value) pairs derived from a string; method scrubs tag names and values as well.
@@ -210,6 +228,7 @@
scrubbed_value = self._scrub_tag_value( nv_pair[1] )
name_value_pairs[scrubbed_name] = scrubbed_value
return name_value_pairs
+
def _scrub_tag_value( self, value ):
"""Scrub a tag value."""
# Gracefully handle None:
@@ -219,6 +238,7 @@
reg_exp = re.compile( '\s' )
scrubbed_value = re.sub( reg_exp, "", value )
return scrubbed_value
+
def _scrub_tag_name( self, name ):
"""Scrub a tag name."""
# Gracefully handle None:
@@ -234,12 +254,14 @@
if len( scrubbed_name ) < self.min_tag_len or len( scrubbed_name ) > self.max_tag_len:
return None
return scrubbed_name
+
def _scrub_tag_name_list( self, tag_name_list ):
"""Scrub a tag name list."""
scrubbed_tag_list = list()
for tag in tag_name_list:
scrubbed_tag_list.append( self._scrub_tag_name( tag ) )
return scrubbed_tag_list
+
def _get_name_value_pair( self, tag_str ):
"""Get name, value pair from a tag string."""
# Use regular expression to parse name, value.
@@ -250,6 +272,7 @@
name_value_pair.append( None )
return name_value_pair
+
class GalaxyTagHandler( TagHandler ):
def __init__( self ):
from galaxy import model
@@ -271,6 +294,7 @@
model.VisualizationTagAssociation,
model.VisualizationTagAssociation.table.c.visualization_id )
+
class CommunityTagHandler( TagHandler ):
def __init__( self ):
from galaxy.webapps.tool_shed import model
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 lib/galaxy/util/json.py
--- a/lib/galaxy/util/json.py
+++ b/lib/galaxy/util/json.py
@@ -52,7 +52,7 @@
return val
-def safe_dumps(*args, **kwargs):
+def safe_dumps( *args, **kwargs ):
"""
This is a wrapper around dumps that encodes Infinity and NaN values. It's a
fairly rare case (which will be low in request volume). Basically, we tell
@@ -60,10 +60,12 @@
re-encoding.
"""
try:
- dumped = json.dumps(*args, allow_nan=False, **kwargs)
+ dumped = json.dumps( *args, allow_nan=False, **kwargs )
except ValueError:
- obj = swap_inf_nan(copy.deepcopy(args[0]))
- dumped = json.dumps(obj, allow_nan=False, **kwargs)
+ obj = swap_inf_nan( copy.deepcopy( args[0] ) )
+ dumped = json.dumps( obj, allow_nan=False, **kwargs )
+ if kwargs.get( 'escape_closing_tags', True ):
+ return dumped.replace( '</', '<\\/' )
return dumped
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 lib/galaxy/util/validation.py
--- a/lib/galaxy/util/validation.py
+++ b/lib/galaxy/util/validation.py
@@ -8,8 +8,8 @@
def validate_and_sanitize_basestring( key, val ):
if not isinstance( val, basestring ):
- raise exceptions.RequestParameterInvalidException( '%s must be a string or unicode: %s'
- % ( key, str( type( val ) ) ) )
+ raise exceptions.RequestParameterInvalidException( '%s must be a string or unicode: %s'
+ % ( key, str( type( val ) ) ) )
return unicode( sanitize_html( val, 'utf-8', 'text/html' ), 'utf-8' )
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 lib/galaxy/web/framework/helpers/__init__.py
--- a/lib/galaxy/web/framework/helpers/__init__.py
+++ b/lib/galaxy/web/framework/helpers/__init__.py
@@ -111,4 +111,3 @@
Returns true if input is a boolean and true or is a string and looks like a true value.
"""
return val == True or val in [ 'True', 'true', 'T', 't' ]
-
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 lib/galaxy/webapps/galaxy/controllers/tag.py
--- a/lib/galaxy/webapps/galaxy/controllers/tag.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tag.py
@@ -64,7 +64,7 @@
trans.log_action( user, unicode( "untag" ), context, params )
# Retag an item. All previous tags are deleted and new tags are applied.
- #(a)web.expose
+ @web.expose
@web.require_login( "Apply a new set of tags to an item; previous tags are deleted." )
def retag_async( self, trans, item_id=None, item_class=None, new_tags=None ):
"""
@@ -73,7 +73,7 @@
# Apply tags.
item = self._get_item( trans, item_class, trans.security.decode_id( item_id ) )
user = trans.user
- self.get_tag_handler( trans ).delete_item_tags( trans, item )
+ self.get_tag_handler( trans ).delete_item_tags( trans, user, item )
self.get_tag_handler( trans ).apply_item_tags( trans, user, item, new_tags.encode( 'utf-8' ) )
trans.sa_session.flush()
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 templates/galaxy_client_app.mako
--- a/templates/galaxy_client_app.mako
+++ b/templates/galaxy_client_app.mako
@@ -15,7 +15,7 @@
//TODO: global...
%for key in kwargs:
( window.bootstrapped = window.bootstrapped || {} )[ '${key}' ] = (
- ${ h.dumps( kwargs[ key ], indent=( 2 if trans.debug else 0 ) )} );
+ ${ h.dumps( kwargs[ key ], indent=( 2 if trans.debug else 0 ) ).replace( '</', '<\\/' ) } );
%endfor
define( 'bootstrapped-data', function(){
return window.bootstrapped;
@@ -76,11 +76,17 @@
user_dict = trans.user.to_dict( view='element',
value_mapper={ 'id': trans.security.encode_id, 'total_disk_usage': float } )
user_dict[ 'quota_percent' ] = trans.app.quota_agent.get_percent( trans=trans )
+ user_dict[ 'is_admin' ] = trans.user_is_admin()
# tags used
users_api_controller = trans.webapp.api_controllers[ 'users' ]
- user_dict[ 'tags_used' ] = users_api_controller.get_user_tags_used( trans, user=trans.user )
- user_dict[ 'is_admin' ] = trans.user_is_admin()
+ tags_used = []
+ for tag in users_api_controller.get_user_tags_used( trans, user=trans.user ):
+ tag = tag | h
+ if tag:
+ tags_used.append( tag )
+ user_dict[ 'tags_used' ] = tags_used
+
return user_dict
usage = 0
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 templates/tagging_common.mako
--- a/templates/tagging_common.mako
+++ b/templates/tagging_common.mako
@@ -19,7 +19,7 @@
## Render HTML for a list of tags.
<%def name="render_tagging_element_html(elt_id=None, tags=None, editable=True, use_toggle_link=True, input_size='15', in_form=False, tag_type='individual', render_add_tag_button=True)">
## Useful attributes.
- <%
+ <%
num_tags = len( tags )
%><div class="tag-element"
@@ -50,6 +50,7 @@
elif isinstance( tag, ItemTagAssociation ):
tag_name = tag.user_tname
tag_value = tag.user_value
+
## Convert tag name, value to unicode.
if isinstance( tag_name, str ):
tag_name = unicode( escape( tag_name ), 'utf-8' )
@@ -61,7 +62,7 @@
tag_str = tag_name
%><span class="tag-button">
- <span class="tag-name">${tag_str}</span>
+ <span class="tag-name">${tag_str | h}</span>
%if editable:
<img class="delete-tag-img" src="${h.url_for('/static/images/delete_tag_icon_gray.png')}"/>
%endif
@@ -186,10 +187,11 @@
## Build dict of tag name, values.
tag_names_and_values = dict()
for tag in item_tags:
- tag_name = tag.user_tname
+ tag_name = escape( tag.user_tname )
tag_value = ""
if tag.value is not None:
- tag_value = tag.user_value
+ tag_value = escape( tag.user_value )
+
## Tag names and values may be string or unicode object.
if isinstance( tag_name, str ):
tag_names_and_values[unicode(tag_name, 'utf-8')] = unicode(tag_value, 'utf-8')
diff -r 4ecb1efececdb58d16087a58d1f168851899aa4a -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -1,32 +1,4 @@
-## get user data
-<%def name="get_user_json()">
-<%
- """Bootstrapping user API JSON"""
- #TODO: move into common location (poss. BaseController)
- if trans.user:
- user_dict = trans.user.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id,
- 'total_disk_usage': float } )
- user_dict[ 'quota_percent' ] = trans.app.quota_agent.get_percent( trans=trans )
- users_api_controller = trans.webapp.api_controllers[ 'users' ]
- user_dict[ 'tags_used' ] = users_api_controller.get_user_tags_used( trans, user=trans.user )
- user_dict[ 'is_admin' ] = trans.user_is_admin()
- else:
- usage = 0
- percent = None
- try:
- usage = trans.app.quota_agent.get_usage( trans, history=trans.history )
- percent = trans.app.quota_agent.get_percent( trans=trans, usage=usage )
- except AssertionError, assertion:
- # no history for quota_agent.get_usage assertion
- pass
- user_dict = {
- 'total_disk_usage' : int( usage ),
- 'nice_total_disk_usage' : util.nice_size( usage ),
- 'quota_percent' : percent
- }
- return user_dict
-%>
-</%def>
+<%namespace file="/galaxy_client_app.mako" import="get_user_json" />
## masthead head generator
<%def name="load(active_view = None)">
@@ -87,7 +59,7 @@
], function( mod_masthead, mod_menu, mod_modal, mod_frame, GalaxyUpload, user, quotameter ){
if( !Galaxy.currUser ){
// this doesn't need to wait for the page being readied
- Galaxy.currUser = new user.User(${ h.dumps( get_user_json(), indent=2 ) });
+ Galaxy.currUser = new user.User(${ h.dumps( masthead_config[ 'user' ][ 'json' ], indent=2 ) });
}
$(function() {
https://bitbucket.org/galaxy/galaxy-central/commits/66ea70fbc161/
Changeset: 66ea70fbc161
Branch: next-stable
User: dannon
Date: 2014-11-25 19:31:55+00:00
Summary: Another instance of tool_id reflected xss (in data_source_redirect).
Affected #: 1 file
diff -r 988dd20de45bb4d6a361da1febe7ca0631cb7b95 -r 66ea70fbc161602121d364f4ef7d8c3a9126d01d lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -291,7 +291,7 @@
log.error( "data_source_redirect called with tool id '%s' but no such tool exists", tool_id )
trans.log_event( "Tool id '%s' does not exist" % tool_id )
trans.response.status = 404
- return "Tool '%s' does not exist, kwd=%s " % ( tool_id, kwd )
+ return trans.show_error_message("Tool '%s' does not exist." % ( escape(tool_id) ))
if isinstance( tool, DataSourceTool ):
link = url_for( tool.action, **tool.get_static_param_values( trans ) )
https://bitbucket.org/galaxy/galaxy-central/commits/b017300f1867/
Changeset: b017300f1867
Branch: next-stable
User: dannon
Date: 2014-11-25 19:34:20+00:00
Summary: Merge.
Affected #: 1 file
diff -r 66ea70fbc161602121d364f4ef7d8c3a9126d01d -r b017300f1867b23c4e77fa3810a7cdbf196e7de1 templates/galaxy_client_app.mako
--- a/templates/galaxy_client_app.mako
+++ b/templates/galaxy_client_app.mako
@@ -15,7 +15,7 @@
//TODO: global...
%for key in kwargs:
( window.bootstrapped = window.bootstrapped || {} )[ '${key}' ] = (
- ${ h.dumps( kwargs[ key ], indent=( 2 if trans.debug else 0 ) ).replace( '</', '<\\/' ) } );
+ ${ h.dumps( kwargs[ key ], indent=( 2 if trans.debug else 0 ) ) } );
%endfor
define( 'bootstrapped-data', function(){
return window.bootstrapped;
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