galaxy-commits
Threads by month
- ----- 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
September 2012
- 1 participants
- 161 discussions
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/2551b8632ede/
changeset: 2551b8632ede
user: richard_burhans
date: 2012-09-13 20:47:21
summary: added missing comma
affected #: 1 file
diff -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 -r 2551b8632edea0df8b71ef6b426e30b7159153a4 templates/webapps/community/base_panels.mako
--- a/templates/webapps/community/base_panels.mako
+++ b/templates/webapps/community/base_panels.mako
@@ -72,7 +72,7 @@
## Help tab.
<%
menu_options = [
- [_('Galaxy Q&A'), app.config.get( "qa_url", "http://slyfox.bx.psu.edu:8080/" ), "_blank" ]
+ [_('Galaxy Q&A'), app.config.get( "qa_url", "http://slyfox.bx.psu.edu:8080/" ), "_blank" ],
[_('Support'), app.config.get( "support_url", "http://wiki.g2.bx.psu.edu/Support" ), "_blank" ],
[_('Tool shed wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/Tool%20Shed" ), "_blank" ],
[_('Galaxy wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/" ), "_blank" ],
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/changeset/fa6772cf1d8b/
changeset: fa6772cf1d8b
user: dannon
date: 2012-09-13 18:48:18
summary: Correct default keypair_name for cloud_launch.
affected #: 1 file
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa lib/galaxy/web/controllers/cloudlaunch.py
--- a/lib/galaxy/web/controllers/cloudlaunch.py
+++ b/lib/galaxy/web/controllers/cloudlaunch.py
@@ -26,7 +26,7 @@
log = logging.getLogger(__name__)
PKEY_PREFIX = 'gxy_pkey'
-DEFAULT_KEYPAIR = 'deleteme_keypair'
+DEFAULT_KEYPAIR = 'cloudman_keypair'
DEFAULT_AMI = 'ami-da58aab3'
class CloudController(BaseUIController):
https://bitbucket.org/galaxy/galaxy-central/changeset/74b67f34a4df/
changeset: 74b67f34a4df
user: dannon
date: 2012-09-13 20:19:49
summary: Merge
affected #: 8 files
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 lib/galaxy/web/controllers/root.py
--- a/lib/galaxy/web/controllers/root.py
+++ b/lib/galaxy/web/controllers/root.py
@@ -122,7 +122,7 @@
history_panel_template = "root/history.mako"
# history panel -> backbone
- ##history_panel_template = "root/alternate_history.mako"
+ #history_panel_template = "root/alternate_history.mako"
return trans.stream_template_mako( history_panel_template,
history = history,
annotation = self.get_item_annotation_str( trans.sa_session, trans.user, history ),
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/mvc/history.js
--- a/static/scripts/mvc/history.js
+++ b/static/scripts/mvc/history.js
@@ -167,7 +167,7 @@
// view for HistoryItem model above
// uncomment this out see log messages
- logger : console,
+ //logger : console,
tagName : "div",
className : "historyItemContainer",
@@ -763,9 +763,12 @@
});
-//==============================================================================
+//------------------------------------------------------------------------------
//HistoryItemView.templates = InDomTemplateLoader.getTemplates({
HistoryItemView.templates = CompiledTemplateLoader.getTemplates({
+ 'common-templates.html' : {
+ warningMsg : 'template-warningmessagesmall',
+ },
'history-templates.html' : {
messages : 'template-history-warning-messages',
titleLink : 'template-history-titleLink',
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/mvc/ui.js
--- a/static/scripts/mvc/ui.js
+++ b/static/scripts/mvc/ui.js
@@ -35,12 +35,7 @@
*
*/
var IconButtonView = Backbone.View.extend({
- tagName : 'a',
- className : 'icon-button',
- // jsHint.shut( up )
- hrefVoidFn : [ 'javascript', ':void(0)' ].join( '' ),
- fadeSpeed : 0,
initialize : function(){
// better rendering this way (for me anyway)
@@ -49,48 +44,16 @@
},
render : function(){
- //NOTE: this is meant to be rerendered on a model change
- // - since most of the rendering is attributes, it gets complicated
- //TODO: template would be faster, more concise - more PITA
- var disabled_class = this.model.attributes.icon_class + '_disabled';
+ //NOTE: not doing this hide will lead to disappearing buttons when they're both being hovered over & rendered
+ this.$el.tooltip( 'hide' );
- if( !this.model.attributes.visible ){
- //TODO: fancy - but may not work as you expect
- this.$el.fadeOut( this.fadeSpeed );
- }
+ // template in common-templates.html
+ var newElem = $( Handlebars.partials.iconButton( this.model.toJSON() ) );
+ newElem.tooltip( this.model.get( 'tooltip_config' ) );
- if( this.model.attributes.enabled ){
- if( this.$el.hasClass( disabled_class ) ){
- this.$el.removeClass( disabled_class );
- }
- this.$el.addClass( this.model.attributes.icon_class );
- } else {
- this.$el.removeClass( this.model.attributes.icon_class );
- this.$el.addClass( disabled_class );
- }
+ this.$el.replaceWith( newElem );
+ this.setElement( newElem );
- if( this.model.attributes.isMenuButton ){
- this.$el.addClass( 'menu-button' );
- } else {
- this.$el.removeClass( 'menu-button' );
- }
-
- this.$el.data( 'tooltip', false );
- this.$el.attr( 'data-original-title', null );
- this.$el.removeClass( 'tooltip' );
- if( this.model.attributes.title ){
- this.$el.attr( 'title', this.model.attributes.title ).addClass( 'tooltip' );
- this.$el.tooltip( this.model.attributes.tooltip_config );
- }
-
- this.$el.attr( 'id', ( this.model.attributes.id )?( this.model.attributes.id ):( null ) );
- this.$el.attr( 'target', ( this.model.attributes.target )?( this.model.attributes.target ):( null ) );
- this.$el.attr( 'href', ( this.model.attributes.href && !this.model.attributes.on_click )?
- ( this.model.attributes.href ):( this.hrefVoidFn ) );
-
- if( this.model.attributes.visible ){
- this.$el.fadeIn( this.fadeSpeed );
- }
return this;
},
@@ -99,6 +62,7 @@
},
click : function( event ){
+ console.debug( 'click event' );
// if on_click pass to that function
if( this.model.attributes.on_click ){
this.model.attributes.on_click( event );
@@ -108,6 +72,10 @@
return true;
}
});
+//TODO: bc h.templates is gen. loaded AFTER ui, Handlebars.partials.iconButton === undefined
+IconButtonView.templates = {
+ iconButton : Handlebars.partials.iconButton
+};
var IconButtonCollection = Backbone.Collection.extend({
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/templates/common-templates.html
--- a/static/scripts/templates/common-templates.html
+++ b/static/scripts/templates/common-templates.html
@@ -16,7 +16,7 @@
<script type="text/template" class="template-common" id="template-warningmessagesmall">
{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
- <div class="warningmessagesmall"><strong>{{ warning }}</strong></div>
+ <div class="warningmessagesmall"><strong>{{{ warning }}}</strong></div></script><script type="text/javascript" class="helper-common" id="helper-iconButton">
@@ -29,7 +29,7 @@
var buffer = "";
buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
- if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+ if( buttonData.title ){ buffer += ' title="' + buttonData.title + '"'; }
buffer += ' class="icon-button';
if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
@@ -44,7 +44,7 @@
if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
- buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ buffer += '>' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
return buffer;
});
</script>
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/templates/compiled/helpers-common-templates.js
--- a/static/scripts/templates/compiled/helpers-common-templates.js
+++ b/static/scripts/templates/compiled/helpers-common-templates.js
@@ -12,7 +12,7 @@
var buffer = "";
buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
- if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+ if( buttonData.title ){ buffer += ' title="' + buttonData.title + '"'; }
buffer += ' class="icon-button';
if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
@@ -27,7 +27,7 @@
if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
- buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ buffer += '>' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
return buffer;
});
/** Renders a warning in a (mostly css) highlighted, iconned warning box
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/templates/compiled/template-warningmessagesmall.js
--- a/static/scripts/templates/compiled/template-warningmessagesmall.js
+++ b/static/scripts/templates/compiled/template-warningmessagesmall.js
@@ -2,13 +2,14 @@
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-warningmessagesmall'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression;
+ var buffer = "", stack1, foundHelper, functionType="function";
buffer += " \n <div class=\"warningmessagesmall\"><strong>";
foundHelper = helpers.warning;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.warning; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + "</strong></div>";
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "</strong></div>";
return buffer;});
})();
\ No newline at end of file
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 static/scripts/templates/template-warningmessagesmall.handlebars
--- a/static/scripts/templates/template-warningmessagesmall.handlebars
+++ b/static/scripts/templates/template-warningmessagesmall.handlebars
@@ -1,2 +1,2 @@
{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
- <div class="warningmessagesmall"><strong>{{ warning }}</strong></div>
\ No newline at end of file
+ <div class="warningmessagesmall"><strong>{{{ warning }}}</strong></div>
\ No newline at end of file
diff -r fa6772cf1d8b6171f835a7401aa8df95c0bbebaa -r 74b67f34a4dfae65dc2dd01cbd1ad9010e1c4ab4 templates/root/alternate_history.mako
--- a/templates/root/alternate_history.mako
+++ b/templates/root/alternate_history.mako
@@ -298,6 +298,7 @@
${h.templates(
"helpers-common-templates",
+ "template-warningmessagesmall",
"template-history-warning-messages",
"template-history-titleLink",
@@ -314,34 +315,6 @@
"mvc/history"
##"mvc/tags", "mvc/annotations"
)}
-
- <script type="text/javascript">
- GalaxyLocalization.setLocalizedString( ${ create_localization_json( get_page_localized_strings() ) } );
- // add needed controller urls to GalaxyPaths
- galaxy_paths.set( 'dataset_path', "${h.url_for( controller='dataset' )}" )
-
- // Init. on document load.
- var pageData = ${context_to_js()};
-
- //USE_MOCK_DATA = true;
-
- $(function(){
- if( console && console.debug ){ console.debug( 'using backbone.js in history panel' ); }
- if( window.USE_MOCK_DATA ){
- if( console && console.debug ){ console.debug( '\t using mock data' ); }
- createMockHistoryData();
- return;
- }
-
- glx_history = new History( pageData.history ).loadDatasetsAsHistoryItems( pageData.hdas );
- glx_history_view = new HistoryView({ model: glx_history });
- glx_history_view.render();
-
- hi = glx_history.items.at( 0 );
- hi_view = new HistoryItemView({ model: hi });
- $( 'body' ).append( hi_view.render() );
- });
- </script></%def><%def name="stylesheets()">
@@ -385,5 +358,41 @@
${_('Galaxy History')}
</%def>
+<script type="text/javascript">
+ GalaxyLocalization.setLocalizedString( ${ create_localization_json( get_page_localized_strings() ) } );
+ // add needed controller urls to GalaxyPaths
+ galaxy_paths.set( 'dataset_path', "${h.url_for( controller='dataset' )}" )
+
+ // Init. on document load.
+ var pageData = ${context_to_js()};
+
+ //USE_MOCK_DATA = true;
+ USE_CURR_DATA = true;
+
+ $(function(){
+ if( console && console.debug ){ console.debug( 'using backbone.js in history panel' ); }
+
+ if( window.USE_MOCK_DATA ){
+ if( console && console.debug ){ console.debug( '\t using mock data' ); }
+ createMockHistoryData();
+ return;
+
+ } else if ( USE_CURR_DATA ){
+ if( console && console.debug ){ console.debug( '\t using current history data' ); }
+ glx_history = new History( pageData.history ).loadDatasetsAsHistoryItems( pageData.hdas );
+ glx_history_view = new HistoryView({ model: glx_history });
+ glx_history_view.render();
+
+ hi = glx_history.items.at( 0 );
+ hi_view = new HistoryItemView({ model: hi });
+ $( 'body' ).append( hi_view.render() );
+ return;
+ }
+
+ // sandbox here
+ });
+</script>
+
+
<body class="historyPage"></body>
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: fixes to iconButton template; have IconButtonView use that template
by Bitbucket 13 Sep '12
by Bitbucket 13 Sep '12
13 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9867a7110f6d/
changeset: 9867a7110f6d
user: carlfeberhard
date: 2012-09-13 20:08:09
summary: fixes to iconButton template; have IconButtonView use that template
affected #: 8 files
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 lib/galaxy/web/controllers/root.py
--- a/lib/galaxy/web/controllers/root.py
+++ b/lib/galaxy/web/controllers/root.py
@@ -122,7 +122,7 @@
history_panel_template = "root/history.mako"
# history panel -> backbone
- ##history_panel_template = "root/alternate_history.mako"
+ #history_panel_template = "root/alternate_history.mako"
return trans.stream_template_mako( history_panel_template,
history = history,
annotation = self.get_item_annotation_str( trans.sa_session, trans.user, history ),
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/mvc/history.js
--- a/static/scripts/mvc/history.js
+++ b/static/scripts/mvc/history.js
@@ -167,7 +167,7 @@
// view for HistoryItem model above
// uncomment this out see log messages
- logger : console,
+ //logger : console,
tagName : "div",
className : "historyItemContainer",
@@ -763,9 +763,12 @@
});
-//==============================================================================
+//------------------------------------------------------------------------------
//HistoryItemView.templates = InDomTemplateLoader.getTemplates({
HistoryItemView.templates = CompiledTemplateLoader.getTemplates({
+ 'common-templates.html' : {
+ warningMsg : 'template-warningmessagesmall',
+ },
'history-templates.html' : {
messages : 'template-history-warning-messages',
titleLink : 'template-history-titleLink',
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/mvc/ui.js
--- a/static/scripts/mvc/ui.js
+++ b/static/scripts/mvc/ui.js
@@ -35,12 +35,7 @@
*
*/
var IconButtonView = Backbone.View.extend({
- tagName : 'a',
- className : 'icon-button',
- // jsHint.shut( up )
- hrefVoidFn : [ 'javascript', ':void(0)' ].join( '' ),
- fadeSpeed : 0,
initialize : function(){
// better rendering this way (for me anyway)
@@ -49,48 +44,16 @@
},
render : function(){
- //NOTE: this is meant to be rerendered on a model change
- // - since most of the rendering is attributes, it gets complicated
- //TODO: template would be faster, more concise - more PITA
- var disabled_class = this.model.attributes.icon_class + '_disabled';
+ //NOTE: not doing this hide will lead to disappearing buttons when they're both being hovered over & rendered
+ this.$el.tooltip( 'hide' );
- if( !this.model.attributes.visible ){
- //TODO: fancy - but may not work as you expect
- this.$el.fadeOut( this.fadeSpeed );
- }
+ // template in common-templates.html
+ var newElem = $( Handlebars.partials.iconButton( this.model.toJSON() ) );
+ newElem.tooltip( this.model.get( 'tooltip_config' ) );
- if( this.model.attributes.enabled ){
- if( this.$el.hasClass( disabled_class ) ){
- this.$el.removeClass( disabled_class );
- }
- this.$el.addClass( this.model.attributes.icon_class );
- } else {
- this.$el.removeClass( this.model.attributes.icon_class );
- this.$el.addClass( disabled_class );
- }
+ this.$el.replaceWith( newElem );
+ this.setElement( newElem );
- if( this.model.attributes.isMenuButton ){
- this.$el.addClass( 'menu-button' );
- } else {
- this.$el.removeClass( 'menu-button' );
- }
-
- this.$el.data( 'tooltip', false );
- this.$el.attr( 'data-original-title', null );
- this.$el.removeClass( 'tooltip' );
- if( this.model.attributes.title ){
- this.$el.attr( 'title', this.model.attributes.title ).addClass( 'tooltip' );
- this.$el.tooltip( this.model.attributes.tooltip_config );
- }
-
- this.$el.attr( 'id', ( this.model.attributes.id )?( this.model.attributes.id ):( null ) );
- this.$el.attr( 'target', ( this.model.attributes.target )?( this.model.attributes.target ):( null ) );
- this.$el.attr( 'href', ( this.model.attributes.href && !this.model.attributes.on_click )?
- ( this.model.attributes.href ):( this.hrefVoidFn ) );
-
- if( this.model.attributes.visible ){
- this.$el.fadeIn( this.fadeSpeed );
- }
return this;
},
@@ -99,6 +62,7 @@
},
click : function( event ){
+ console.debug( 'click event' );
// if on_click pass to that function
if( this.model.attributes.on_click ){
this.model.attributes.on_click( event );
@@ -108,6 +72,10 @@
return true;
}
});
+//TODO: bc h.templates is gen. loaded AFTER ui, Handlebars.partials.iconButton === undefined
+IconButtonView.templates = {
+ iconButton : Handlebars.partials.iconButton
+};
var IconButtonCollection = Backbone.Collection.extend({
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/templates/common-templates.html
--- a/static/scripts/templates/common-templates.html
+++ b/static/scripts/templates/common-templates.html
@@ -16,7 +16,7 @@
<script type="text/template" class="template-common" id="template-warningmessagesmall">
{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
- <div class="warningmessagesmall"><strong>{{ warning }}</strong></div>
+ <div class="warningmessagesmall"><strong>{{{ warning }}}</strong></div></script><script type="text/javascript" class="helper-common" id="helper-iconButton">
@@ -29,7 +29,7 @@
var buffer = "";
buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
- if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+ if( buttonData.title ){ buffer += ' title="' + buttonData.title + '"'; }
buffer += ' class="icon-button';
if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
@@ -44,7 +44,7 @@
if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
- buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ buffer += '>' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
return buffer;
});
</script>
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/templates/compiled/helpers-common-templates.js
--- a/static/scripts/templates/compiled/helpers-common-templates.js
+++ b/static/scripts/templates/compiled/helpers-common-templates.js
@@ -12,7 +12,7 @@
var buffer = "";
buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
- if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+ if( buttonData.title ){ buffer += ' title="' + buttonData.title + '"'; }
buffer += ' class="icon-button';
if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
@@ -27,7 +27,7 @@
if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
- buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ buffer += '>' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
return buffer;
});
/** Renders a warning in a (mostly css) highlighted, iconned warning box
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/templates/compiled/template-warningmessagesmall.js
--- a/static/scripts/templates/compiled/template-warningmessagesmall.js
+++ b/static/scripts/templates/compiled/template-warningmessagesmall.js
@@ -2,13 +2,14 @@
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-warningmessagesmall'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression;
+ var buffer = "", stack1, foundHelper, functionType="function";
buffer += " \n <div class=\"warningmessagesmall\"><strong>";
foundHelper = helpers.warning;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.warning; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + "</strong></div>";
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "</strong></div>";
return buffer;});
})();
\ No newline at end of file
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 static/scripts/templates/template-warningmessagesmall.handlebars
--- a/static/scripts/templates/template-warningmessagesmall.handlebars
+++ b/static/scripts/templates/template-warningmessagesmall.handlebars
@@ -1,2 +1,2 @@
{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
- <div class="warningmessagesmall"><strong>{{ warning }}</strong></div>
\ No newline at end of file
+ <div class="warningmessagesmall"><strong>{{{ warning }}}</strong></div>
\ No newline at end of file
diff -r 802b87d6491087f6e82d8490d0d603b7affc3491 -r 9867a7110f6d03488ca3f96e6a924346c8450cd8 templates/root/alternate_history.mako
--- a/templates/root/alternate_history.mako
+++ b/templates/root/alternate_history.mako
@@ -298,6 +298,7 @@
${h.templates(
"helpers-common-templates",
+ "template-warningmessagesmall",
"template-history-warning-messages",
"template-history-titleLink",
@@ -314,34 +315,6 @@
"mvc/history"
##"mvc/tags", "mvc/annotations"
)}
-
- <script type="text/javascript">
- GalaxyLocalization.setLocalizedString( ${ create_localization_json( get_page_localized_strings() ) } );
- // add needed controller urls to GalaxyPaths
- galaxy_paths.set( 'dataset_path', "${h.url_for( controller='dataset' )}" )
-
- // Init. on document load.
- var pageData = ${context_to_js()};
-
- //USE_MOCK_DATA = true;
-
- $(function(){
- if( console && console.debug ){ console.debug( 'using backbone.js in history panel' ); }
- if( window.USE_MOCK_DATA ){
- if( console && console.debug ){ console.debug( '\t using mock data' ); }
- createMockHistoryData();
- return;
- }
-
- glx_history = new History( pageData.history ).loadDatasetsAsHistoryItems( pageData.hdas );
- glx_history_view = new HistoryView({ model: glx_history });
- glx_history_view.render();
-
- hi = glx_history.items.at( 0 );
- hi_view = new HistoryItemView({ model: hi });
- $( 'body' ).append( hi_view.render() );
- });
- </script></%def><%def name="stylesheets()">
@@ -385,5 +358,41 @@
${_('Galaxy History')}
</%def>
+<script type="text/javascript">
+ GalaxyLocalization.setLocalizedString( ${ create_localization_json( get_page_localized_strings() ) } );
+ // add needed controller urls to GalaxyPaths
+ galaxy_paths.set( 'dataset_path', "${h.url_for( controller='dataset' )}" )
+
+ // Init. on document load.
+ var pageData = ${context_to_js()};
+
+ //USE_MOCK_DATA = true;
+ USE_CURR_DATA = true;
+
+ $(function(){
+ if( console && console.debug ){ console.debug( 'using backbone.js in history panel' ); }
+
+ if( window.USE_MOCK_DATA ){
+ if( console && console.debug ){ console.debug( '\t using mock data' ); }
+ createMockHistoryData();
+ return;
+
+ } else if ( USE_CURR_DATA ){
+ if( console && console.debug ){ console.debug( '\t using current history data' ); }
+ glx_history = new History( pageData.history ).loadDatasetsAsHistoryItems( pageData.hdas );
+ glx_history_view = new HistoryView({ model: glx_history });
+ glx_history_view.render();
+
+ hi = glx_history.items.at( 0 );
+ hi_view = new HistoryItemView({ model: hi });
+ $( 'body' ).append( hi_view.render() );
+ return;
+ }
+
+ // sandbox here
+ });
+</script>
+
+
<body class="historyPage"></body>
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: Added history.js templates: icon-button partial, hdaSummary, titleLink; packed scripts
by Bitbucket 13 Sep '12
by Bitbucket 13 Sep '12
13 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/802b87d64910/
changeset: 802b87d64910
user: carlfeberhard
date: 2012-09-13 17:58:14
summary: Added history.js templates: icon-button partial, hdaSummary, titleLink; packed scripts
affected #: 25 files
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/mvc/history.js
--- a/static/scripts/mvc/history.js
+++ b/static/scripts/mvc/history.js
@@ -124,8 +124,12 @@
},
isEditable : function(){
- // roughly can_edit from history_common.mako
- return ( !( this.get( 'deleted' ) || this.get( 'purged' ) ) );
+ // roughly can_edit from history_common.mako - not deleted or purged = editable
+ return (
+ //this.get( 'for_editing' )
+ //&& !( this.get( 'deleted' ) || this.get( 'purged' ) )
+ !( this.get( 'deleted' ) || this.get( 'purged' ) )
+ );
},
hasData : function(){
@@ -159,10 +163,11 @@
//==============================================================================
var HistoryItemView = BaseView.extend( LoggableMixin ).extend({
+ //??TODO: add alias in initialize this.hda = this.model?
// view for HistoryItem model above
// uncomment this out see log messages
- //logger : console,
+ logger : console,
tagName : "div",
className : "historyItemContainer",
@@ -179,6 +184,7 @@
this.log( this + '.model:', this.model );
var id = this.model.get( 'id' ),
state = this.model.get( 'state' );
+ this.clearReferences();
this.$el.attr( 'id', 'historyItemContainer-' + id );
@@ -191,7 +197,7 @@
this.body = $( this._render_body() );
itemWrapper.append( this.body );
- // set up canned behavior (bootstrap, popupmenus, editable_text, etc.)
+ // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.)
itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' });
//TODO: broken
@@ -206,6 +212,14 @@
return this.$el.append( itemWrapper );
},
+ clearReferences : function(){
+ //??TODO: best way?
+ this.displayButton = null;
+ this.editButton = null;
+ this.deleteButton = null;
+ this.errButton = null;
+ },
+
// ................................................................................ RENDER WARNINGS
_render_warnings : function(){
// jQ errs on building dom with whitespace - if there are no messages, trim -> ''
@@ -224,16 +238,10 @@
// ................................................................................ DISPLAY, EDIT ATTR, DELETE
_render_titleButtons : function(){
// render the display, edit attr and delete icon-buttons
- var buttonDiv = $( '<div class="historyItemButtons"></div>' ),
- for_editing = this.model.get( 'for_editing' );
-
- // don't show display, edit while uploading
- if( this.model.get( 'state' ) !== HistoryItem.STATES.UPLOAD ){
- buttonDiv.append( this._render_displayButton() );
-
- if( for_editing ){ buttonDiv.append( this._render_editButton() ); }
- }
- if( for_editing ){ buttonDiv.append( this._render_deleteButton() ); }
+ var buttonDiv = $( '<div class="historyItemButtons"></div>' );
+ buttonDiv.append( this._render_displayButton() );
+ buttonDiv.append( this._render_editButton() );
+ buttonDiv.append( this._render_deleteButton() );
return buttonDiv;
},
@@ -241,15 +249,19 @@
//TODO: move other data (non-href) into {} in view definition, cycle over those keys in _titlebuttons
//TODO: move disabled span data into view def, move logic into _titlebuttons
_render_displayButton : function(){
+
+ // don't show display while uploading
+ if( this.model.get( 'state' ) === HistoryItem.STATES.UPLOAD ){ return null; }
+
+ // show a disabled display if the data's been purged
displayBtnData = ( this.model.get( 'purged' ) )?({
- // show a disabled display if the data's been purged
title : 'Cannot display datasets removed from disk',
+ enabled : false,
icon_class : 'display',
- enabled : false,
+
+ // if not, render the display icon-button with href
}):({
- // if not, render the display icon-button with href
title : 'Display data in browser',
- //TODO: need generated url here
href : this.model.get( 'display_url' ),
target : ( this.model.get( 'for_editing' ) )?( 'galaxy_main' ):( null ),
icon_class : 'display',
@@ -259,32 +271,39 @@
},
_render_editButton : function(){
- // render the edit attr icon-button
- var id = this.model.get( 'id' ),
- purged = this.model.get( 'purged' ),
- deleted = this.model.get( 'deleted' );
+
+ // don't show edit while uploading, or if editable
+ if( ( this.model.get( 'state' ) === HistoryItem.STATES.UPLOAD )
+ || ( !this.model.get( 'for_editing' ) ) ){
+ return null;
+ }
+
+ var purged = this.model.get( 'purged' ),
+ deleted = this.model.get( 'deleted' ),
+ editBtnData = {
+ title : 'Edit attributes',
+ href : this.model.get( 'edit_url' ),
+ target : 'galaxy_main',
+ icon_class : 'edit'
+ };
- var editBtnData = {
- title : 'Edit attributes',
- href : this.model.get( 'edit_url' ),
- target : 'galaxy_main',
- icon_class : 'edit'
- }
// disable if purged or deleted and explain why in the tooltip
//TODO: if for_editing
if( deleted || purged ){
- editBtnData = {
- enabled : false,
- icon_class : 'edit'
- };
- editBtnData.title = ( !purged )?( 'Undelete dataset to edit attributes' ):
- ( 'Cannot edit attributes of datasets removed from disk' );
+ editBtnData.enabled = false;
}
+ if( deleted ){
+ editBtnData.title = 'Undelete dataset to edit attributes';
+ } else if( purged ){
+ editBtnData.title = 'Cannot edit attributes of datasets removed from disk';
+ }
+
this.editButton = new IconButtonView({ model : new IconButton( editBtnData ) });
return this.editButton.render().$el;
},
_render_deleteButton : function(){
+ // don't show delete if not editable
if( !this.model.get( 'for_editing' ) ){ return null; }
var deleteBtnData = ( this.model.get( 'delete_url' ) )?({
@@ -303,14 +322,8 @@
},
_render_titleLink : function(){
- // render the title (hda name)
- var h_name = this.model.get( 'name' ),
- hid = this.model.get( 'hid' );
- title = ( hid + ': ' + h_name );
- return $( linkHTMLTemplate({
- href : 'javascript:void(0);',
- text : '<span class="historyItemTitle">' + title + '</span>'
- }));
+ this.log( 'model:', this.model.toJSON() );
+ return $( jQuery.trim( HistoryItemView.templates.titleLink( this.model.toJSON() ) ) );
},
// ................................................................................ RENDER BODY
@@ -344,12 +357,14 @@
// bug report button
//NOTE: these are shown _before_ info, rerun so use _prepend_
if( this.model.get( 'for_editing' ) ){
- actionBtnDiv.prepend( $( linkHTMLTemplate({
+ //TODO??: save to view 'this.errButton'
+ this.errButton = new IconButtonView({ model : new IconButton({
title : 'View or report this error',
- href : this.model.get( 'report_errors_url' ),
+ href : this.model.get( 'report_error_url' ),
target : 'galaxy_main',
- classes : [ 'icon-button', 'tooltip', 'bug' ]
- })));
+ icon_class : 'bug'
+ })});
+ actionBtnDiv.prepend( this.errButton.render().$el );
}
if( this.model.hasData() ){
//TODO: render_download_links( data, dataset_id )
@@ -568,37 +583,35 @@
},
_render_hdaSummary : function(){
- // default span rendering
- var dbkeyHTML = _.template( '<span class="<%= dbkey %>"><%= dbkey %></span>',
- { dbkey: this.model.get( 'metadata_dbkey' ) } );
- // if there's no dbkey and it's editable : render a link to editing in the '?'
- if( this.model.get( 'metadata_dbkey' ) === '?' && this.model.isEditable() ){
- dbkeyHTML = linkHTMLTemplate({
- text : this.model.get( 'metadata_dbkey' ),
- href : this.model.get( 'edit_url' ),
- target : 'galaxy_main'
- });
+ var modelData = this.model.toJSON();
+
+ // if there's no dbkey and it's editable : pass a flag to the template to render a link to editing in the '?'
+ if( this.model.get( 'metadata_dbkey' ) === '?'
+ && this.model.isEditable() ){
+ _.extend( modelData, { dbkey_unknown_and_editable : true });
}
- return ( HistoryItemView.TEMPLATES.hdaSummary(
- _.extend({ dbkeyHTML: dbkeyHTML }, this.model.attributes ) ) );
+ return HistoryItemView.templates.hdaSummary( modelData );
},
_render_showParamsAndRerun : function(){
//TODO??: generalize to _render_actionButtons, pass in list of 'buttons' to render, default to these two
var actionBtnDiv = $( '<div/>' );
- actionBtnDiv.append( $( linkHTMLTemplate({
+
+ this.showParamsButton = new IconButtonView({ model : new IconButton({
title : 'View details',
href : this.model.get( 'show_params_url' ),
target : 'galaxy_main',
- classes : [ 'icon-button', 'tooltip', 'information' ]
- })));
+ icon_class : 'information'
+ }) });
+ actionBtnDiv.append( this.showParamsButton.render().$el );
+
if( this.model.get( 'for_editing' ) ){
- actionBtnDiv.append( $( linkHTMLTemplate({
+ this.rerunButton = new IconButtonView({ model : new IconButton({
title : 'Run this job again',
href : this.model.get( 'rerun_url' ),
target : 'galaxy_main',
- classes : [ 'icon-button', 'tooltip', 'arrow-circle' ]
- })));
+ icon_class : 'arrow-circle'
+ }) });
}
return actionBtnDiv;
},
@@ -748,24 +761,14 @@
return 'HistoryItemView(' + modelString + ')';
}
});
-HistoryItemView.TEMPLATES = {};
-
-//TODO: contains localized strings
-HistoryItemView.TEMPLATES.hdaSummary = _.template([
- '<%= misc_blurb %><br />',
- 'format: <span class="<%= data_type %>"><%= data_type %></span>, ',
- 'database: <%= dbkeyHTML %>'
-].join( '' ));
//==============================================================================
//HistoryItemView.templates = InDomTemplateLoader.getTemplates({
HistoryItemView.templates = CompiledTemplateLoader.getTemplates({
- 'common-templates.html' : {
- warningMsg : 'template-warningmessagesmall',
- },
'history-templates.html' : {
- messages : 'template-history-warning-messages2',
+ messages : 'template-history-warning-messages',
+ titleLink : 'template-history-titleLink',
hdaSummary : 'template-history-hdaSummary'
}
});
@@ -1039,7 +1042,8 @@
{ state : HistoryItem.STATES.EMPTY }),
error :
_.extend( _.clone( mockHistory.data.template ),
- { state : HistoryItem.STATES.ERROR }),
+ { state : HistoryItem.STATES.ERROR,
+ report_error_url: 'example.com/report_err' }),
discarded :
_.extend( _.clone( mockHistory.data.template ),
{ state : HistoryItem.STATES.DISCARDED }),
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/libs/handlebars.full.js
--- /dev/null
+++ b/static/scripts/packed/libs/handlebars.full.js
@@ -0,0 +1,1 @@
+var Handlebars={};Handlebars.VERSION="1.0.beta.6";Handlebars.helpers={};Handlebars.partials={};Handlebars.registerHelper=function(b,c,a){if(a){c.not=a}this.helpers[b]=c};Handlebars.registerPartial=function(a,b){this.partials[a]=b};Handlebars.registerHelper("helperMissing",function(a){if(arguments.length===2){return undefined}else{throw new Error("Could not find property '"+a+"'")}});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(f,d){var a=d.inverse||function(){},h=d.fn;var c="";var g=toString.call(f);if(g===functionType){f=f.call(this)}if(f===true){return h(this)}else{if(f===false||f==null){return a(this)}else{if(g==="[object Array]"){if(f.length>0){for(var e=0,b=f.length;e<b;e++){c=c+h(f[e])}}else{c=a(this)}return c}else{return h(f)}}}});Handlebars.registerHelper("each",function(f,d){var g=d.fn,a=d.inverse;var c="";if(f&&f.length>0){for(var e=0,b=f.length;e<b;e++){c=c+g(f[e])}}else{c=a(this)}return c});Handlebars.registerHelper("if",function(b,a){var c=toString.call(b);if(c===functionType){b=b.call(this)}if(!b||Handlebars.Utils.isEmpty(b)){return a.inverse(this)}else{return a.fn(this)}});Handlebars.registerHelper("unless",function(c,b){var d=b.fn,a=b.inverse;b.fn=a;b.inverse=d;return Handlebars.helpers["if"].call(this,c,b)});Handlebars.registerHelper("with",function(b,a){return a.fn(b)});Handlebars.registerHelper("log",function(a){Handlebars.log(a)});var handlebars=(function(){var f={trace:function c(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,"$accept":0,"$end":1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function b(g,j,k,n,m,i,l){var h=i.length-1;switch(m){case 1:return i[h-1];break;case 2:this.$=new n.ProgramNode(i[h-2],i[h]);break;case 3:this.$=new n.ProgramNode(i[h]);break;case 4:this.$=new n.ProgramNode([]);break;case 5:this.$=[i[h]];break;case 6:i[h-1].push(i[h]);this.$=i[h-1];break;case 7:this.$=new n.InverseNode(i[h-2],i[h-1],i[h]);break;case 8:this.$=new n.BlockNode(i[h-2],i[h-1],i[h]);break;case 9:this.$=i[h];break;case 10:this.$=i[h];break;case 11:this.$=new n.ContentNode(i[h]);break;case 12:this.$=new n.CommentNode(i[h]);break;case 13:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);break;case 14:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);break;case 15:this.$=i[h-1];break;case 16:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);break;case 17:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1],true);break;case 18:this.$=new n.PartialNode(i[h-1]);break;case 19:this.$=new n.PartialNode(i[h-2],i[h-1]);break;case 20:break;case 21:this.$=[[i[h-2]].concat(i[h-1]),i[h]];break;case 22:this.$=[[i[h-1]].concat(i[h]),null];break;case 23:this.$=[[i[h-1]],i[h]];break;case 24:this.$=[[i[h]],null];break;case 25:i[h-1].push(i[h]);this.$=i[h-1];break;case 26:this.$=[i[h]];break;case 27:this.$=i[h];break;case 28:this.$=new n.StringNode(i[h]);break;case 29:this.$=new n.IntegerNode(i[h]);break;case 30:this.$=new n.BooleanNode(i[h]);break;case 31:this.$=new n.HashNode(i[h]);break;case 32:i[h-1].push(i[h]);this.$=i[h-1];break;case 33:this.$=[i[h]];break;case 34:this.$=[i[h-2],i[h]];break;case 35:this.$=[i[h-2],new n.StringNode(i[h])];break;case 36:this.$=[i[h-2],new n.IntegerNode(i[h])];break;case 37:this.$=[i[h-2],new n.BooleanNode(i[h])];break;case 38:this.$=new n.IdNode(i[h]);break;case 39:i[h-2].push(i[h]);this.$=i[h-2];break;case 40:this.$=[i[h]];break}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function d(h,g){throw new Error(h)},parse:function e(o){var x=this,l=[0],G=[null],s=[],H=this.table,h="",q=0,E=0,j=0,n=2,u=1;this.lexer.setInput(o);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined"){this.lexer.yylloc={}}var i=this.lexer.yylloc;s.push(i);if(typeof this.yy.parseError==="function"){this.parseError=this.yy.parseError}function w(p){l.length=l.length-2*p;G.length=G.length-p;s.length=s.length-p}function v(){var p;p=x.lexer.lex()||1;if(typeof p!=="number"){p=x.symbols_[p]||p}return p}var D,z,k,C,I,t,B={},y,F,g,m;while(true){k=l[l.length-1];if(this.defaultActions[k]){C=this.defaultActions[k]}else{if(D==null){D=v()}C=H[k]&&H[k][D]}if(typeof C==="undefined"||!C.length||!C[0]){if(!j){m=[];for(y in H[k]){if(this.terminals_[y]&&y>2){m.push("'"+this.terminals_[y]+"'")}}var A="";if(this.lexer.showPosition){A="Parse error on line "+(q+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+m.join(", ")+", got '"+this.terminals_[D]+"'"}else{A="Parse error on line "+(q+1)+": Unexpected "+(D==1?"end of input":"'"+(this.terminals_[D]||D)+"'")}this.parseError(A,{text:this.lexer.match,token:this.terminals_[D]||D,line:this.lexer.yylineno,loc:i,expected:m})}}if(C[0] instanceof Array&&C.length>1){throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+D)}switch(C[0]){case 1:l.push(D);G.push(this.lexer.yytext);s.push(this.lexer.yylloc);l.push(C[1]);D=null;if(!z){E=this.lexer.yyleng;h=this.lexer.yytext;q=this.lexer.yylineno;i=this.lexer.yylloc;if(j>0){j--}}else{D=z;z=null}break;case 2:F=this.productions_[C[1]][1];B.$=G[G.length-F];B._$={first_line:s[s.length-(F||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(F||1)].first_column,last_column:s[s.length-1].last_column};t=this.performAction.call(B,h,E,q,this.yy,C[1],G,s);if(typeof t!=="undefined"){return t}if(F){l=l.slice(0,-1*F*2);G=G.slice(0,-1*F);s=s.slice(0,-1*F)}l.push(this.productions_[C[1]][0]);G.push(B.$);s.push(B._$);g=H[l[l.length-2]][l[l.length-1]];l.push(g);break;case 3:return true}}return true}};var a=(function(){var j=({EOF:1,parseError:function l(o,n){if(this.yy.parseError){this.yy.parseError(o,n)}else{throw new Error(o)}},setInput:function(n){this._input=n;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var o=this._input[0];this.yytext+=o;this.yyleng++;this.match+=o;this.matched+=o;var n=o.match(/\n/);if(n){this.yylineno++}this._input=this._input.slice(1);return o},unput:function(n){this._input=n+this._input;return this},more:function(){this._more=true;return this},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;if(n.length<20){n+=this._input.substr(0,20-n.length)}return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput();var o=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+o+"^"},next:function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var r,p,o,n;if(!this._more){this.yytext="";this.match=""}var s=this._currentRules();for(var q=0;q<s.length;q++){p=this._input.match(this.rules[s[q]]);if(p){n=p[0].match(/\n.*/g);if(n){this.yylineno+=n.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+p[0].length};this.yytext+=p[0];this.match+=p[0];this.matches=p;this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(p[0].length);this.matched+=p[0];r=this.performAction.call(this,this.yy,this,s[q],this.conditionStack[this.conditionStack.length-1]);if(r){return r}else{return}}}if(this._input===""){return this.EOF}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function g(){var n=this.next();if(typeof n!=="undefined"){return n}else{return this.lex()}},begin:function h(n){this.conditionStack.push(n)},popState:function m(){return this.conditionStack.pop()},_currentRules:function k(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function h(n){this.begin(n)}});j.performAction=function i(r,o,q,n){var p=n;switch(q){case 0:if(o.yytext.slice(-1)!=="\\"){this.begin("mu")}if(o.yytext.slice(-1)==="\\"){o.yytext=o.yytext.substr(0,o.yyleng-1),this.begin("emu")}if(o.yytext){return 14}break;case 1:return 14;break;case 2:this.popState();return 14;break;case 3:return 24;break;case 4:return 16;break;case 5:return 20;break;case 6:return 19;break;case 7:return 19;break;case 8:return 23;break;case 9:return 23;break;case 10:o.yytext=o.yytext.substr(3,o.yyleng-5);this.popState();return 15;break;case 11:return 22;break;case 12:return 34;break;case 13:return 33;break;case 14:return 33;break;case 15:return 36;break;case 16:break;case 17:this.popState();return 18;break;case 18:this.popState();return 18;break;case 19:o.yytext=o.yytext.substr(1,o.yyleng-2).replace(/\\"/g,'"');return 28;break;case 20:return 30;break;case 21:return 30;break;case 22:return 29;break;case 23:return 33;break;case 24:o.yytext=o.yytext.substr(1,o.yyleng-2);return 33;break;case 25:return"INVALID";break;case 26:return 5;break}};j.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/];j.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:false},emu:{rules:[2],inclusive:false},INITIAL:{rules:[0,1,26],inclusive:true}};return j})();f.lexer=a;return f})();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=handlebars;exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)};exports.main=function commonjsMain(a){if(!a[1]){throw new Error("Usage: "+a[0]+" FILE")}if(typeof process!=="undefined"){var c=require("fs").readFileSync(require("path").join(process.cwd(),a[1]),"utf8")}else{var b=require("file").path(require("file").cwd());var c=b.join(a[1]).read({charset:"utf-8"})}return exports.parser.parse(c)};if(typeof module!=="undefined"&&require.main===module){exports.main(typeof process!=="undefined"?process.argv.slice(1):require("system").args)}}Handlebars.Parser=handlebars;Handlebars.parse=function(a){Handlebars.Parser.yy=Handlebars.AST;return Handlebars.Parser.parse(a)};Handlebars.print=function(a){return new Handlebars.PrintVisitor().accept(a)};Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(b,a){}};Handlebars.log=function(b,a){Handlebars.logger.log(b,a)};(function(){Handlebars.AST={};Handlebars.AST.ProgramNode=function(c,b){this.type="program";this.statements=c;if(b){this.inverse=new Handlebars.AST.ProgramNode(b)}};Handlebars.AST.MustacheNode=function(d,c,b){this.type="mustache";this.id=d[0];this.params=d.slice(1);this.hash=c;this.escaped=!b};Handlebars.AST.PartialNode=function(c,b){this.type="partial";this.id=c;this.context=b};var a=function(b,c){if(b.original!==c.original){throw new Handlebars.Exception(b.original+" doesn't match "+c.original)}};Handlebars.AST.BlockNode=function(c,b,d){a(c.id,d);this.type="block";this.mustache=c;this.program=b};Handlebars.AST.InverseNode=function(c,b,d){a(c.id,d);this.type="inverse";this.mustache=c;this.program=b};Handlebars.AST.ContentNode=function(b){this.type="content";this.string=b};Handlebars.AST.HashNode=function(b){this.type="hash";this.pairs=b};Handlebars.AST.IdNode=function(f){this.type="ID";this.original=f.join(".");var d=[],g=0;for(var e=0,b=f.length;e<b;e++){var c=f[e];if(c===".."){g++}else{if(c==="."||c==="this"){this.isScoped=true}else{d.push(c)}}}this.parts=d;this.string=d.join(".");this.depth=g;this.isSimple=(d.length===1)&&(g===0)};Handlebars.AST.StringNode=function(b){this.type="STRING";this.string=b};Handlebars.AST.IntegerNode=function(b){this.type="INTEGER";this.integer=b};Handlebars.AST.BooleanNode=function(b){this.type="BOOLEAN";this.bool=b};Handlebars.AST.CommentNode=function(b){this.type="comment";this.comment=b}})();Handlebars.Exception=function(b){var a=Error.prototype.constructor.apply(this,arguments);for(var c in a){if(a.hasOwnProperty(c)){this[c]=a[c]}}this.message=a.message};Handlebars.Exception.prototype=new Error;Handlebars.SafeString=function(a){this.string=a};Handlebars.SafeString.prototype.toString=function(){return this.string.toString()};(function(){var c={"<":"<",">":">",'"':""","'":"'","`":"`"};var d=/&(?!\w+;)|[<>"'`]/g;var b=/[&<>"'`]/;var a=function(e){return c[e]||"&"};Handlebars.Utils={escapeExpression:function(e){if(e instanceof Handlebars.SafeString){return e.toString()}else{if(e==null||e===false){return""}}if(!b.test(e)){return e}return e.replace(d,a)},isEmpty:function(e){if(typeof e==="undefined"){return true}else{if(e===null){return true}else{if(e===false){return true}else{if(Object.prototype.toString.call(e)==="[object Array]"&&e.length===0){return true}else{return false}}}}}}})();Handlebars.Compiler=function(){};Handlebars.JavaScriptCompiler=function(){};(function(f,e){f.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16};f.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,pushStringParam:1};f.DISASSEMBLE_MAP={};for(var h in f.OPCODE_MAP){var g=f.OPCODE_MAP[h];f.DISASSEMBLE_MAP[g]=h}f.multiParamSize=function(i){return f.MULTI_PARAM_OPCODES[f.DISASSEMBLE_MAP[i]]};f.prototype={compiler:f,disassemble:function(){var t=this.opcodes,r,n;var q=[],v,m,w;for(var s=0,o=t.length;s<o;s++){r=t[s];if(r==="DECLARE"){m=t[++s];w=t[++s];q.push("DECLARE "+m+" = "+w)}else{v=f.DISASSEMBLE_MAP[r];var u=f.multiParamSize(r);var k=[];for(var p=0;p<u;p++){n=t[++s];if(typeof n==="string"){n='"'+n.replace("\n","\\n")+'"'}k.push(n)}v=v+" "+k.join(" ");q.push(v)}}return q.join("\n")},guid:0,compile:function(i,k){this.children=[];this.depths={list:[]};this.options=k;var l=this.options.knownHelpers;this.options.knownHelpers={helperMissing:true,blockHelperMissing:true,each:true,"if":true,unless:true,"with":true,log:true};if(l){for(var j in l){this.options.knownHelpers[j]=l[j]}}return this.program(i)},accept:function(i){return this[i.type](i)},program:function(m){var k=m.statements,o;this.opcodes=[];for(var n=0,j=k.length;n<j;n++){o=k[n];this[o.type](o)}this.isSimple=j===1;this.depths.list=this.depths.list.sort(function(l,i){return l-i});return this},compileProgram:function(m){var j=new this.compiler().compile(m,this.options);var n=this.guid++;this.usePartial=this.usePartial||j.usePartial;this.children[n]=j;for(var o=0,k=j.depths.list.length;o<k;o++){depth=j.depths.list[o];if(depth<2){continue}else{this.addDepth(depth-1)}}return n},block:function(o){var l=o.mustache;var n,p,j,k;var m=this.setupStackForMustache(l);var i=this.compileProgram(o.program);if(o.program.inverse){k=this.compileProgram(o.program.inverse);this.declare("inverse",k)}this.opcode("invokeProgram",i,m.length,!!l.hash);this.declare("inverse",null);this.opcode("append")},inverse:function(k){var j=this.setupStackForMustache(k.mustache);var i=this.compileProgram(k.program);this.declare("inverse",i);this.opcode("invokeProgram",null,j.length,!!k.mustache.hash);this.declare("inverse",null);this.opcode("append")},hash:function(n){var m=n.pairs,p,o;this.opcode("push","{}");for(var k=0,j=m.length;k<j;k++){p=m[k];o=p[1];this.accept(o);this.opcode("assignToHash",p[0])}},partial:function(i){var j=i.id;this.usePartial=true;if(i.context){this.ID(i.context)}else{this.opcode("push","depth0")}this.opcode("invokePartial",j.original);this.opcode("append")},content:function(i){this.opcode("appendContent",i.string)},mustache:function(i){var j=this.setupStackForMustache(i);this.opcode("invokeMustache",j.length,i.id.original,!!i.hash);if(i.escaped&&!this.options.noEscape){this.opcode("appendEscaped")}else{this.opcode("append")}},ID:function(m){this.addDepth(m.depth);this.opcode("getContext",m.depth);this.opcode("lookupWithHelpers",m.parts[0]||null,m.isScoped||false);for(var k=1,j=m.parts.length;k<j;k++){this.opcode("lookup",m.parts[k])}},STRING:function(i){this.opcode("pushString",i.string)},INTEGER:function(i){this.opcode("push",i.integer)},BOOLEAN:function(i){this.opcode("push",i.bool)},comment:function(){},pushParams:function(l){var j=l.length,k;while(j--){k=l[j];if(this.options.stringParams){if(k.depth){this.addDepth(k.depth)}this.opcode("getContext",k.depth||0);this.opcode("pushStringParam",k.string)}else{this[k.type](k)}}},opcode:function(i,l,k,j){this.opcodes.push(f.OPCODE_MAP[i]);if(l!==undefined){this.opcodes.push(l)}if(k!==undefined){this.opcodes.push(k)}if(j!==undefined){this.opcodes.push(j)}},declare:function(i,j){this.opcodes.push("DECLARE");this.opcodes.push(i);this.opcodes.push(j)},addDepth:function(i){if(i===0){return}if(!this.depths[i]){this.depths[i]=true;this.depths.list.push(i)}},setupStackForMustache:function(i){var j=i.params;this.pushParams(j);if(i.hash){this.hash(i.hash)}this.ID(i.id);return j}};e.prototype={nameLookup:function(k,i,j){if(/^[0-9]+$/.test(i)){return k+"["+i+"]"}else{if(e.isValidJavaScriptVariableName(i)){return k+"."+i}else{return k+"['"+i+"']"}}},appendToBuffer:function(i){if(this.environment.isSimple){return"return "+i+";"}else{return"buffer += "+i+";"}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(i,j,l,k){this.environment=i;this.options=j||{};this.name=this.environment.name;this.isChild=!!l;this.context=l||{programs:[],aliases:{self:"this"},registers:{list:[]}};this.preamble();this.stackSlot=0;this.stackVars=[];this.compileChildren(i,j);var n=i.opcodes,m;this.i=0;for(b=n.length;this.i<b;this.i++){m=this.nextOpcode(0);if(m[0]==="DECLARE"){this.i=this.i+2;this[m[1]]=m[2]}else{this.i=this.i+m[1].length;this[m[0]].apply(this,m[1])}}return this.createFunctionContext(k)},nextOpcode:function(r){var o=this.environment.opcodes,m=o[this.i+r],l,p;var q,i;if(m==="DECLARE"){l=o[this.i+1];p=o[this.i+2];return["DECLARE",l,p]}else{l=f.DISASSEMBLE_MAP[m];q=f.multiParamSize(m);i=[];for(var k=0;k<q;k++){i.push(o[this.i+k+1+r])}return[l,i]}},eat:function(i){this.i=this.i+i.length},preamble:function(){var i=[];this.useRegister("foundHelper");if(!this.isChild){var j=this.namespace;var k="helpers = helpers || "+j+".helpers;";if(this.environment.usePartial){k=k+" partials = partials || "+j+".partials;"}i.push(k)}else{i.push("")}if(!this.environment.isSimple){i.push(", buffer = "+this.initializeBuffer())}else{i.push("")}this.lastContext=0;this.source=i},createFunctionContext:function(p){var q=this.stackVars;if(!this.isChild){q=q.concat(this.context.registers.list)}if(q.length>0){this.source[1]=this.source[1]+", "+q.join(", ")}if(!this.isChild){var k=[];for(var o in this.context.aliases){this.source[1]=this.source[1]+", "+o+"="+this.context.aliases[o]}}if(this.source[1]){this.source[1]="var "+this.source[1].substring(2)+";"}if(!this.isChild){this.source[1]+="\n"+this.context.programs.join("\n")+"\n"}if(!this.environment.isSimple){this.source.push("return buffer;")}var r=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var n=0,j=this.environment.depths.list.length;n<j;n++){r.push("depth"+this.environment.depths.list[n])}if(p){r.push(this.source.join("\n "));return Function.apply(this,r)}else{var m="function "+(this.name||"")+"("+r.join(",")+") {\n "+this.source.join("\n ")+"}";Handlebars.log(Handlebars.logger.DEBUG,m+"\n\n");return m}},appendContent:function(i){this.source.push(this.appendToBuffer(this.quotedString(i)))},append:function(){var i=this.popStack();this.source.push("if("+i+" || "+i+" === 0) { "+this.appendToBuffer(i)+" }");if(this.environment.isSimple){this.source.push("else { "+this.appendToBuffer("''")+" }")}},appendEscaped:function(){var j=this.nextOpcode(1),i="";this.context.aliases.escapeExpression="this.escapeExpression";if(j[0]==="appendContent"){i=" + "+this.quotedString(j[1][0]);this.eat(j)}this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+i))},getContext:function(i){if(this.lastContext!==i){this.lastContext=i}},lookupWithHelpers:function(k,l){if(k){var i=this.nextStack();this.usingKnownHelper=false;var j;if(!l&&this.options.knownHelpers[k]){j=i+" = "+this.nameLookup("helpers",k,"helper");this.usingKnownHelper=true}else{if(l||this.options.knownHelpersOnly){j=i+" = "+this.nameLookup("depth"+this.lastContext,k,"context")}else{this.register("foundHelper",this.nameLookup("helpers",k,"helper"));j=i+" = foundHelper || "+this.nameLookup("depth"+this.lastContext,k,"context")}}j+=";";this.source.push(j)}else{this.pushStack("depth"+this.lastContext)}},lookup:function(j){var i=this.topStack();this.source.push(i+" = ("+i+" === null || "+i+" === undefined || "+i+" === false ? "+i+" : "+this.nameLookup(i,j,"context")+");")},pushStringParam:function(i){this.pushStack("depth"+this.lastContext);this.pushString(i)},pushString:function(i){this.pushStack(this.quotedString(i))},push:function(i){this.pushStack(i)},invokeMustache:function(k,j,i){this.populateParams(k,this.quotedString(j),"{}",null,i,function(l,n,m){if(!this.usingKnownHelper){this.context.aliases.helperMissing="helpers.helperMissing";this.context.aliases.undef="void 0";this.source.push("else if("+m+"=== undef) { "+l+" = helperMissing.call("+n+"); }");if(l!==m){this.source.push("else { "+l+" = "+m+"; }")}}})},invokeProgram:function(k,l,j){var i=this.programExpression(this.inverse);var m=this.programExpression(k);this.populateParams(l,null,m,i,j,function(n,p,o){if(!this.usingKnownHelper){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";this.source.push("else { "+n+" = blockHelperMissing.call("+p+"); }")}})},populateParams:function(p,k,t,q,x,w){var l=x||this.options.stringParams||q||this.options.data;var j=this.popStack(),v;var n=[],m,o,u;if(l){this.register("tmp1",t);u="tmp1"}else{u="{ hash: {} }"}if(l){var s=(x?this.popStack():"{}");this.source.push("tmp1.hash = "+s+";")}if(this.options.stringParams){this.source.push("tmp1.contexts = [];")}for(var r=0;r<p;r++){m=this.popStack();n.push(m);if(this.options.stringParams){this.source.push("tmp1.contexts.push("+this.popStack()+");")}}if(q){this.source.push("tmp1.fn = tmp1;");this.source.push("tmp1.inverse = "+q+";")}if(this.options.data){this.source.push("tmp1.data = data;")}n.push(u);this.populateCall(n,j,k||j,w,t!=="{}")},populateCall:function(n,j,k,q,o){var m=["depth0"].concat(n).join(", ");var i=["depth0"].concat(k).concat(n).join(", ");var p=this.nextStack();if(this.usingKnownHelper){this.source.push(p+" = "+j+".call("+m+");")}else{this.context.aliases.functionType='"function"';var l=o?"foundHelper && ":"";this.source.push("if("+l+"typeof "+j+" === functionType) { "+p+" = "+j+".call("+m+"); }")}q.call(this,p,i,j);this.usingKnownHelper=false},invokePartial:function(i){params=[this.nameLookup("partials",i,"partial"),"'"+i+"'",this.popStack(),"helpers","partials"];if(this.options.data){params.push("data")}this.pushStack("self.invokePartial("+params.join(", ")+");")},assignToHash:function(i){var j=this.popStack();var k=this.topStack();this.source.push(k+"['"+i+"'] = "+j+";")},compiler:e,compileChildren:function(j,n){var p=j.children,r,q;for(var o=0,k=p.length;o<k;o++){r=p[o];q=new this.compiler();this.context.programs.push("");var m=this.context.programs.length;r.index=m;r.name="program"+m;this.context.programs[m]=q.compile(r,n,this.context)}},programExpression:function(k){if(k==null){return"self.noop"}var p=this.environment.children[k],o=p.depths.list;var n=[p.index,p.name,"data"];for(var m=0,j=o.length;m<j;m++){depth=o[m];if(depth===1){n.push("depth0")}else{n.push("depth"+(depth-1))}}if(o.length===0){return"self.program("+n.join(", ")+")"}else{n.shift();return"self.programWithDepth("+n.join(", ")+")"}},register:function(i,j){this.useRegister(i);this.source.push(i+" = "+j+";")},useRegister:function(i){if(!this.context.registers[i]){this.context.registers[i]=true;this.context.registers.list.push(i)}},pushStack:function(i){this.source.push(this.nextStack()+" = "+i+";");return"stack"+this.stackSlot},nextStack:function(){this.stackSlot++;if(this.stackSlot>this.stackVars.length){this.stackVars.push("stack"+this.stackSlot)}return"stack"+this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var a=("break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield").split(" ");var d=e.RESERVED_WORDS={};for(var c=0,b=a.length;c<b;c++){d[a[c]]=true}e.isValidJavaScriptVariableName=function(i){if(!e.RESERVED_WORDS[i]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(i)){return true}return false}})(Handlebars.Compiler,Handlebars.JavaScriptCompiler);Handlebars.precompile=function(d,c){c=c||{};var b=Handlebars.parse(d);var a=new Handlebars.Compiler().compile(b,c);return new Handlebars.JavaScriptCompiler().compile(a,c)};Handlebars.compile=function(b,a){a=a||{};var d;function c(){var g=Handlebars.parse(b);var f=new Handlebars.Compiler().compile(g,a);var e=new Handlebars.JavaScriptCompiler().compile(f,a,undefined,true);return Handlebars.template(e)}return function(f,e){if(!d){d=c()}return d.call(this,f,e)}};Handlebars.VM={template:function(a){var b={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(d,e,f){var c=this.programs[d];if(f){return Handlebars.VM.program(e,f)}else{if(c){return c}else{c=this.programs[d]=Handlebars.VM.program(e);return c}}},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(d,c){c=c||{};return a.call(b,Handlebars,d,c.helpers,c.partials,c.data)}},programWithDepth:function(b,d,c){var a=Array.prototype.slice.call(arguments,2);return function(f,e){e=e||{};return b.apply(this,[f,e.data||d].concat(a))}},program:function(a,b){return function(d,c){c=c||{};return a(d,c.data||b)}},noop:function(){return""},invokePartial:function(a,b,d,e,c,f){options={helpers:e,partials:c,data:f};if(a===undefined){throw new Handlebars.Exception("The partial "+b+" could not be found")}else{if(a instanceof Function){return a(d,options)}else{if(!Handlebars.compile){throw new Handlebars.Exception("The partial "+b+" could not be compiled when running in runtime-only mode")}else{c[b]=Handlebars.compile(a);return c[b](d,options)}}}}};Handlebars.template=Handlebars.VM.template;
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/mvc/annotations.js
--- /dev/null
+++ b/static/scripts/packed/mvc/annotations.js
@@ -0,0 +1,1 @@
+var Annotation=BaseModel.extend(LoggableMixin).extend({logger:console,toString:function(){return"Annotation()"}});var AnnotationView=BaseView.extend(LoggableMixin).extend({logger:console,toString:function(){return"AnnotationView()"}});
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/mvc/base-mvc.js
--- /dev/null
+++ b/static/scripts/packed/mvc/base-mvc.js
@@ -0,0 +1,1 @@
+var BaseModel=Backbone.RelationalModel.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var BaseView=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){if(this.model.attributes.hidden){this.$el.hide()}else{this.$el.show()}}});var LoggableMixin={logger:null,log:function(){return(this.logger)?(this.logger.log.apply(this,arguments)):(undefined)}};var TemplateLoader=_.extend({},LoggableMixin,{getTemplateLoadFn:function(){throw ("There is no templateLoadFn. Make sure you're using a subclass of TemplateLoader")},getTemplates:function(d,e){e=e||false;this.log(this,"getTemplates:",d,", forceReload:",e);var c={},a=this,b=this.getTemplateLoadFn();if(!d){return c}jQuery.each(d,function(f,g){jQuery.each(g,function(h,i){a.log(a+", templateFile:",f,"templateName:",h,", templateID:",i);c[h]=b.call(a,f,h,i)})});return c}});var CompiledTemplateLoader=_.extend({},TemplateLoader,{getTemplateLoadFn:function(){return this.loadCompiledHandlebarsTemplate},loadCompiledHandlebarsTemplate:function(b,a,c){this.log("getInDomTemplates, templateFile:",b,"templateName:",a,", templateID:",c);if(!Handlebars.templates||!Handlebars.templates[c]){throw ("Template not found: Handlebars."+c+". Check your h.templates() call in the mako file that rendered this page")}this.log("found template function:",c);return Handlebars.templates[c]}});var InDomTemplateLoader=_.extend({},TemplateLoader,{compileTemplate:function(a){if(!Handlebars||!Handlebars.compile){throw ("No Handlebars.compile found. You may only have Handlebars.runtime loaded.Include handlebars.full for this to work")}this.log("compiling template:",a);return Handlebars.compile(a)},findTemplateInDom:function(b,a,c){return $("script#"+c).last()},getTemplateLoadFn:function(){return this.loadInDomTemplate},loadInDomTemplate:function(b,a,c){this.log("getInDomTemplate, templateFile:",b,"templateName:",a,", templateID:",c);var d=this.findTemplateInDom(b,a,c);if(!d||!d.length){throw ("Template not found within the DOM: "+c+". Check that this template has been included in the page")}this.log("found template in dom:",d.html());return this.compileTemplate(d.html())}});var RemoteTemplateLoader=_.extend({},InDomTemplateLoader,{templateBaseURL:"static/scripts/templates/",getTemplateLoadFn:function(){return this.loadViaHttpGet},loadViaHttpGet:function(d,c,f){var b="static/scripts/templates/";this.log("loadViaHttpGet, templateFile:",d,"templateName:",c,", templateID:",f,"templateBaseURL:",this.templateBaseURL);var h=null;try{h=this.loadInDomTemplate(d,c,f)}catch(g){this.log("getInDomTemplate exception:"+g);if(!Handlebars.compile){throw (g)}this.log("Couldn't locate template in DOM: "+f);var a=this;var e=b+d;jQuery.ajax(e,{method:"GET",async:false,success:function(i){a.log(d+" loaded via GET. Attempting compile...");$("body").append(i);h=a.loadInDomTemplate(d,c,f)},error:function(j,i,k){throw ("Failed to fetch "+e+":"+i)}})}if(!h){throw ("Couldn't load or fetch template: "+f)}return h}});
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/mvc/history.js
--- a/static/scripts/packed/mvc/history.js
+++ b/static/scripts/packed/mvc/history.js
@@ -1,1 +1,1 @@
-function linkHTMLTemplate(b,a){if(!b){return"<a></a>"}a=a||"a";var c=["<"+a];for(key in b){var d=b[key];if(d===""){continue}switch(key){case"text":continue;case"classes":key="class";d=(b.classes.join)?(b.classes.join(" ")):(b.classes);default:c.push([" ",key,'="',d,'"'].join(""))}}c.push(">");if("text" in b){c.push(b.text)}c.push("</"+a+">");return c.join("")}var HistoryItem=BaseModel.extend(LoggableMixin).extend({defaults:{id:null,name:"",data_type:null,file_size:0,genome_build:null,metadata_data_lines:0,metadata_dbkey:null,metadata_sequences:0,misc_blurb:"",misc_info:"",model_class:"",state:"",deleted:false,purged:false,visible:true,for_editing:true,bodyIsShown:false},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"))},isEditable:function(){return(!(this.get("deleted")||this.get("purged")))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a+=':"'+this.get("name")+'"'}return"HistoryItem("+a+")"}});HistoryItem.STATES={NEW:"new",UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",OK:"ok",EMPTY:"empty",ERROR:"error",DISCARDED:"discarded",SETTING_METADATA:"setting_metadata",FAILED_METADATA:"failed_metadata"};var HistoryItemView=BaseView.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(){this.log(this+".initialize:",this,this.model)},render:function(){this.log(this+".model:",this.model);var d=this.model.get("id"),c=this.model.get("state");this.$el.attr("id","historyItemContainer-"+d);var a=$("<div/>").attr("id","historyItem-"+d).addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);a.find(".tooltip").tooltip({placement:"bottom"});var b=a.find("[popupmenu]");b.each(function(e,f){f=$(f);make_popupmenu(f)});this.$el.children().remove();return this.$el.append(a)},_render_warnings:function(){return $(jQuery.trim(HistoryItemView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>'),b=this.model.get("for_editing");if(this.model.get("state")!==HistoryItem.STATES.UPLOAD){a.append(this._render_displayButton());if(b){a.append(this._render_editButton())}}if(b){a.append(this._render_deleteButton())}return a},_render_displayButton:function(){displayBtnData=(this.model.get("purged"))?({title:"Cannot display datasets removed from disk",icon_class:"display",enabled:false,}):({title:"Display data in browser",href:this.model.get("display_url"),target:(this.model.get("for_editing"))?("galaxy_main"):(null),icon_class:"display",});this.displayButton=new IconButtonView({model:new IconButton(displayBtnData)});return this.displayButton.render().$el},_render_editButton:function(){var d=this.model.get("id"),c=this.model.get("purged"),a=this.model.get("deleted");var b={title:"Edit attributes",href:this.model.get("edit_url"),target:"galaxy_main",icon_class:"edit"};if(a||c){b={enabled:false,icon_class:"edit"};b.title=(!c)?("Undelete dataset to edit attributes"):("Cannot edit attributes of datasets removed from disk")}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if(!this.model.get("for_editing")){return null}var a=(this.model.get("delete_url"))?({title:"Delete",href:this.model.get("delete_url"),target:"galaxy_main",id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete"}):({title:"Dataset is already deleted",icon_class:"delete",enabled:false});this.deleteButton=new IconButtonView({model:new IconButton(a)});return this.deleteButton.render().$el},_render_titleLink:function(){var b=this.model.get("name"),a=this.model.get("hid");title=(a+": "+b);return $(linkHTMLTemplate({href:"javascript:void(0);",text:'<span class="historyItemTitle">'+title+"</span>"}))},_render_body_not_viewable:function(a){a.append($("<div>You do not have permission to view dataset.</div>"))},_render_body_uploading:function(a){a.append($("<div>Dataset is uploading</div>"))},_render_body_queued:function(a){a.append($("<div>Job is waiting to run.</div>"));a.append(this._render_showParamsAndRerun())},_render_body_running:function(a){a.append("<div>Job is currently running.</div>");a.append(this._render_showParamsAndRerun())},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append(("An error occurred running this job: <i>"+$.trim(this.model.get("misc_info"))+"</i>"));var b=$(this._render_showParamsAndRerun());if(this.model.get("for_editing")){b.prepend($(linkHTMLTemplate({title:"View or report this error",href:this.model.get("report_errors_url"),target:"galaxy_main",classes:["icon-button","tooltip","bug"]})))}if(this.model.hasData()){b.prepend(this._render_downloadLinks())}a.append(b)},_render_body_discarded:function(a){a.append("<div>The job creating this dataset was cancelled before completion.</div>");a.append(this._render_showParamsAndRerun())},_render_body_setting_metadata:function(a){a.append($("<div>Metadata is being auto-detected.</div>"))},_render_body_empty:function(a){a.append($("<div>No data: <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_showParamsAndRerun())},_render_body_failed_metadata:function(b){var c="An error occurred setting the metadata for this dataset.";if(this.model.isEditable()){var a=linkHTMLTemplate({text:"set it manually or retry auto-detection",href:this.model.get("edit_url"),target:"galaxy_main"});c+="You may be able to "+a+"."}b.append($(HistoryItemView.templates.warningMsg({warning:c})));this._render_body_ok(b)},_render_body_ok:function(h){h.append(this._render_hdaSummary());if(this.model.get("misc_info")){h.append($('<div class="info">Info: '+this.model.get("misc_info")+"</div>"))}if(this.model.hasData()){var c=$("<div/>");c.append(this._render_downloadLinks());c.append($(linkHTMLTemplate({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",classes:["icon-button","tooltip","information"]})));if(this.model.get("for_editing")){c.append($(linkHTMLTemplate({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",classes:["icon-button","tooltip","arrow-circle"]})));if(this.model.get("trackster_urls")){var a=this.model.get("trackster_urls");c.append($(linkHTMLTemplate({title:"View in Trackster",href:"javascript:void(0)",classes:["icon-button","tooltip","chart_curve","trackster-add"],"data-url":a["data-url"],"action-url":a["action-url"],"new-url":a["new-url"]})))}if(this.model.get("retag_url")&&this.model.get("annotate_url")){var d=$('<div style="float: right;"></div>');d.append($(linkHTMLTemplate({title:"Edit dataset tags",target:"galaxy_main",href:this.model.get("retag_url"),classes:["icon-button","tooltip","tags"]})));d.append($(linkHTMLTemplate({title:"Edit dataset annotation",target:"galaxy_main",href:this.model.get("annotation_url"),classes:["icon-button","tooltip","annotate"]})));c.append(d);c.append('<div style="clear: both"></div>');this.tagArea=$('<div class="tag-area" style="display: none">');this.tagArea.append("<strong>Tags:</strong>");this.tagElt=$('<div class="tag-elt"></div>');c.append(this.tagArea.append(this.tagElt));var e=$(('<div id="${dataset_id}-annotation-area" class="annotation-area" style="display: none">'));this.annotationArea=e;e.append("<strong>Annotation:</strong>");this.annotationElem=$('<div id="'+this.model.get("id")+'-annotation-elt" style="margin: 1px 0px 1px 0px" class="annotation-elt tooltip editable-text" title="Edit dataset annotation"></div>');e.append(this.annotationElem);c.append(e)}}c.append('<div style="clear: both;"></div>');h.append(c);var i=$("<div/>");if(this.model.get("display_apps")){var j=this.model.get("display_apps"),b=$("<span/>");for(app_name in j){var g=j[app_name],f=app_name+" ";for(location_name in g){f+=linkHTMLTemplate({text:location_name,href:g[location_name].url,target:g[location_name].target})+" "}b.append(f)}i.append(b)}h.append(i)}else{if(this.model.get("for_editing")){h.append(this._render_showParamsAndRerun())}}h.append(this._render_peek())},_render_body:function(){var b=this.model.get("state"),c=this.model.get("for_editing");var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: block");switch(b){case HistoryItem.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryItem.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryItem.STATES.QUEUED:this._render_body_queued(a);break;case HistoryItem.STATES.RUNNING:this._render_body_running(a);break;case HistoryItem.STATES.ERROR:this._render_body_error(a);break;case HistoryItem.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryItem.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryItem.STATES.EMPTY:this._render_body_empty(a);break;case HistoryItem.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryItem.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+b+'".</div>'))}a.append('<div style="clear: both"></div>');if(this.model.get("bodyIsShown")===false){a.hide()}return a},_render_hdaSummary:function(){var a=_.template('<span class="<%= dbkey %>"><%= dbkey %></span>',{dbkey:this.model.get("metadata_dbkey")});if(this.model.get("metadata_dbkey")==="?"&&this.model.isEditable()){a=linkHTMLTemplate({text:this.model.get("metadata_dbkey"),href:this.model.get("edit_url"),target:"galaxy_main"})}return(HistoryItemView.TEMPLATES.hdaSummary(_.extend({dbkeyHTML:a},this.model.attributes)))},_render_showParamsAndRerun:function(){var a=$("<div/>");a.append($(linkHTMLTemplate({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",classes:["icon-button","tooltip","information"]})));if(this.model.get("for_editing")){a.append($(linkHTMLTemplate({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",classes:["icon-button","tooltip","arrow-circle"]})))}return a},_render_downloadLinks:function(){if(this.model.get("purged")){return null}var a=linkHTMLTemplate({title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]});var d=this.model.get("download_meta_urls");if(!d){return a}var c=$('<div popupmenu="dataset-'+this.model.get("id")+'-popup"></div>');c.append(linkHTMLTemplate({text:"Download Dataset",title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]}));c.append("<a>Additional Files</a>");for(file_type in d){c.append(linkHTMLTemplate({text:"Download "+file_type,href:d[file_type],classes:["action-button"]}))}var b=$(('<div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup"></div>'));b.append(a);c.append(b);return c},_render_peek:function(){if(!this.model.get("peek")){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(b){this.log(this,".loadAndDisplayTags",b);var c=this.tagArea;var a=this.tagElt;if(c.is(":hidden")){if(!a.html()){$.ajax({url:this.model.get("ajax_get_tag_url"),error:function(){alert("Tagging failed")},success:function(d){this.log("tag_elt_html:",d);a.html(d);a.find(".tooltip").tooltip();c.slideDown("fast")}})}else{c.slideDown("fast")}}else{c.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this,".loadAndDisplayAnnotation",b);var d=this.annotationArea,c=this.annotationElem,a=this.model.get("ajax_set_annotation_url");this.log("annotationArea hidden:",d.is(":hidden"));this.log("annotationElem html:",c.html());if(d.is(":hidden")){if(!c.html()){$.ajax({url:this.model.get("ajax_get_annotation_url"),error:function(){alert("Annotations failed")},success:function(e){if(e===""){e="<em>Describe or add notes to dataset</em>"}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toggleBodyVisibility:function(){this.log(this+".toggleBodyVisibility");this.$el.find(".historyItemBody").toggle()},toString:function(){var a=(this.model)?(this.model+""):("");return"HistoryItemView("+a+")"}});HistoryItemView.TEMPLATES={};HistoryItemView.TEMPLATES.hdaSummary=_.template(["<%= misc_blurb %><br />",'format: <span class="<%= data_type %>"><%= data_type %></span>, ',"database: <%= dbkeyHTML %>"].join(""));HistoryItemView.templates=CompiledTemplateLoader.getTemplates({"common-templates.html":{warningMsg:"template-warningmessagesmall",},"history-templates.html":{messages:"template-history-warning-messages2",hdaSummary:"template-history-hdaSummary"}});var HistoryCollection=Backbone.Collection.extend({model:HistoryItem,toString:function(){return("HistoryCollection()")}});var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",state_details:{discarded:0,empty:0,error:0,failed_metadata:0,ok:0,queued:0,running:0,setting_metadata:0,upload:0}},initialize:function(b,a){this.log(this+".initialize",b,a);this.items=new HistoryCollection()},loadDatasetsAsHistoryItems:function(c){var a=this,b=this.get("id"),d=this.get("state_details");_.each(c,function(f,e){a.log("loading dataset: ",f,e);var h=new HistoryItem(_.extend(f,{history_id:b}));a.log("as History:",h);a.items.add(h);var g=f.state;d[g]+=1});this.set("state_details",d);this._stateFromStateDetails();return this},_stateFromStateDetails:function(){this.set("state","");var a=this.get("state_details");if((a.error>0)||(a.failed_metadata>0)){this.set("state",HistoryItem.STATES.ERROR)}else{if((a.running>0)||(a.setting_metadata>0)){this.set("state",HistoryItem.STATES.RUNNING)}else{if(a.queued>0){this.set("state",HistoryItem.STATES.QUEUED)}else{if(a.ok===this.items.length){this.set("state",HistoryItem.STATES.OK)}else{throw ("_stateFromStateDetails: unable to determine history state from state details: "+this.state_details)}}}}return this},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});var HistoryView=BaseView.extend(LoggableMixin).extend({el:"body.historyPage",initialize:function(){this.log(this+".initialize");this.itemViews=[];var a=this;this.model.items.each(function(c){var b=new HistoryItemView({model:c});a.itemViews.push(b)})},render:function(){this.log(this+".render");var a=$("<div/>");_.each(this.itemViews,function(b){a.prepend(b.render())});this.$el.append(a.children());a.remove()},toString:function(){var a=this.model.get("name")||"";return"HistoryView("+a+")"}});function createMockHistoryData(){mockHistory={};mockHistory.data={template:{id:"a799d38679e985db",name:"template",data_type:"fastq",file_size:226297533,genome_build:"?",metadata_data_lines:0,metadata_dbkey:"?",metadata_sequences:0,misc_blurb:"215.8 MB",misc_info:"uploaded fastq file",model_class:"HistoryDatasetAssociation",download_url:"",state:"ok",visible:true,deleted:false,purged:false,hid:0,for_editing:true,undelete_url:"example.com/undelete",purge_url:"example.com/purge",unhide_url:"example.com/unhide",display_url:"example.com/display",edit_url:"example.com/edit",delete_url:"example.com/delete",show_params_url:"example.com/show_params",rerun_url:"example.com/rerun",retag_url:"example.com/retag",annotate_url:"example.com/annotate",peek:['<table cellspacing="0" cellpadding="3"><tr><th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th><th>5.MAPQ</th><th>6.CIGAR</th><th>7.MRNM</th><th>8.MPOS</th><th>9.ISIZE</th><th>10.SEQ</th><th>11.QUAL</th><th>12.OPT</th></tr>','<tr><td colspan="100%">@SQ SN:gi|87159884|ref|NC_007793.1| LN:2872769</td></tr>','<tr><td colspan="100%">@PG ID:bwa PN:bwa VN:0.5.9-r16</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 73 gi|87159884|ref|NC_007793.1| 2720169 37 101M = 2720169 0 NAATATGACATTATTTTCAAAACAGCTGAAAATTTAGACGTACCGATTTATCTACATCCCGCGCCAGTTAACAGTGACATTTATCAATCATACTATAAAGG !!!!!!!!!!$!!!$!!!!!$!!!!!!$!$!$$$!!$!!$!!!!!!!!!!!$!</td></tr>','<tr><td colspan="100%">!!!$!$!$$!!$$!!$!!!!!!!!!!!!!!!!!!!!!!!!!!$!!$!! XT:A:U NM:i:1 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:0A100</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 133 gi|87159884|ref|NC_007793.1| 2720169 0 * = 2720169 0 NAAACTGTGGCTTCGTTNNNNNNNNNNNNNNNGTGANNNNNNNNNNNNNNNNNNNGNNNNNNNNNNNNNNNNNNNNCNAANNNNNNNNNNNNNNNNNNNNN !!!!!!!!!!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>','<tr><td colspan="100%">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',"</table>"].join("")}};_.extend(mockHistory.data,{deleted:_.extend(_.clone(mockHistory.data.template),{deleted:true}),purgedNotDeleted:_.extend(_.clone(mockHistory.data.template),{purged:true}),notvisible:_.extend(_.clone(mockHistory.data.template),{visible:false}),hasDisplayApps:_.extend(_.clone(mockHistory.data.template),{display_apps:{"display in IGB":{Web:"/display_application/63cd3858d057a6d1/igb_bam/Web",Local:"/display_application/63cd3858d057a6d1/igb_bam/Local"}}}),canTrackster:_.extend(_.clone(mockHistory.data.template),{trackster_urls:{"data-url":"example.com/trackster-data","action-url":"example.com/trackster-action","new-url":"example.com/trackster-new"}}),zeroSize:_.extend(_.clone(mockHistory.data.template),{file_size:0}),hasMetafiles:_.extend(_.clone(mockHistory.data.template),{download_meta_urls:{bam_index:"example.com/bam-index"}}),upload:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.UPLOAD}),queued:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.QUEUED}),running:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.RUNNING}),empty:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.EMPTY}),error:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.ERROR}),discarded:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.DISCARDED}),setting_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.SETTING_METADATA}),failed_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.FAILED_METADATA})});$(document).ready(function(){mockHistory.items={};mockHistory.views={};for(key in mockHistory.data){mockHistory.items[key]=new HistoryItem(mockHistory.data[key]);mockHistory.items[key].set("name",key);mockHistory.views[key]=new HistoryItemView({model:mockHistory.items[key]});$("body").append(mockHistory.views[key].render())}})};
\ No newline at end of file
+function linkHTMLTemplate(b,a){if(!b){return"<a></a>"}a=a||"a";var c=["<"+a];for(key in b){var d=b[key];if(d===""){continue}switch(key){case"text":continue;case"classes":key="class";d=(b.classes.join)?(b.classes.join(" ")):(b.classes);default:c.push([" ",key,'="',d,'"'].join(""))}}c.push(">");if("text" in b){c.push(b.text)}c.push("</"+a+">");return c.join("")}var HistoryItem=BaseModel.extend(LoggableMixin).extend({defaults:{id:null,name:"",data_type:null,file_size:0,genome_build:null,metadata_data_lines:0,metadata_dbkey:null,metadata_sequences:0,misc_blurb:"",misc_info:"",model_class:"",state:"",deleted:false,purged:false,visible:true,for_editing:true,bodyIsShown:false},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"))},isEditable:function(){return(!(this.get("deleted")||this.get("purged")))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a+=':"'+this.get("name")+'"'}return"HistoryItem("+a+")"}});HistoryItem.STATES={NEW:"new",UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",OK:"ok",EMPTY:"empty",ERROR:"error",DISCARDED:"discarded",SETTING_METADATA:"setting_metadata",FAILED_METADATA:"failed_metadata"};var HistoryItemView=BaseView.extend(LoggableMixin).extend({logger:console,tagName:"div",className:"historyItemContainer",initialize:function(){this.log(this+".initialize:",this,this.model)},render:function(){this.log(this+".model:",this.model);var d=this.model.get("id"),c=this.model.get("state");this.clearReferences();this.$el.attr("id","historyItemContainer-"+d);var a=$("<div/>").attr("id","historyItem-"+d).addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);a.find(".tooltip").tooltip({placement:"bottom"});var b=a.find("[popupmenu]");b.each(function(e,f){f=$(f);make_popupmenu(f)});this.$el.children().remove();return this.$el.append(a)},clearReferences:function(){this.displayButton=null;this.editButton=null;this.deleteButton=null;this.errButton=null},_render_warnings:function(){return $(jQuery.trim(HistoryItemView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_displayButton:function(){if(this.model.get("state")===HistoryItem.STATES.UPLOAD){return null}displayBtnData=(this.model.get("purged"))?({title:"Cannot display datasets removed from disk",enabled:false,icon_class:"display",}):({title:"Display data in browser",href:this.model.get("display_url"),target:(this.model.get("for_editing"))?("galaxy_main"):(null),icon_class:"display",});this.displayButton=new IconButtonView({model:new IconButton(displayBtnData)});return this.displayButton.render().$el},_render_editButton:function(){if((this.model.get("state")===HistoryItem.STATES.UPLOAD)||(!this.model.get("for_editing"))){return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:"Edit attributes",href:this.model.get("edit_url"),target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false}if(a){b.title="Undelete dataset to edit attributes"}else{if(c){b.title="Cannot edit attributes of datasets removed from disk"}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if(!this.model.get("for_editing")){return null}var a=(this.model.get("delete_url"))?({title:"Delete",href:this.model.get("delete_url"),target:"galaxy_main",id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete"}):({title:"Dataset is already deleted",icon_class:"delete",enabled:false});this.deleteButton=new IconButtonView({model:new IconButton(a)});return this.deleteButton.render().$el},_render_titleLink:function(){this.log("model:",this.model.toJSON());return $(jQuery.trim(HistoryItemView.templates.titleLink(this.model.toJSON())))},_render_body_not_viewable:function(a){a.append($("<div>You do not have permission to view dataset.</div>"))},_render_body_uploading:function(a){a.append($("<div>Dataset is uploading</div>"))},_render_body_queued:function(a){a.append($("<div>Job is waiting to run.</div>"));a.append(this._render_showParamsAndRerun())},_render_body_running:function(a){a.append("<div>Job is currently running.</div>");a.append(this._render_showParamsAndRerun())},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append(("An error occurred running this job: <i>"+$.trim(this.model.get("misc_info"))+"</i>"));var b=$(this._render_showParamsAndRerun());if(this.model.get("for_editing")){this.errButton=new IconButtonView({model:new IconButton({title:"View or report this error",href:this.model.get("report_error_url"),target:"galaxy_main",icon_class:"bug"})});b.prepend(this.errButton.render().$el)}if(this.model.hasData()){b.prepend(this._render_downloadLinks())}a.append(b)},_render_body_discarded:function(a){a.append("<div>The job creating this dataset was cancelled before completion.</div>");a.append(this._render_showParamsAndRerun())},_render_body_setting_metadata:function(a){a.append($("<div>Metadata is being auto-detected.</div>"))},_render_body_empty:function(a){a.append($("<div>No data: <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_showParamsAndRerun())},_render_body_failed_metadata:function(b){var c="An error occurred setting the metadata for this dataset.";if(this.model.isEditable()){var a=linkHTMLTemplate({text:"set it manually or retry auto-detection",href:this.model.get("edit_url"),target:"galaxy_main"});c+="You may be able to "+a+"."}b.append($(HistoryItemView.templates.warningMsg({warning:c})));this._render_body_ok(b)},_render_body_ok:function(h){h.append(this._render_hdaSummary());if(this.model.get("misc_info")){h.append($('<div class="info">Info: '+this.model.get("misc_info")+"</div>"))}if(this.model.hasData()){var c=$("<div/>");c.append(this._render_downloadLinks());c.append($(linkHTMLTemplate({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",classes:["icon-button","tooltip","information"]})));if(this.model.get("for_editing")){c.append($(linkHTMLTemplate({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",classes:["icon-button","tooltip","arrow-circle"]})));if(this.model.get("trackster_urls")){var a=this.model.get("trackster_urls");c.append($(linkHTMLTemplate({title:"View in Trackster",href:"javascript:void(0)",classes:["icon-button","tooltip","chart_curve","trackster-add"],"data-url":a["data-url"],"action-url":a["action-url"],"new-url":a["new-url"]})))}if(this.model.get("retag_url")&&this.model.get("annotate_url")){var d=$('<div style="float: right;"></div>');d.append($(linkHTMLTemplate({title:"Edit dataset tags",target:"galaxy_main",href:this.model.get("retag_url"),classes:["icon-button","tooltip","tags"]})));d.append($(linkHTMLTemplate({title:"Edit dataset annotation",target:"galaxy_main",href:this.model.get("annotation_url"),classes:["icon-button","tooltip","annotate"]})));c.append(d);c.append('<div style="clear: both"></div>');this.tagArea=$('<div class="tag-area" style="display: none">');this.tagArea.append("<strong>Tags:</strong>");this.tagElt=$('<div class="tag-elt"></div>');c.append(this.tagArea.append(this.tagElt));var e=$(('<div id="${dataset_id}-annotation-area" class="annotation-area" style="display: none">'));this.annotationArea=e;e.append("<strong>Annotation:</strong>");this.annotationElem=$('<div id="'+this.model.get("id")+'-annotation-elt" style="margin: 1px 0px 1px 0px" class="annotation-elt tooltip editable-text" title="Edit dataset annotation"></div>');e.append(this.annotationElem);c.append(e)}}c.append('<div style="clear: both;"></div>');h.append(c);var i=$("<div/>");if(this.model.get("display_apps")){var j=this.model.get("display_apps"),b=$("<span/>");for(app_name in j){var g=j[app_name],f=app_name+" ";for(location_name in g){f+=linkHTMLTemplate({text:location_name,href:g[location_name].url,target:g[location_name].target})+" "}b.append(f)}i.append(b)}h.append(i)}else{if(this.model.get("for_editing")){h.append(this._render_showParamsAndRerun())}}h.append(this._render_peek())},_render_body:function(){var b=this.model.get("state"),c=this.model.get("for_editing");var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: block");switch(b){case HistoryItem.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryItem.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryItem.STATES.QUEUED:this._render_body_queued(a);break;case HistoryItem.STATES.RUNNING:this._render_body_running(a);break;case HistoryItem.STATES.ERROR:this._render_body_error(a);break;case HistoryItem.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryItem.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryItem.STATES.EMPTY:this._render_body_empty(a);break;case HistoryItem.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryItem.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+b+'".</div>'))}a.append('<div style="clear: both"></div>');if(this.model.get("bodyIsShown")===false){a.hide()}return a},_render_hdaSummary:function(){var a=this.model.toJSON();if(this.model.get("metadata_dbkey")==="?"&&this.model.isEditable()){_.extend(a,{dbkey_unknown_and_editable:true})}return HistoryItemView.templates.hdaSummary(a)},_render_showParamsAndRerun:function(){var a=$("<div/>");this.showParamsButton=new IconButtonView({model:new IconButton({title:"View details",href:this.model.get("show_params_url"),target:"galaxy_main",icon_class:"information"})});a.append(this.showParamsButton.render().$el);if(this.model.get("for_editing")){this.rerunButton=new IconButtonView({model:new IconButton({title:"Run this job again",href:this.model.get("rerun_url"),target:"galaxy_main",icon_class:"arrow-circle"})})}return a},_render_downloadLinks:function(){if(this.model.get("purged")){return null}var a=linkHTMLTemplate({title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]});var d=this.model.get("download_meta_urls");if(!d){return a}var c=$('<div popupmenu="dataset-'+this.model.get("id")+'-popup"></div>');c.append(linkHTMLTemplate({text:"Download Dataset",title:"Download",href:this.model.get("download_url"),classes:["icon-button","tooltip","disk"]}));c.append("<a>Additional Files</a>");for(file_type in d){c.append(linkHTMLTemplate({text:"Download "+file_type,href:d[file_type],classes:["action-button"]}))}var b=$(('<div style="float:left;" class="menubutton split popup" id="dataset-${dataset_id}-popup"></div>'));b.append(a);c.append(b);return c},_render_peek:function(){if(!this.model.get("peek")){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(b){this.log(this,".loadAndDisplayTags",b);var c=this.tagArea;var a=this.tagElt;if(c.is(":hidden")){if(!a.html()){$.ajax({url:this.model.get("ajax_get_tag_url"),error:function(){alert("Tagging failed")},success:function(d){this.log("tag_elt_html:",d);a.html(d);a.find(".tooltip").tooltip();c.slideDown("fast")}})}else{c.slideDown("fast")}}else{c.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this,".loadAndDisplayAnnotation",b);var d=this.annotationArea,c=this.annotationElem,a=this.model.get("ajax_set_annotation_url");this.log("annotationArea hidden:",d.is(":hidden"));this.log("annotationElem html:",c.html());if(d.is(":hidden")){if(!c.html()){$.ajax({url:this.model.get("ajax_get_annotation_url"),error:function(){alert("Annotations failed")},success:function(e){if(e===""){e="<em>Describe or add notes to dataset</em>"}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toggleBodyVisibility:function(){this.log(this+".toggleBodyVisibility");this.$el.find(".historyItemBody").toggle()},toString:function(){var a=(this.model)?(this.model+""):("");return"HistoryItemView("+a+")"}});HistoryItemView.templates=CompiledTemplateLoader.getTemplates({"history-templates.html":{messages:"template-history-warning-messages",titleLink:"template-history-titleLink",hdaSummary:"template-history-hdaSummary"}});var HistoryCollection=Backbone.Collection.extend({model:HistoryItem,toString:function(){return("HistoryCollection()")}});var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",state_details:{discarded:0,empty:0,error:0,failed_metadata:0,ok:0,queued:0,running:0,setting_metadata:0,upload:0}},initialize:function(b,a){this.log(this+".initialize",b,a);this.items=new HistoryCollection()},loadDatasetsAsHistoryItems:function(c){var a=this,b=this.get("id"),d=this.get("state_details");_.each(c,function(f,e){a.log("loading dataset: ",f,e);var h=new HistoryItem(_.extend(f,{history_id:b}));a.log("as History:",h);a.items.add(h);var g=f.state;d[g]+=1});this.set("state_details",d);this._stateFromStateDetails();return this},_stateFromStateDetails:function(){this.set("state","");var a=this.get("state_details");if((a.error>0)||(a.failed_metadata>0)){this.set("state",HistoryItem.STATES.ERROR)}else{if((a.running>0)||(a.setting_metadata>0)){this.set("state",HistoryItem.STATES.RUNNING)}else{if(a.queued>0){this.set("state",HistoryItem.STATES.QUEUED)}else{if(a.ok===this.items.length){this.set("state",HistoryItem.STATES.OK)}else{throw ("_stateFromStateDetails: unable to determine history state from state details: "+this.state_details)}}}}return this},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});var HistoryView=BaseView.extend(LoggableMixin).extend({el:"body.historyPage",initialize:function(){this.log(this+".initialize");this.itemViews=[];var a=this;this.model.items.each(function(c){var b=new HistoryItemView({model:c});a.itemViews.push(b)})},render:function(){this.log(this+".render");var a=$("<div/>");_.each(this.itemViews,function(b){a.prepend(b.render())});this.$el.append(a.children());a.remove()},toString:function(){var a=this.model.get("name")||"";return"HistoryView("+a+")"}});function createMockHistoryData(){mockHistory={};mockHistory.data={template:{id:"a799d38679e985db",name:"template",data_type:"fastq",file_size:226297533,genome_build:"?",metadata_data_lines:0,metadata_dbkey:"?",metadata_sequences:0,misc_blurb:"215.8 MB",misc_info:"uploaded fastq file",model_class:"HistoryDatasetAssociation",download_url:"",state:"ok",visible:true,deleted:false,purged:false,hid:0,for_editing:true,undelete_url:"example.com/undelete",purge_url:"example.com/purge",unhide_url:"example.com/unhide",display_url:"example.com/display",edit_url:"example.com/edit",delete_url:"example.com/delete",show_params_url:"example.com/show_params",rerun_url:"example.com/rerun",retag_url:"example.com/retag",annotate_url:"example.com/annotate",peek:['<table cellspacing="0" cellpadding="3"><tr><th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th><th>5.MAPQ</th><th>6.CIGAR</th><th>7.MRNM</th><th>8.MPOS</th><th>9.ISIZE</th><th>10.SEQ</th><th>11.QUAL</th><th>12.OPT</th></tr>','<tr><td colspan="100%">@SQ SN:gi|87159884|ref|NC_007793.1| LN:2872769</td></tr>','<tr><td colspan="100%">@PG ID:bwa PN:bwa VN:0.5.9-r16</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 73 gi|87159884|ref|NC_007793.1| 2720169 37 101M = 2720169 0 NAATATGACATTATTTTCAAAACAGCTGAAAATTTAGACGTACCGATTTATCTACATCCCGCGCCAGTTAACAGTGACATTTATCAATCATACTATAAAGG !!!!!!!!!!$!!!$!!!!!$!!!!!!$!$!$$$!!$!!$!!!!!!!!!!!$!</td></tr>','<tr><td colspan="100%">!!!$!$!$$!!$$!!$!!!!!!!!!!!!!!!!!!!!!!!!!!$!!$!! XT:A:U NM:i:1 SM:i:37 AM:i:0 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:0A100</td></tr>','<tr><td colspan="100%">HWUSI-EAS664L:15:64HOJAAXX:1:1:13280:968 133 gi|87159884|ref|NC_007793.1| 2720169 0 * = 2720169 0 NAAACTGTGGCTTCGTTNNNNNNNNNNNNNNNGTGANNNNNNNNNNNNNNNNNNNGNNNNNNNNNNNNNNNNNNNNCNAANNNNNNNNNNNNNNNNNNNNN !!!!!!!!!!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>','<tr><td colspan="100%">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</td></tr>',"</table>"].join("")}};_.extend(mockHistory.data,{deleted:_.extend(_.clone(mockHistory.data.template),{deleted:true}),purgedNotDeleted:_.extend(_.clone(mockHistory.data.template),{purged:true}),notvisible:_.extend(_.clone(mockHistory.data.template),{visible:false}),hasDisplayApps:_.extend(_.clone(mockHistory.data.template),{display_apps:{"display in IGB":{Web:"/display_application/63cd3858d057a6d1/igb_bam/Web",Local:"/display_application/63cd3858d057a6d1/igb_bam/Local"}}}),canTrackster:_.extend(_.clone(mockHistory.data.template),{trackster_urls:{"data-url":"example.com/trackster-data","action-url":"example.com/trackster-action","new-url":"example.com/trackster-new"}}),zeroSize:_.extend(_.clone(mockHistory.data.template),{file_size:0}),hasMetafiles:_.extend(_.clone(mockHistory.data.template),{download_meta_urls:{bam_index:"example.com/bam-index"}}),upload:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.UPLOAD}),queued:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.QUEUED}),running:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.RUNNING}),empty:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.EMPTY}),error:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.ERROR,report_error_url:"example.com/report_err"}),discarded:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.DISCARDED}),setting_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.SETTING_METADATA}),failed_metadata:_.extend(_.clone(mockHistory.data.template),{state:HistoryItem.STATES.FAILED_METADATA})});$(document).ready(function(){mockHistory.items={};mockHistory.views={};for(key in mockHistory.data){mockHistory.items[key]=new HistoryItem(mockHistory.data[key]);mockHistory.items[key].set("name",key);mockHistory.views[key]=new HistoryItemView({model:mockHistory.items[key]});$("body").append(mockHistory.views[key].render())}})};
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/mvc/tags.js
--- /dev/null
+++ b/static/scripts/packed/mvc/tags.js
@@ -0,0 +1,1 @@
+var Tag=BaseModel.extend(LoggableMixin).extend({logger:console,defaults:{id:null,itemClass:null},toString:function(){return"Tag()"}});var TagView=BaseView.extend(LoggableMixin).extend({logger:console,toString:function(){return"TagView()"}});var TagCollection=Backbone.Collection.extend(LoggableMixin).extend({model:Tag,logger:console,toString:function(){return"TagCollection()"}});var TagList=BaseView.extend(LoggableMixin).extend({logger:console,toString:function(){return"TagList()"}});
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/templates/compiled/helpers-common-templates.js
--- /dev/null
+++ b/static/scripts/packed/templates/compiled/helpers-common-templates.js
@@ -0,0 +1,1 @@
+Handlebars.registerPartial("clearFloatDiv",function(a){return'<div class="clear"></div>'});Handlebars.registerPartial("iconButton",function(c,b){var a="";a+=(c.enabled)?("<a"):("<span");if(c.title){c.buffer+=' title="'+c.title+'"'}a+=' class="icon-button';if(c.isMenuButton){a+=" menu-button"}if(c.title){a+=" tooltip"}a+=" "+c.icon_class;if(!c.enabled){a+="_disabled"}a+='"';if(c.id){a+=' id="'+c.id+'"'}a+=' href="'+((c.href)?(c.href):("javascript:void(0);"))+'"';if(c.target){a+=' target="'+c.target+'"'}if(!c.visible){a+=' style="display: none;"'}a+=">Bler"+((c.enabled)?("</a>"):("</span>"));return a});Handlebars.registerHelper("warningmessagesmall",function(a){return'<div class="warningmessagesmall"><strong>'+a.fn(this)+"</strong></div>"});
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/templates/compiled/template-history-hdaSummary.js
--- /dev/null
+++ b/static/scripts/packed/templates/compiled/template-history-hdaSummary.js
@@ -0,0 +1,1 @@
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-hdaSummary"]=b(function(g,n,f,m,l){f=f||g.helpers;var j="",d,i,h="function",k=this.escapeExpression,o=this;function e(t,s){var q="",r,p;q+='\n <a href="';p=f.edit_url;if(p){r=p.call(t,{hash:{}})}else{r=t.edit_url;r=typeof r===h?r():r}q+=k(r)+'" target="galaxy_main">';p=f.metadata_dbkey;if(p){r=p.call(t,{hash:{}})}else{r=t.metadata_dbkey;r=typeof r===h?r():r}q+=k(r)+"</a>\n";return q}function c(t,s){var q="",r,p;q+='\n <span class="';p=f.metadata_dbkey;if(p){r=p.call(t,{hash:{}})}else{r=t.metadata_dbkey;r=typeof r===h?r():r}q+=k(r)+'">';p=f.metadata_dbkey;if(p){r=p.call(t,{hash:{}})}else{r=t.metadata_dbkey;r=typeof r===h?r():r}q+=k(r)+"</span>\n";return q}i=f.misc_blurb;if(i){d=i.call(n,{hash:{}})}else{d=n.misc_blurb;d=typeof d===h?d():d}j+=k(d)+'<br />\nformat: <span class="';i=f.data_type;if(i){d=i.call(n,{hash:{}})}else{d=n.data_type;d=typeof d===h?d():d}j+=k(d)+'">';i=f.data_type;if(i){d=i.call(n,{hash:{}})}else{d=n.data_type;d=typeof d===h?d():d}j+=k(d)+"</span>,\ndatabase:\n";d=n.dbkey_unknown_and_editable;d=f["if"].call(n,d,{hash:{},inverse:o.program(3,c,l),fn:o.program(1,e,l)});if(d||d===0){j+=d}return j})})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/templates/compiled/template-history-titleLink.js
--- /dev/null
+++ b/static/scripts/packed/templates/compiled/template-history-titleLink.js
@@ -0,0 +1,1 @@
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-titleLink"]=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='<a href="javascript:void(0);"><span class="historyItemTitle">';g=d.hid;if(g){c=g.call(l,{hash:{}})}else{c=l.hid;c=typeof c===f?c():c}h+=i(c)+": ";g=d.name;if(g){c=g.call(l,{hash:{}})}else{c=l.name;c=typeof c===f?c():c}h+=i(c)+"</span></a>";return h})})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/templates/compiled/template-history-warning-messages.js
--- /dev/null
+++ b/static/scripts/packed/templates/compiled/template-history-warning-messages.js
@@ -0,0 +1,1 @@
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-warning-messages"]=b(function(g,s,q,k,v){q=q||g.helpers;var r="",h,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(z,y){var x,w;w=q.warningmessagesmall;if(w){x=w.call(z,{hash:{},inverse:p.noop,fn:p.program(2,n,y)})}else{x=z.warningmessagesmall;x=typeof x===e?x():x}if(!q.warningmessagesmall){x=c.call(z,x,{hash:{},inverse:p.noop,fn:p.program(2,n,y)})}if(x||x===0){return x}else{return""}}function n(z,y){var w="",x;w+="\n This dataset has been deleted.\n ";x=z.undelete_url;x=q["if"].call(z,x,{hash:{},inverse:p.noop,fn:p.program(3,m,y)});if(x||x===0){w+=x}w+="\n";return w}function m(A,z){var x="",y,w;x+='\n Click <a href="';w=q.undelete_url;if(w){y=w.call(A,{hash:{}})}else{y=A.undelete_url;y=typeof y===e?y():y}x+=d(y)+'" class="historyItemUndelete" id="historyItemUndeleter-';w=q.id;if(w){y=w.call(A,{hash:{}})}else{y=A.id;y=typeof y===e?y():y}x+=d(y)+'"\n target="galaxy_history">here</a> to undelete it\n ';y=A.purge_url;y=q["if"].call(A,y,{hash:{},inverse:p.noop,fn:p.program(4,l,z)});if(y||y===0){x+=y}x+="\n ";return x}function l(A,z){var x="",y,w;x+='\n or <a href="';w=q.purge_url;if(w){y=w.call(A,{hash:{}})}else{y=A.purge_url;y=typeof y===e?y():y}x+=d(y)+'" class="historyItemPurge" id="historyItemPurger-';w=q.id;if(w){y=w.call(A,{hash:{}})}else{y=A.id;y=typeof y===e?y():y}x+=d(y)+'"\n target="galaxy_history">here</a> to immediately remove it from disk\n ';return x}function j(z,y){var x,w;w=q.warningmessagesmall;if(w){x=w.call(z,{hash:{},inverse:p.noop,fn:p.program(7,i,y)})}else{x=z.warningmessagesmall;x=typeof x===e?x():x}if(!q.warningmessagesmall){x=c.call(z,x,{hash:{},inverse:p.noop,fn:p.program(7,i,y)})}if(x||x===0){return x}else{return""}}function i(x,w){return"\n This dataset has been deleted and removed from disk.\n"}function f(z,y){var x,w;w=q.warningmessagesmall;if(w){x=w.call(z,{hash:{},inverse:p.noop,fn:p.program(10,u,y)})}else{x=z.warningmessagesmall;x=typeof x===e?x():x}if(!q.warningmessagesmall){x=c.call(z,x,{hash:{},inverse:p.noop,fn:p.program(10,u,y)})}if(x||x===0){return x}else{return""}}function u(z,y){var w="",x;w+="\n This dataset has been hidden.\n ";x=z.undelete_url;x=q["if"].call(z,x,{hash:{},inverse:p.noop,fn:p.program(11,t,y)});if(x||x===0){w+=x}w+="\n";return w}function t(A,z){var x="",y,w;x+='\n Click <a href="';w=q.unhide_url;if(w){y=w.call(A,{hash:{}})}else{y=A.unhide_url;y=typeof y===e?y():y}x+=d(y)+'" class="historyItemUnhide" id="historyItemUnhider-';w=q.id;if(w){y=w.call(A,{hash:{}})}else{y=A.id;y=typeof y===e?y():y}x+=d(y)+'"\n target="galaxy_history">here</a> to unhide it\n ';return x}h=s.deleted;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(1,o,v)});if(h||h===0){r+=h}r+="\n\n";h=s.purged;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(6,j,v)});if(h||h===0){r+=h}r+="\n\n";h=s.visible;h=q.unless.call(s,h,{hash:{},inverse:p.noop,fn:p.program(9,f,v)});if(h||h===0){r+=h}return r})})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/templates/compiled/template-warningmessagesmall.js
--- /dev/null
+++ b/static/scripts/packed/templates/compiled/template-warningmessagesmall.js
@@ -0,0 +1,1 @@
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-warningmessagesmall"]=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+=' \n <div class="warningmessagesmall"><strong>';g=d.warning;if(g){c=g.call(l,{hash:{}})}else{c=l.warning;c=typeof c===f?c():c}h+=i(c)+"</strong></div>";return h})})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/viz/circster.js
--- a/static/scripts/packed/viz/circster.js
+++ b/static/scripts/packed/viz/circster.js
@@ -1,1 +1,1 @@
-define(["libs/d3","viz/visualization"],function(d,e){var c=function(){this.initialize&&this.initialize.apply(this,arguments)};c.extend=Backbone.Model.extend;var b=Backbone.View.extend({className:"circster",initialize:function(h){this.total_gap=h.total_gap;this.genome=h.genome;this.dataset_arc_height=h.dataset_arc_height;this.track_gap=5},render:function(){var j=this,l=this.dataset_arc_height,m=j.$el.width(),h=j.$el.height(),k=(Math.min(m,h)/2-this.model.get("tracks").length*(this.dataset_arc_height+this.track_gap));var i=d.select(j.$el[0]).append("svg").attr("width",m).attr("height",h).attr("pointer-events","all").append("svg:g").call(d.behavior.zoom().on("zoom",function(){i.attr("transform","translate("+d.event.translate+") scale("+d.event.scale+")")})).attr("transform","translate("+m/2+","+h/2+")").append("svg:g");this.model.get("tracks").each(function(n,p){var q=n.get("genome_wide_data"),r=k+p*(l+j.track_gap),o=(q instanceof e.GenomeWideBigWigData?f:CircsterSummaryTreeTrackRenderer);track_renderer=new o({track:n,radius_start:r,radius_end:r+l,genome:j.genome,total_gap:j.total_gap});track_renderer.render(i)})}});var a=c.extend({initialize:function(h){this.options=h},render:function(i){genome_arcs=this.chroms_layout(),chroms_arcs=this.genome_data_layout();var n=this.options.radius_start,l=this.options.radius_end,o=i.append("g").attr("id","inner-arc"),m=d.svg.arc().innerRadius(n).outerRadius(l),h=o.selectAll("#inner-arc>path").data(genome_arcs).enter().append("path").attr("d",m).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(p){return p.data.chrom});var j=this.options.track.get("prefs"),k=j.block_color;_.each(chroms_arcs,function(p){if(!p){return}var s=i.append("g"),r=d.svg.arc().innerRadius(n),q=s.selectAll("path").data(p).enter();q.append("path").attr("d",r).style("stroke",k)})},chroms_layout:function(){var i=this.options.genome.get_chroms_info(),k=d.layout.pie().value(function(m){return m.len}).sort(null),l=k(i),h=this.options.total_gap/i.length,j=_.map(l,function(o,n){var m=o.endAngle-h;o.endAngle=(m>o.startAngle?m:o.startAngle);return o});return j},chrom_data_layout:function(k,j,i,l,h){},genome_data_layout:function(){var i=this,h=this.chroms_layout(),m=this.options.track.get("genome_wide_data"),l=this.options.radius_start,j=this.options.radius_end,k=_.zip(h,m.get("data")),n=_.map(k,function(p){var q=p[0],o=p[1];return i.chrom_data_layout(q,o,l,j,m.get("min"),m.get("max"))});return n}});var g=a.extend({chrom_data_layout:function(r,i,o,n,k,p){if(!i||typeof i==="string"){return null}var l=i[0],q=i[3],j=d.scale.linear().domain([k,p]).range([o,n]),m=d.layout.pie().value(function(s){return q}).startAngle(r.startAngle).endAngle(r.endAngle),h=m(l);_.each(l,function(s,t){h[t].outerRadius=j(s[1])});return h}});var f=a.extend({chrom_data_layout:function(q,i,o,n,k,p){var l=i.data;if(l.length===0){return}var j=d.scale.linear().domain([k,p]).range([o,n]),m=d.layout.pie().value(function(s,r){if(r+1===l.length){return 0}return l[r+1][0]-l[r][0]}).startAngle(q.startAngle).endAngle(q.endAngle),h=m(l);_.each(l,function(r,s){h[s].outerRadius=j(r[1])});return h}});return{CircsterView:b}});
\ No newline at end of file
+define(["libs/d3","viz/visualization"],function(e,f){var d=function(){this.initialize&&this.initialize.apply(this,arguments)};d.extend=Backbone.Model.extend;var c=Backbone.View.extend({className:"circster",initialize:function(h){this.total_gap=h.total_gap;this.genome=h.genome;this.dataset_arc_height=h.dataset_arc_height;this.track_gap=5},render:function(){var j=this,l=this.dataset_arc_height,m=j.$el.width(),h=j.$el.height(),k=(Math.min(m,h)/2-this.model.get("tracks").length*(this.dataset_arc_height+this.track_gap));var i=e.select(j.$el[0]).append("svg").attr("width",m).attr("height",h).attr("pointer-events","all").append("svg:g").call(e.behavior.zoom().on("zoom",function(){i.attr("transform","translate("+e.event.translate+") scale("+e.event.scale+")")})).attr("transform","translate("+m/2+","+h/2+")").append("svg:g");this.model.get("tracks").each(function(n,p){var q=n.get("genome_wide_data"),s=k+p*(l+j.track_gap),o=(q instanceof f.GenomeWideBigWigData?g:a);var r=new o({track:n,radius_start:s,radius_end:s+l,genome:j.genome,total_gap:j.total_gap});r.render(i)})}});var b=d.extend({initialize:function(h){this.options=h},render:function(m){var h=this.chroms_layout(),k=this.genome_data_layout();var n=this.options.radius_start,j=this.options.radius_end,p=m.append("g").attr("id","inner-arc"),o=e.svg.arc().innerRadius(n).outerRadius(j),i=p.selectAll("#inner-arc>path").data(h).enter().append("path").attr("d",o).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(r){return r.data.chrom});var q=this.options.track.get("prefs"),l=q.block_color;_.each(k,function(r){if(!r){return}var u=m.append("g"),t=e.svg.arc().innerRadius(n),s=u.selectAll("path").data(r).enter();s.append("path").attr("d",t).style("stroke",l)})},chroms_layout:function(){var i=this.options.genome.get_chroms_info(),k=e.layout.pie().value(function(m){return m.len}).sort(null),l=k(i),h=this.options.total_gap/i.length,j=_.map(l,function(o,n){var m=o.endAngle-h;o.endAngle=(m>o.startAngle?m:o.startAngle);return o});return j},chrom_data_layout:function(k,j,i,l,h){},genome_data_layout:function(){var i=this,h=this.chroms_layout(),m=this.options.track.get("genome_wide_data"),l=this.options.radius_start,j=this.options.radius_end,k=_.zip(h,m.get("data")),n=_.map(k,function(p){var q=p[0],o=p[1];return i.chrom_data_layout(q,o,l,j,m.get("min"),m.get("max"))});return n}});var a=b.extend({chrom_data_layout:function(r,i,o,n,k,p){if(!i||typeof i==="string"){return null}var l=i[0],q=i[3],j=e.scale.linear().domain([k,p]).range([o,n]),m=e.layout.pie().value(function(s){return q}).startAngle(r.startAngle).endAngle(r.endAngle),h=m(l);_.each(l,function(s,t){h[t].outerRadius=j(s[1])});return h}});var g=b.extend({chrom_data_layout:function(q,i,o,n,k,p){var l=i.data;if(l.length===0){return}var j=e.scale.linear().domain([k,p]).range([o,n]),m=e.layout.pie().value(function(s,r){if(r+1===l.length){return 0}return l[r+1][0]-l[r][0]}).startAngle(q.startAngle).endAngle(q.endAngle),h=m(l);_.each(l,function(r,s){h[s].outerRadius=j(r[1])});return h}});return{CircsterView:c}});
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/packed/viz/visualization.js
--- a/static/scripts/packed/viz/visualization.js
+++ b/static/scripts/packed/viz/visualization.js
@@ -1,1 +1,1 @@
-var ServerStateDeferred=Backbone.Model.extend({defaults:{ajax_settings:{},interval:1000,success_fn:function(a){return true}},go:function(){var d=$.Deferred(),c=this,f=c.get("ajax_settings"),e=c.get("success_fn"),b=c.get("interval"),a=function(){$.ajax(f).success(function(g){if(e(g)){d.resolve(g)}else{setTimeout(a,b)}})};a();return d}});var CanvasManager=function(a){this.default_font=a!==undefined?a:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};_.extend(CanvasManager.prototype,{load_pattern:function(a,e){var b=this.patterns,c=this.dummy_context,d=new Image();d.src=galaxy_paths.attributes.image_path+e;d.onload=function(){b[a]=c.createPattern(d,"repeat")}},get_pattern:function(a){return this.patterns[a]},new_canvas:function(){var a=$("<canvas/>")[0];if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(a)}a.manager=this;return a}});var Cache=Backbone.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(a){this.clear()},get_elt:function(b){var c=this.attributes.obj_cache,d=this.attributes.key_ary,a=d.indexOf(b);if(a!==-1){if(c[b].stale){d.splice(a,1);delete c[b]}else{this.move_key_to_end(b,a)}}return c[b]},set_elt:function(b,d){var e=this.attributes.obj_cache,f=this.attributes.key_ary,c=this.attributes.num_elements;if(!e[b]){if(f.length>=c){var a=f.shift();delete e[a]}f.push(b)}e[b]=d;return d},move_key_to_end:function(b,a){this.attributes.key_ary.splice(a,1);this.attributes.key_ary.push(b)},clear:function(){this.attributes.obj_cache={};this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length}});var GenomeDataManager=Cache.extend({defaults:_.extend({},Cache.prototype.defaults,{dataset:null,filters_manager:null,data_url:null,dataset_state_url:null,feature_search_url:null,genome_wide_summary_data:null,data_mode_compatible:function(a,b){return true},can_subset:function(a){return false}}),data_is_ready:function(){var c=this.get("dataset"),b=$.Deferred(),a=new ServerStateDeferred({ajax_settings:{url:this.get("dataset_state_url"),data:{dataset_id:c.id,hda_ldda:c.get("hda_ldda")},dataType:"json"},interval:5000,success_fn:function(d){return d!=="pending"}});$.when(a.go()).then(function(d){b.resolve(d==="ok"||d==="data")});return b},search_features:function(a){var b=this.get("dataset"),c={query:a,dataset_id:b.id,hda_ldda:b.get("hda_ldda")};return $.getJSON(this.get("feature_search_url"),c)},load_data:function(j,h,b,g){var d={chrom:j.get("chrom"),low:j.get("start"),high:j.get("end"),mode:h,resolution:b},e=this.get("dataset");if(e){d.dataset_id=e.id;d.hda_ldda=e.get("hda_ldda")}$.extend(d,g);var k=this.get("filters_manager");if(k){var l=[];var a=k.filters;for(var f=0;f<a.length;f++){l.push(a[f].name)}d.filter_cols=JSON.stringify(l)}var c=this;return $.getJSON(this.get("data_url"),d,function(i){c.set_data(j,i)})},get_data:function(g,f,c,e){var h=this.get_elt(g);if(h&&(is_deferred(h)||this.get("data_mode_compatible")(h,f))){return h}var j=this.get("key_ary"),b=this.get("obj_cache"),k,a;for(var d=0;d<j.length;d++){k=j[d];a=new GenomeRegion({from_str:k});if(a.contains(g)){h=b[k];if(is_deferred(h)||(this.get("data_mode_compatible")(h,f)&&this.get("can_subset")(h))){this.move_key_to_end(k,d);return h}}}h=this.load_data(g,f,c,e);this.set_data(g,h);return h},set_data:function(b,a){this.set_elt(b,a)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(i,h,d,g,e){var k=this.get_elt(i);if(!(k&&this.get("data_mode_compatible")(k,h))){console.log("ERROR: no current data for: ",dataset,i.toString(),h,d,g);return}k.stale=true;var c=i.get("start");if(e===this.DEEP_DATA_REQ){$.extend(g,{start_val:k.data.length+1})}else{if(e===this.BROAD_DATA_REQ){c=(k.max_high?k.max_high:k.data[k.data.length-1][2])+1}}var j=i.copy().set("start",c);var b=this,f=this.load_data(j,h,d,g),a=$.Deferred();this.set_data(i,a);$.when(f).then(function(l){if(l.data){l.data=k.data.concat(l.data);if(l.max_low){l.max_low=k.max_low}if(l.message){l.message=l.message.replace(/[0-9]+/,l.data.length)}}b.set_data(i,l);a.resolve(l)});return a},get_elt:function(a){return Cache.prototype.get_elt.call(this,a.toString())},set_elt:function(b,a){return Cache.prototype.set_elt.call(this,b.toString(),a)}});var ReferenceTrackDataManager=GenomeDataManager.extend({load_data:function(a,d,e,b,c){if(b>1){return{data:null}}return GenomeDataManager.prototype.load_data.call(this,a,d,e,b,c)}});var Genome=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var GenomeRegion=Backbone.RelationalModel.extend({defaults:{chrom:null,start:0,end:0,DIF_CHROMS:1000,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006},initialize:function(b){if(b.from_str){var d=b.from_str.split(":"),c=d[0],a=d[1].split("-");this.set({chrom:c,start:parseInt(a[0],10),end:parseInt(a[1],10)})}},copy:function(){return new GenomeRegion({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(h){var b=this.get("chrom"),g=h.get("chrom"),f=this.get("start"),d=h.get("start"),e=this.get("end"),c=h.get("end"),a;if(b&&g&&b!==g){return this.get("DIF_CHROMS")}if(f<d){if(e<d){a=this.get("BEFORE")}else{if(e<=c){a=this.get("OVERLAP_START")}else{a=this.get("CONTAINS")}}}else{if(f>c){a=this.get("AFTER")}else{if(e<=c){a=this.get("CONTAINED_BY")}else{a=this.get("OVERLAP_END")}}}return a},contains:function(a){return this.compute_overlap(a)===this.get("CONTAINS")},overlaps:function(a){return _.intersection([this.compute_overlap(a)],[this.get("DIF_CHROMS"),this.get("BEFORE"),this.get("AFTER")]).length===0}});var GenomeRegionCollection=Backbone.Collection.extend({model:GenomeRegion});var BrowserBookmark=Backbone.RelationalModel.extend({defaults:{region:null,note:""},relations:[{type:Backbone.HasOne,key:"region",relatedModel:"GenomeRegion"}]});var BrowserBookmarkCollection=Backbone.Collection.extend({model:BrowserBookmark});var GenomeWideBigWigData=Backbone.Model.extend({defaults:{data:null,min:0,max:0},initialize:function(b){var a=_.flatten(_.map(this.get("data"),function(c){if(c.data.length!==0){return _.map(c.data,function(d){return d[1]})}else{return 0}}));this.set("max",_.max(a));this.set("min",_.min(a))}});var GenomeWideSummaryTreeData=Backbone.RelationalModel.extend({defaults:{data:null,min:0,max:0},initialize:function(b){var a=_.max(this.get("data"),function(c){if(!c||typeof c==="string"){return 0}return c[1]});this.attributes.max=(a&&typeof a!=="string"?a[1]:0)}});var BackboneTrack=Dataset.extend({initialize:function(a){this.set("id",a.dataset_id);var c=this.get("genome_wide_data");if(c){var b=(this.get("track_type")==="LineTrack"?GenomeWideBigWigData:GenomeWideSummaryTreeData);this.set("genome_wide_data",new b(c))}}});var Visualization=Backbone.RelationalModel.extend({defaults:{id:"",title:"",type:"",dbkey:"",tracks:null},relations:[{type:Backbone.HasMany,key:"tracks",relatedModel:"BackboneTrack"}],url:function(){return galaxy_paths.get("visualization_url")},save:function(){return $.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var GenomeVisualization=Visualization.extend({defaults:_.extend({},Visualization.prototype.defaults,{bookmarks:null,viewport:null})});var TrackConfig=Backbone.Model.extend({});var CircsterDataLayout=Backbone.Model.extend({defaults:{genome:null,dataset:null,total_gap:null},chroms_layout:function(){var b=this.attributes.genome.get_chroms_info(),d=d3.layout.pie().value(function(f){return f.len}).sort(null),e=d(b),a=this.attributes.total_gap/b.length,c=_.map(e,function(h,g){var f=h.endAngle-a;h.endAngle=(f>h.startAngle?f:h.startAngle);return h});return c},chrom_data_layout:function(d,c,b,e,a){},genome_data_layout:function(){var b=this,a=this.chroms_layout(),f=this.get("track").get("genome_wide_data"),e=this.get("radius_start"),c=this.get("radius_end"),d=_.zip(a,f.get("data")),g=_.map(d,function(i){var j=i[0],h=i[1];return b.chrom_data_layout(j,h,e,c,f.get("min"),f.get("max"))});return g}});var CircsterSummaryTreeLayout=CircsterDataLayout.extend({chrom_data_layout:function(k,b,h,g,d,i){if(!b||typeof b==="string"){return null}var e=b[0],j=b[3],c=d3.scale.linear().domain([d,i]).range([h,g]),f=d3.layout.pie().value(function(l){return j}).startAngle(k.startAngle).endAngle(k.endAngle),a=f(e);_.each(e,function(l,m){a[m].outerRadius=c(l[1])});return a}});var CircsterBigWigLayout=CircsterDataLayout.extend({chrom_data_layout:function(j,b,h,g,d,i){var e=b.data;if(e.length===0){return}var c=d3.scale.linear().domain([d,i]).range([h,g]),f=d3.layout.pie().value(function(l,k){if(k+1===e.length){return 0}return e[k+1][0]-e[k][0]}).startAngle(j.startAngle).endAngle(j.endAngle),a=f(e);_.each(e,function(k,l){a[l].outerRadius=c(k[1])});return a}});var CircsterView=Backbone.View.extend({className:"circster",initialize:function(a){this.total_gap=a.total_gap;this.genome=a.genome;this.dataset_arc_height=a.dataset_arc_height;this.track_gap=5},render:function(){var c=this,e=this.dataset_arc_height,f=c.$el.width(),a=c.$el.height(),d=(Math.min(f,a)/2-this.model.get("tracks").length*(this.dataset_arc_height+this.track_gap));var b=d3.select(c.$el[0]).append("svg").attr("width",f).attr("height",a).attr("pointer-events","all").append("svg:g").call(d3.behavior.zoom().on("zoom",function(){b.attr("transform","translate("+d3.event.translate+") scale("+d3.event.scale+")")})).attr("transform","translate("+f/2+","+a/2+")").append("svg:g");this.model.get("tracks").each(function(i,o){var j=i.get("genome_wide_data"),n=d+o*(e+c.track_gap),k=(j instanceof GenomeWideBigWigData?CircsterBigWigLayout:CircsterSummaryTreeLayout),q=new k({track:i,radius_start:n,radius_end:n+e,genome:c.genome,total_gap:c.total_gap}),g=q.chroms_layout(),l=q.genome_data_layout();var r=b.append("g").attr("id","inner-arc"),p=d3.svg.arc().innerRadius(n).outerRadius(n+e),h=r.selectAll("#inner-arc>path").data(g).enter().append("path").attr("d",p).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(t){return t.data.chrom});var s=i.get("prefs"),m=s.block_color;_.each(l,function(t){if(!t){return}var w=b.append("g"),v=d3.svg.arc().innerRadius(n),u=w.selectAll("path").data(t).enter().append("path").attr("d",v).style("stroke",m).style("fill",m)})})}});var TrackBrowserRouter=Backbone.Router.extend({initialize:function(b){this.view=b.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var a=this;a.view.on("navigate",function(c){a.navigate(c)})},change_location:function(a){this.view.go_to(a)}});var add_datasets=function(a,c,b){$.ajax({url:a,data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(d){show_modal("Select datasets for new tracks",d,{Cancel:function(){hide_modal()},Add:function(){var e=[];$("input[name=id]:checked,input[name=ldda_ids]:checked").each(function(){var f,g=$(this).val();if($(this).attr("name")==="id"){f={hda_id:g}}else{f={ldda_id:g}}e[e.length]=$.ajax({url:c,data:f,dataType:"json"})});$.when.apply($,e).then(function(){var f=(arguments[0] instanceof Array?$.map(arguments,function(g){return g[0]}):[arguments[0]]);b(f)});hide_modal()}})}})};
\ No newline at end of file
+(function(){var f=Backbone.Model.extend({defaults:{ajax_settings:{},interval:1000,success_fn:function(t){return true}},go:function(){var w=$.Deferred(),v=this,y=v.get("ajax_settings"),x=v.get("success_fn"),u=v.get("interval"),t=function(){$.ajax(y).success(function(z){if(x(z)){w.resolve(z)}else{setTimeout(t,u)}})};t();return w}});var g=function(t){this.default_font=t!==undefined?t:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};_.extend(g.prototype,{load_pattern:function(t,x){var u=this.patterns,v=this.dummy_context,w=new Image();w.src=galaxy_paths.attributes.image_path+x;w.onload=function(){u[t]=v.createPattern(w,"repeat")}},get_pattern:function(t){return this.patterns[t]},new_canvas:function(){var t=$("<canvas/>")[0];if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(t)}t.manager=this;return t}});var p=Backbone.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(t){this.clear()},get_elt:function(u){var v=this.attributes.obj_cache,w=this.attributes.key_ary,t=w.indexOf(u);if(t!==-1){if(v[u].stale){w.splice(t,1);delete v[u]}else{this.move_key_to_end(u,t)}}return v[u]},set_elt:function(u,w){var x=this.attributes.obj_cache,y=this.attributes.key_ary,v=this.attributes.num_elements;if(!x[u]){if(y.length>=v){var t=y.shift();delete x[t]}y.push(u)}x[u]=w;return w},move_key_to_end:function(u,t){this.attributes.key_ary.splice(t,1);this.attributes.key_ary.push(u)},clear:function(){this.attributes.obj_cache={};this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length}});var d=p.extend({defaults:_.extend({},p.prototype.defaults,{dataset:null,filters_manager:null,data_url:null,dataset_state_url:null,feature_search_url:null,genome_wide_summary_data:null,data_mode_compatible:function(t,u){return true},can_subset:function(t){return false}}),data_is_ready:function(){var v=this.get("dataset"),u=$.Deferred(),t=new f({ajax_settings:{url:this.get("dataset_state_url"),data:{dataset_id:v.id,hda_ldda:v.get("hda_ldda")},dataType:"json"},interval:5000,success_fn:function(w){return w!=="pending"}});$.when(t.go()).then(function(w){u.resolve(w==="ok"||w==="data")});return u},search_features:function(t){var u=this.get("dataset"),v={query:t,dataset_id:u.id,hda_ldda:u.get("hda_ldda")};return $.getJSON(this.get("feature_search_url"),v)},load_data:function(B,A,u,z){var w={chrom:B.get("chrom"),low:B.get("start"),high:B.get("end"),mode:A,resolution:u},x=this.get("dataset");if(x){w.dataset_id=x.id;w.hda_ldda=x.get("hda_ldda")}$.extend(w,z);var C=this.get("filters_manager");if(C){var D=[];var t=C.filters;for(var y=0;y<t.length;y++){D.push(t[y].name)}w.filter_cols=JSON.stringify(D)}var v=this;return $.getJSON(this.get("data_url"),w,function(E){v.set_data(B,E)})},get_data:function(z,y,v,x){var A=this.get_elt(z);if(A&&(is_deferred(A)||this.get("data_mode_compatible")(A,y))){return A}var B=this.get("key_ary"),u=this.get("obj_cache"),C,t;for(var w=0;w<B.length;w++){C=B[w];t=new h({from_str:C});if(t.contains(z)){A=u[C];if(is_deferred(A)||(this.get("data_mode_compatible")(A,y)&&this.get("can_subset")(A))){this.move_key_to_end(C,w);return A}}}A=this.load_data(z,y,v,x);this.set_data(z,A);return A},set_data:function(u,t){this.set_elt(u,t)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(B,A,w,z,x){var D=this.get_elt(B);if(!(D&&this.get("data_mode_compatible")(D,A))){console.log("ERROR: no current data for: ",dataset,B.toString(),A,w,z);return}D.stale=true;var v=B.get("start");if(x===this.DEEP_DATA_REQ){$.extend(z,{start_val:D.data.length+1})}else{if(x===this.BROAD_DATA_REQ){v=(D.max_high?D.max_high:D.data[D.data.length-1][2])+1}}var C=B.copy().set("start",v);var u=this,y=this.load_data(C,A,w,z),t=$.Deferred();this.set_data(B,t);$.when(y).then(function(E){if(E.data){E.data=D.data.concat(E.data);if(E.max_low){E.max_low=D.max_low}if(E.message){E.message=E.message.replace(/[0-9]+/,E.data.length)}}u.set_data(B,E);t.resolve(E)});return t},get_elt:function(t){return p.prototype.get_elt.call(this,t.toString())},set_elt:function(u,t){return p.prototype.set_elt.call(this,u.toString(),t)}});var n=d.extend({load_data:function(t,w,x,u,v){if(u>1){return{data:null}}return d.prototype.load_data.call(this,t,w,x,u,v)}});var c=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var h=Backbone.RelationalModel.extend({defaults:{chrom:null,start:0,end:0,DIF_CHROMS:1000,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006},initialize:function(u){if(u.from_str){var w=u.from_str.split(":"),v=w[0],t=w[1].split("-");this.set({chrom:v,start:parseInt(t[0],10),end:parseInt(t[1],10)})}},copy:function(){return new h({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(A){var u=this.get("chrom"),z=A.get("chrom"),y=this.get("start"),w=A.get("start"),x=this.get("end"),v=A.get("end"),t;if(u&&z&&u!==z){return this.get("DIF_CHROMS")}if(y<w){if(x<w){t=this.get("BEFORE")}else{if(x<=v){t=this.get("OVERLAP_START")}else{t=this.get("CONTAINS")}}}else{if(y>v){t=this.get("AFTER")}else{if(x<=v){t=this.get("CONTAINED_BY")}else{t=this.get("OVERLAP_END")}}}return t},contains:function(t){return this.compute_overlap(t)===this.get("CONTAINS")},overlaps:function(t){return _.intersection([this.compute_overlap(t)],[this.get("DIF_CHROMS"),this.get("BEFORE"),this.get("AFTER")]).length===0}});var l=Backbone.Collection.extend({model:h});var e=Backbone.RelationalModel.extend({defaults:{region:null,note:""},relations:[{type:Backbone.HasOne,key:"region",relatedModel:h}]});var q=Backbone.Collection.extend({model:e});var b=Backbone.Model.extend({defaults:{data:null,min:0,max:0},initialize:function(u){var t=_.flatten(_.map(this.get("data"),function(v){if(v.data.length!==0){return _.map(v.data,function(w){return w[1]})}else{return 0}}));this.set("max",_.max(t));this.set("min",_.min(t))}});var m=Backbone.RelationalModel.extend({defaults:{data:null,min:0,max:0},initialize:function(u){var t=_.max(this.get("data"),function(v){if(!v||typeof v==="string"){return 0}return v[1]});this.attributes.max=(t&&typeof t!=="string"?t[1]:0)}});var s=Dataset.extend({initialize:function(t){this.set("id",t.dataset_id);var v=this.get("genome_wide_data");if(v){var u=(this.get("track_type")==="LineTrack"?b:m);this.set("genome_wide_data",new u(v))}}});var o=Backbone.RelationalModel.extend({defaults:{id:"",title:"",type:"",dbkey:"",tracks:null},relations:[{type:Backbone.HasMany,key:"tracks",relatedModel:s}],url:function(){return galaxy_paths.get("visualization_url")},save:function(){return $.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var k=o.extend({defaults:_.extend({},o.prototype.defaults,{bookmarks:null,viewport:null})});var a=Backbone.Model.extend({});var i=Backbone.Router.extend({initialize:function(u){this.view=u.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var t=this;t.view.on("navigate",function(v){t.navigate(v)})},change_location:function(t){this.view.go_to(t)}});var j=function(t,v,u){$.ajax({url:t,data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(w){show_modal("Select datasets for new tracks",w,{Cancel:function(){hide_modal()},Add:function(){var x=[];$("input[name=id]:checked,input[name=ldda_ids]:checked").each(function(){var y,z=$(this).val();if($(this).attr("name")==="id"){y={hda_id:z}}else{y={ldda_id:z}}x[x.length]=$.ajax({url:v,data:y,dataType:"json"})});$.when.apply($,x).then(function(){var y=(arguments[0] instanceof Array?$.map(arguments,function(z){return z[0]}):[arguments[0]]);u(y)});hide_modal()}})}})};var r=(function(){if(typeof module!=="undefined"&&module.exports){return module.exports}else{if(typeof define==="function"&&define.amd){r={};define(function(){return r});return r}else{return window}}})();r.BrowserBookmark=e;r.BrowserBookmarkCollection=q;r.Cache=p;r.CanvasManager=g;r.Genome=c;r.GenomeDataManager=d;r.GenomeRegion=h;r.GenomeRegionCollection=l;r.GenomeVisualization=k;r.GenomeWideBigWigData=b;r.GenomeWideSummaryTreeData=m;r.ReferenceTrackDataManager=n;r.ServerStateDeferred=f;r.TrackBrowserRouter=i;r.TrackConfig=a;r.Visualization=o;r.add_datasets=j}).call(this);
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/common-templates.html
--- a/static/scripts/templates/common-templates.html
+++ b/static/scripts/templates/common-templates.html
@@ -1,3 +1,50 @@
+<script type="text/javascript" class="helper-common" id="helper-clearFloatDiv">
+/** Hack div to clear re-enclose float'd elements above it in the parent div
+ */
+Handlebars.registerPartial( 'clearFloatDiv', function( options ){
+ return '<div class="clear"></div>';
+});
+</script>
+
+<script type="text/javascript" class="helper-common" id="helper-warningmessagesmall">
+/** Renders a warning in a (mostly css) highlighted, iconned warning box
+ */
+Handlebars.registerHelper( 'warningmessagesmall', function( options ){
+ return '<div class="warningmessagesmall"><strong>' + options.fn( this ) + '</strong></div>'
+});
+</script>
+
<script type="text/template" class="template-common" id="template-warningmessagesmall">
- <div class=warningmessagesmall><strong>{{{warning}}}</strong></div>
+{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
+ <div class="warningmessagesmall"><strong>{{ warning }}</strong></div></script>
+
+<script type="text/javascript" class="helper-common" id="helper-iconButton">
+/** Renders a glx style icon-button (see IconButton in mvc/ui.js)
+ * can be used in either of the following ways:
+ * within a template: {{> iconButton buttonData}}
+ * from js: var templated = ( Handlebars.partials.iconButton( buttonData ) );
+ */
+Handlebars.registerPartial( 'iconButton', function( buttonData, options ){
+ var buffer = "";
+ buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
+
+ if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+
+ buffer += ' class="icon-button';
+ if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
+ if( buttonData.title ){ buffer += ' tooltip'; }
+ buffer += ' ' + buttonData.icon_class;
+ if( !buttonData.enabled ){ buffer += '_disabled'; }
+ buffer += '"';
+
+ if( buttonData.id ){ buffer += ' id="' + buttonData.id + '"'; }
+ buffer += ' href="' + ( ( buttonData.href )?( buttonData.href ):( 'javascript:void(0);' ) ) + '"';
+ if( buttonData.target ){ buffer += ' target="' + buttonData.target + '"'; }
+
+ if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
+
+ buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ return buffer;
+});
+</script>
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/compiled/helpers-common-templates.js
--- /dev/null
+++ b/static/scripts/templates/compiled/helpers-common-templates.js
@@ -0,0 +1,37 @@
+/** Hack div to clear re-enclose float'd elements above it in the parent div
+ */
+Handlebars.registerPartial( 'clearFloatDiv', function( options ){
+ return '<div class="clear"></div>';
+});
+/** Renders a glx style icon-button (see IconButton in mvc/ui.js)
+ * can be used in either of the following ways:
+ * within a template: {{> iconButton buttonData}}
+ * from js: var templated = ( Handlebars.partials.iconButton( buttonData ) );
+ */
+Handlebars.registerPartial( 'iconButton', function( buttonData, options ){
+ var buffer = "";
+ buffer += ( buttonData.enabled )?( '<a' ):( '<span' );
+
+ if( buttonData.title ){ buttonData.buffer += ' title="' + buttonData.title + '"'; }
+
+ buffer += ' class="icon-button';
+ if( buttonData.isMenuButton ){ buffer += ' menu-button'; }
+ if( buttonData.title ){ buffer += ' tooltip'; }
+ buffer += ' ' + buttonData.icon_class;
+ if( !buttonData.enabled ){ buffer += '_disabled'; }
+ buffer += '"';
+
+ if( buttonData.id ){ buffer += ' id="' + buttonData.id + '"'; }
+ buffer += ' href="' + ( ( buttonData.href )?( buttonData.href ):( 'javascript:void(0);' ) ) + '"';
+ if( buttonData.target ){ buffer += ' target="' + buttonData.target + '"'; }
+
+ if( !buttonData.visible ){ buffer += ' style="display: none;"'; }
+
+ buffer += '>Bler' + ( ( buttonData.enabled )?( '</a>' ):( '</span>' ) );
+ return buffer;
+});
+/** Renders a warning in a (mostly css) highlighted, iconned warning box
+ */
+Handlebars.registerHelper( 'warningmessagesmall', function( options ){
+ return '<div class="warningmessagesmall"><strong>' + options.fn( this ) + '</strong></div>'
+});
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/compiled/template-history-hdaSummary.js
--- a/static/scripts/templates/compiled/template-history-hdaSummary.js
+++ b/static/scripts/templates/compiled/template-history-hdaSummary.js
@@ -2,8 +2,35 @@
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-history-hdaSummary'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression;
+ var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression, self=this;
+function program1(depth0,data) {
+
+ var buffer = "", stack1, foundHelper;
+ buffer += "\n <a href=\"";
+ foundHelper = helpers.edit_url;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.edit_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "\" target=\"galaxy_main\">";
+ foundHelper = helpers.metadata_dbkey;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.metadata_dbkey; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "</a>\n";
+ return buffer;}
+
+function program3(depth0,data) {
+
+ var buffer = "", stack1, foundHelper;
+ buffer += "\n <span class=\"";
+ foundHelper = helpers.metadata_dbkey;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.metadata_dbkey; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "\">";
+ foundHelper = helpers.metadata_dbkey;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.metadata_dbkey; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "</span>\n";
+ return buffer;}
foundHelper = helpers.misc_blurb;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
@@ -16,10 +43,9 @@
foundHelper = helpers.data_type;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.data_type; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + "</span>, ',\ndatabase: ";
- foundHelper = helpers.dbkeyHTML;
- if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
- else { stack1 = depth0.dbkeyHTML; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1);
+ buffer += escapeExpression(stack1) + "</span>,\ndatabase:\n";
+ stack1 = depth0.dbkey_unknown_and_editable;
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data)});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
return buffer;});
})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/compiled/template-history-titleLink.js
--- /dev/null
+++ b/static/scripts/templates/compiled/template-history-titleLink.js
@@ -0,0 +1,18 @@
+(function() {
+ var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+templates['template-history-titleLink'] = template(function (Handlebars,depth0,helpers,partials,data) {
+ helpers = helpers || Handlebars.helpers;
+ var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression;
+
+
+ buffer += "<a href=\"javascript:void(0);\"><span class=\"historyItemTitle\">";
+ foundHelper = helpers.hid;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.hid; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + ": ";
+ foundHelper = helpers.name;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
+ else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ buffer += escapeExpression(stack1) + "</span></a>";
+ return buffer;});
+})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/compiled/template-history-warning-messages.js
--- a/static/scripts/templates/compiled/template-history-warning-messages.js
+++ b/static/scripts/templates/compiled/template-history-warning-messages.js
@@ -2,21 +2,30 @@
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-history-warning-messages'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
function program1(depth0,data) {
- var buffer = "", stack1;
- buffer += "\n<div class=warningmessagesmall><strong>\nThis dataset has been deleted.\n ";
- stack1 = depth0.undelete_url;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(2, program2, data)});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n</strong></div>\n";
- return buffer;}
+ var stack1, foundHelper;
+ foundHelper = helpers.warningmessagesmall;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{},inverse:self.noop,fn:self.program(2, program2, data)}); }
+ else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(2, program2, data)}); }
+ if(stack1 || stack1 === 0) { return stack1; }
+ else { return ''; }}
function program2(depth0,data) {
+ var buffer = "", stack1;
+ buffer += "\n This dataset has been deleted.\n ";
+ stack1 = depth0.undelete_url;
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(3, program3, data)});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n";
+ return buffer;}
+function program3(depth0,data) {
+
var buffer = "", stack1, foundHelper;
- buffer += "\n Click <a href=\"";
+ buffer += "\n Click <a href=\"";
foundHelper = helpers.undelete_url;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.undelete_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
@@ -24,16 +33,16 @@
foundHelper = helpers.id;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + "\"\n target=\"galaxy_history\">here</a> to undelete it\n ";
+ buffer += escapeExpression(stack1) + "\"\n target=\"galaxy_history\">here</a> to undelete it\n ";
stack1 = depth0.purge_url;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(3, program3, data)});
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(4, program4, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;}
-function program3(depth0,data) {
+function program4(depth0,data) {
var buffer = "", stack1, foundHelper;
- buffer += "\n or\n <a href=\"";
+ buffer += "\n or <a href=\"";
foundHelper = helpers.purge_url;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.purge_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
@@ -44,24 +53,42 @@
buffer += escapeExpression(stack1) + "\"\n target=\"galaxy_history\">here</a> to immediately remove it from disk\n ";
return buffer;}
-function program5(depth0,data) {
+function program6(depth0,data) {
-
- return "\n<div class=warningmessagesmall><strong>\nThis dataset has been deleted and removed from disk.\n</strong></div>\n";}
-
+ var stack1, foundHelper;
+ foundHelper = helpers.warningmessagesmall;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{},inverse:self.noop,fn:self.program(7, program7, data)}); }
+ else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(7, program7, data)}); }
+ if(stack1 || stack1 === 0) { return stack1; }
+ else { return ''; }}
function program7(depth0,data) {
+
+ return "\n This dataset has been deleted and removed from disk.\n";}
+
+function program9(depth0,data) {
+
+ var stack1, foundHelper;
+ foundHelper = helpers.warningmessagesmall;
+ if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{},inverse:self.noop,fn:self.program(10, program10, data)}); }
+ else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
+ if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(10, program10, data)}); }
+ if(stack1 || stack1 === 0) { return stack1; }
+ else { return ''; }}
+function program10(depth0,data) {
+
var buffer = "", stack1;
- buffer += "\n<div class=warningmessagesmall><strong>\nThis dataset has been hidden.\n ";
+ buffer += "\n This dataset has been hidden.\n ";
stack1 = depth0.undelete_url;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(8, program8, data)});
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(11, program11, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n</strong></div>\n";
+ buffer += "\n";
return buffer;}
-function program8(depth0,data) {
+function program11(depth0,data) {
var buffer = "", stack1, foundHelper;
- buffer += "\n Click <a href=\"";
+ buffer += "\n Click <a href=\"";
foundHelper = helpers.unhide_url;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.unhide_url; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
@@ -69,7 +96,7 @@
foundHelper = helpers.id;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + "\"\n target=\"galaxy_history\">here</a> to unhide it\n ";
+ buffer += escapeExpression(stack1) + "\"\n target=\"galaxy_history\">here</a> to unhide it\n ";
return buffer;}
stack1 = depth0.deleted;
@@ -77,11 +104,11 @@
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n\n";
stack1 = depth0.purged;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(5, program5, data)});
+ stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(6, program6, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n\n";
stack1 = depth0.visible;
- stack1 = helpers.unless.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(7, program7, data)});
+ stack1 = helpers.unless.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(9, program9, data)});
if(stack1 || stack1 === 0) { buffer += stack1; }
return buffer;});
})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/compiled/template-warningmessagesmall.js
--- a/static/scripts/templates/compiled/template-warningmessagesmall.js
+++ b/static/scripts/templates/compiled/template-warningmessagesmall.js
@@ -2,14 +2,13 @@
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-warningmessagesmall'] = template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, foundHelper, functionType="function";
+ var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression;
- buffer += "<div class=warningmessagesmall><strong>";
+ buffer += " \n <div class=\"warningmessagesmall\"><strong>";
foundHelper = helpers.warning;
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
else { stack1 = depth0.warning; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</strong></div>";
+ buffer += escapeExpression(stack1) + "</strong></div>";
return buffer;});
})();
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/history-templates.html
--- a/static/scripts/templates/history-templates.html
+++ b/static/scripts/templates/history-templates.html
@@ -1,38 +1,40 @@
<script type="text/template" class="template-history" id="template-history-warning-messages">
-{{#if deleted}}
-<div class=warningmessagesmall><strong>
-This dataset has been deleted.
+{{#if deleted}}{{#warningmessagesmall}}
+ This dataset has been deleted.
{{#if undelete_url}}
- Click <a href="{{ undelete_url }}" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}"
- target="galaxy_history">here</a> to undelete it
+ Click <a href="{{ undelete_url }}" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}"
+ target="galaxy_history">here</a> to undelete it
{{#if purge_url}}
- or
- <a href="{{ purge_url }}" class="historyItemPurge" id="historyItemPurger-{{ id }}"
+ or <a href="{{ purge_url }}" class="historyItemPurge" id="historyItemPurger-{{ id }}"
target="galaxy_history">here</a> to immediately remove it from disk
{{/if}}
{{/if}}
-</strong></div>
-{{/if}}
+{{/warningmessagesmall}}{{/if}}
-{{#if purged}}
-<div class=warningmessagesmall><strong>
-This dataset has been deleted and removed from disk.
-</strong></div>
-{{/if}}
+{{#if purged}}{{#warningmessagesmall}}
+ This dataset has been deleted and removed from disk.
+{{/warningmessagesmall}}{{/if}}
-{{#unless visible}}
-<div class=warningmessagesmall><strong>
-This dataset has been hidden.
+{{#unless visible}}{{#warningmessagesmall}}
+ This dataset has been hidden.
{{#if undelete_url}}
- Click <a href="{{ unhide_url }}" class="historyItemUnhide" id="historyItemUnhider-{{ id }}"
- target="galaxy_history">here</a> to unhide it
+ Click <a href="{{ unhide_url }}" class="historyItemUnhide" id="historyItemUnhider-{{ id }}"
+ target="galaxy_history">here</a> to unhide it
{{/if}}
-</strong></div>
-{{/unless}}
+{{/warningmessagesmall}}{{/unless}}
+</script>
+
+<script type="text/template" class="template-history" id="template-history-titleLink">
+<a href="javascript:void(0);"><span class="historyItemTitle">{{ hid }}: {{ name }}</span></a></script><script type="text/template" class="template-history" id="template-history-hdaSummary">
{{ misc_blurb }}<br />
-format: <span class="{{ data_type }}">{{ data_type }}</span>, ',
-database: {{ dbkeyHTML }}
+format: <span class="{{ data_type }}">{{ data_type }}</span>,
+database:
+{{#if dbkey_unknown_and_editable }}
+ <a href="{{ edit_url }}" target="galaxy_main">{{ metadata_dbkey }}</a>
+{{else}}
+ <span class="{{ metadata_dbkey }}">{{ metadata_dbkey }}</span>
+{{/if}}
</script>
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/template-history-hdaSummary.handlebars
--- a/static/scripts/templates/template-history-hdaSummary.handlebars
+++ b/static/scripts/templates/template-history-hdaSummary.handlebars
@@ -1,3 +1,8 @@
{{ misc_blurb }}<br />
-format: <span class="{{ data_type }}">{{ data_type }}</span>, ',
-database: {{ dbkeyHTML }}
\ No newline at end of file
+format: <span class="{{ data_type }}">{{ data_type }}</span>,
+database:
+{{#if dbkey_unknown_and_editable }}
+ <a href="{{ edit_url }}" target="galaxy_main">{{ metadata_dbkey }}</a>
+{{else}}
+ <span class="{{ metadata_dbkey }}">{{ metadata_dbkey }}</span>
+{{/if}}
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/template-history-titleLink.handlebars
--- /dev/null
+++ b/static/scripts/templates/template-history-titleLink.handlebars
@@ -0,0 +1,1 @@
+<a href="javascript:void(0);"><span class="historyItemTitle">{{ hid }}: {{ name }}</span></a>
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/template-history-warning-messages.handlebars
--- a/static/scripts/templates/template-history-warning-messages.handlebars
+++ b/static/scripts/templates/template-history-warning-messages.handlebars
@@ -1,30 +1,23 @@
-{{#if deleted}}
-<div class=warningmessagesmall><strong>
-This dataset has been deleted.
+{{#if deleted}}{{#warningmessagesmall}}
+ This dataset has been deleted.
{{#if undelete_url}}
- Click <a href="{{ undelete_url }}" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}"
- target="galaxy_history">here</a> to undelete it
+ Click <a href="{{ undelete_url }}" class="historyItemUndelete" id="historyItemUndeleter-{{ id }}"
+ target="galaxy_history">here</a> to undelete it
{{#if purge_url}}
- or
- <a href="{{ purge_url }}" class="historyItemPurge" id="historyItemPurger-{{ id }}"
+ or <a href="{{ purge_url }}" class="historyItemPurge" id="historyItemPurger-{{ id }}"
target="galaxy_history">here</a> to immediately remove it from disk
{{/if}}
{{/if}}
-</strong></div>
-{{/if}}
+{{/warningmessagesmall}}{{/if}}
-{{#if purged}}
-<div class=warningmessagesmall><strong>
-This dataset has been deleted and removed from disk.
-</strong></div>
-{{/if}}
+{{#if purged}}{{#warningmessagesmall}}
+ This dataset has been deleted and removed from disk.
+{{/warningmessagesmall}}{{/if}}
-{{#unless visible}}
-<div class=warningmessagesmall><strong>
-This dataset has been hidden.
+{{#unless visible}}{{#warningmessagesmall}}
+ This dataset has been hidden.
{{#if undelete_url}}
- Click <a href="{{ unhide_url }}" class="historyItemUnhide" id="historyItemUnhider-{{ id }}"
- target="galaxy_history">here</a> to unhide it
+ Click <a href="{{ unhide_url }}" class="historyItemUnhide" id="historyItemUnhider-{{ id }}"
+ target="galaxy_history">here</a> to unhide it
{{/if}}
-</strong></div>
-{{/unless}}
\ No newline at end of file
+{{/warningmessagesmall}}{{/unless}}
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 static/scripts/templates/template-warningmessagesmall.handlebars
--- a/static/scripts/templates/template-warningmessagesmall.handlebars
+++ b/static/scripts/templates/template-warningmessagesmall.handlebars
@@ -1,1 +1,2 @@
-<div class=warningmessagesmall><strong>{{{warning}}}</strong></div>
\ No newline at end of file
+{{! renders a warning in a (mostly css) highlighted, iconned warning box }}
+ <div class="warningmessagesmall"><strong>{{ warning }}</strong></div>
\ No newline at end of file
diff -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 -r 802b87d6491087f6e82d8490d0d603b7affc3491 templates/root/alternate_history.mako
--- a/templates/root/alternate_history.mako
+++ b/templates/root/alternate_history.mako
@@ -116,13 +116,17 @@
add_to_data( edit_url=edit_url )
# delete button
- if for_editing and not ( dataset_purged or purged ):
- add_to_data( delete_url=h.url_for( controller='dataset', action='delete', dataset_id=encoded_data_id ) )
+ if for_editing and not ( deleted or dataset_purged or purged ):
+ add_to_data( delete_url=h.url_for( controller='dataset', action='delete', dataset_id=encoded_data_id,
##TODO: loose end
- ##show_deleted_on_refresh=show_deleted_on_refresh ) )
- #show_deleted_on_refresh=False ) )
+ show_deleted_on_refresh=show_deleted
+ ))
- #print app
+ # error report
+ if for_editing:
+ #NOTE: no state == 'error' check
+ add_to_data( report_error_url=h.url_for( h.url_for( controller='dataset', action='errors', id=encoded_data_id ) ) )
+
if hda.ext in app.datatypes_registry.get_available_tracks():
# do these need _localized_ dbkeys?
trackster_urls = {}
@@ -209,7 +213,7 @@
data_dict.update( kwargs )
# trans
- add_to_data( non_encoded_id=data.id )
+ add_to_data( hid=data.hid )
encoded_data_id = trans.security.encode_id( data.id )
add_to_data( id=encoded_data_id )
@@ -294,9 +298,9 @@
${h.templates(
"helpers-common-templates",
- "template-warningmessagesmall",
"template-history-warning-messages",
+ "template-history-titleLink",
"template-history-hdaSummary"
)}
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/changeset/6aadac8026cb/
changeset: 6aadac8026cb
user: greg
date: 2012-09-13 17:21:51
summary: Add support for a new <set_environment> tag set in a tool shed repository's tool_dependencies.xml file. This new tag set is defined outside of <package> tag sets, and allows for setting environment variables to point to tool dependency files (scripts, binaries, etc) that are included in the installed repository.
affected #: 12 files
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -2996,12 +2996,20 @@
self.status = status
self.error_message = error_message
def installation_directory( self, app ):
- return os.path.join( app.config.tool_dependency_dir,
- self.name,
- self.version,
- self.tool_shed_repository.owner,
- self.tool_shed_repository.name,
- self.tool_shed_repository.installed_changeset_revision )
+ if self.type == 'package':
+ return os.path.join( app.config.tool_dependency_dir,
+ self.name,
+ self.version,
+ self.tool_shed_repository.owner,
+ self.tool_shed_repository.name,
+ self.tool_shed_repository.installed_changeset_revision )
+ if self.type == 'set_environment':
+ return os.path.join( app.config.tool_dependency_dir,
+ 'environment_settings',
+ self.name,
+ self.tool_shed_repository.owner,
+ self.tool_shed_repository.name,
+ self.tool_shed_repository.installed_changeset_revision )
class ToolVersion( object ):
def __init__( self, id=None, create_time=None, tool_id=None, tool_shed_repository=None ):
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/tool_shed/tool_dependencies/common_util.py
--- a/lib/galaxy/tool_shed/tool_dependencies/common_util.py
+++ b/lib/galaxy/tool_shed/tool_dependencies/common_util.py
@@ -1,6 +1,47 @@
import os, shutil, tarfile, urllib2
from galaxy.datatypes.checkers import *
+def create_env_var_dict( elem, tool_dependency_install_dir=None, tool_shed_repository_install_dir=None ):
+ env_var_name = elem.get( 'name', 'PATH' )
+ env_var_action = elem.get( 'action', 'prepend_to' )
+ env_var_text = None
+ if elem.text and elem.text.find( 'REPOSITORY_INSTALL_DIR' ) >= 0:
+ if tool_shed_repository_install_dir:
+ env_var_text = elem.text.replace( '$REPOSITORY_INSTALL_DIR', tool_shed_repository_install_dir )
+ return dict( name=env_var_name, action=env_var_action, value=env_var_text )
+ else:
+ env_var_text = elem.text.replace( '$REPOSITORY_INSTALL_DIR', tool_dependency_install_dir )
+ return dict( name=env_var_name, action=env_var_action, value=env_var_text )
+ if elem.text and elem.text.find( 'INSTALL_DIR' ) >= 0:
+ if tool_dependency_install_dir:
+ env_var_text = elem.text.replace( '$INSTALL_DIR', tool_dependency_install_dir )
+ return dict( name=env_var_name, action=env_var_action, value=env_var_text )
+ else:
+ env_var_text = elem.text.replace( '$INSTALL_DIR', tool_shed_repository_install_dir )
+ return dict( name=env_var_name, action=env_var_action, value=env_var_text )
+ return None
+def create_or_update_env_shell_file( install_dir, env_var_dict ):
+ env_var_name = env_var_dict[ 'name' ]
+ env_var_action = env_var_dict[ 'action' ]
+ env_var_value = env_var_dict[ 'value' ]
+ if env_var_action == 'prepend_to':
+ changed_value = '%s:$%s' % ( env_var_value, env_var_name )
+ elif env_var_action == 'set_to':
+ changed_value = '%s' % env_var_value
+ elif env_var_action == 'append_to':
+ changed_value = '$%s:%s' % ( env_var_name, env_var_value )
+ env_shell_file_path = '%s/env.sh' % install_dir
+ if os.path.exists( env_shell_file_path ):
+ write_action = '>>'
+ else:
+ write_action = '>'
+ cmd = "echo '%s=%s; export %s' %s %s;chmod +x %s" % ( env_var_name,
+ changed_value,
+ env_var_name,
+ write_action,
+ env_shell_file_path,
+ env_shell_file_path )
+ return cmd
def extract_tar( file_name, file_path ):
if isgzip( file_name ) or isbz2( file_name ):
# Open for reading with transparent compression.
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/tool_shed/tool_dependencies/fabric_util.py
--- a/lib/galaxy/tool_shed/tool_dependencies/fabric_util.py
+++ b/lib/galaxy/tool_shed/tool_dependencies/fabric_util.py
@@ -34,10 +34,8 @@
yield work_dir
if os.path.exists( work_dir ):
local( 'rm -rf %s' % work_dir )
-def handle_post_build_processing( app, tool_dependency, install_dir, env_dependency_path, package_name=None ):
- # TODO: This method is deprecated and should be eliminated when the implementation for handling proprietary fabric scripts is implemented.
+def handle_command( app, tool_dependency, install_dir, cmd ):
sa_session = app.model.context.current
- cmd = "echo 'PATH=%s:$PATH; export PATH' > %s/env.sh;chmod +x %s/env.sh" % ( env_dependency_path, install_dir, install_dir )
output = local( cmd, capture=True )
log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
if output.return_code:
@@ -45,6 +43,7 @@
tool_dependency.error_message = str( output.stderr )
sa_session.add( tool_dependency )
sa_session.flush()
+ return output.return_code
def install_and_build_package( app, tool_dependency, actions_dict ):
"""Install a Galaxy tool dependency package either via a url or a mercurial or git clone command."""
sa_session = app.model.context.current
@@ -71,14 +70,8 @@
dir = work_dir
elif action_type == 'shell_command':
# <action type="shell_command">git clone --recursive git://github.com/ekg/freebayes.git</action>
- clone_cmd = action_dict[ 'command' ]
- output = local( clone_cmd, capture=True )
- log_results( clone_cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
- if output.return_code:
- tool_dependency.status = app.model.ToolDependency.installation_status.ERROR
- tool_dependency.error_message = str( output.stderr )
- sa_session.add( tool_dependency )
- sa_session.flush()
+ return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
+ if return_code:
return
dir = package_name
if not os.path.exists( dir ):
@@ -102,44 +95,14 @@
# Currently the only action supported in this category is "environment_variable".
env_var_dicts = action_dict[ 'environment_variable' ]
for env_var_dict in env_var_dicts:
- env_var_name = env_var_dict[ 'name' ]
- env_var_action = env_var_dict[ 'action' ]
- env_var_value = env_var_dict[ 'value' ]
- if env_var_action == 'prepend_to':
- changed_value = '%s:$%s' % ( env_var_value, env_var_name )
- elif env_var_action == 'set_to':
- changed_value = '%s' % env_var_value
- elif env_var_action == 'append_to':
- changed_value = '$%s:%s' % ( env_var_name, env_var_value )
- env_shell_file_path = '%s/env.sh' % install_dir
- if os.path.exists( env_shell_file_path ):
- write_action = '>>'
- else:
- write_action = '>'
- cmd = "echo '%s=%s; export %s' %s %s;chmod +x %s" % ( env_var_name,
- changed_value,
- env_var_name,
- write_action,
- env_shell_file_path,
- env_shell_file_path )
- output = local( cmd, capture=True )
- log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
- if output.return_code:
- tool_dependency.status = app.model.ToolDependency.installation_status.ERROR
- tool_dependency.error_message = str( output.stderr )
- sa_session.add( tool_dependency )
- sa_session.flush()
+ cmd = common_util.create_or_update_env_shell_file( install_dir, env_var_dict )
+ return_code = handle_command( app, tool_dependency, install_dir, cmd )
+ if return_code:
return
elif action_type == 'shell_command':
- action = action_dict[ 'command' ]
with settings( warn_only=True ):
- output = local( action, capture=True )
- log_results( action, output, os.path.join( install_dir, INSTALLATION_LOG ) )
- if output.return_code:
- tool_dependency.status = app.model.ToolDependency.installation_status.ERROR
- tool_dependency.error_message = str( output.stderr )
- sa_session.add( tool_dependency )
- sa_session.flush()
+ return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
+ if return_code:
return
def log_results( command, fabric_AttributeString, file_path ):
"""
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/tool_shed/tool_dependencies/install_util.py
--- a/lib/galaxy/tool_shed/tool_dependencies/install_util.py
+++ b/lib/galaxy/tool_shed/tool_dependencies/install_util.py
@@ -15,7 +15,10 @@
# Called from Galaxy (never the tool shed) when a new repository is being installed or when an uninstalled repository is being reinstalled.
sa_session = app.model.context.current
# First see if an appropriate tool_dependency record exists for the received tool_shed_repository.
- tool_dependency = get_tool_dependency_by_name_version_type_repository( app, tool_shed_repository, name, version, type )
+ if version:
+ tool_dependency = get_tool_dependency_by_name_version_type_repository( app, tool_shed_repository, name, version, type )
+ else:
+ tool_dependency = get_tool_dependency_by_name_type_repository( app, tool_shed_repository, name, type )
if tool_dependency:
if set_status:
tool_dependency.status = status
@@ -25,6 +28,13 @@
sa_session.add( tool_dependency )
sa_session.flush()
return tool_dependency
+def get_tool_dependency_by_name_type_repository( app, repository, name, type ):
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.ToolDependency ) \
+ .filter( and_( app.model.ToolDependency.table.c.tool_shed_repository_id == repository.id,
+ app.model.ToolDependency.table.c.name == name,
+ app.model.ToolDependency.table.c.type == type ) ) \
+ .first()
def get_tool_dependency_by_name_version_type_repository( app, repository, name, version, type ):
sa_session = app.model.context.current
return sa_session.query( app.model.ToolDependency ) \
@@ -33,13 +43,23 @@
app.model.ToolDependency.table.c.version == version,
app.model.ToolDependency.table.c.type == type ) ) \
.first()
-def get_tool_dependency_install_dir( app, repository, package_name, package_version ):
- return os.path.abspath( os.path.join( app.config.tool_dependency_dir,
- package_name,
- package_version,
- repository.owner,
- repository.name,
- repository.installed_changeset_revision ) )
+def get_tool_dependency_install_dir( app, repository, type, name, version ):
+ if type == 'package':
+ return os.path.abspath( os.path.join( app.config.tool_dependency_dir,
+ name,
+ version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision ) )
+ if type == 'set_environment':
+ return os.path.abspath( os.path.join( app.config.tool_dependency_dir,
+ 'environment_settings',
+ name,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision ) )
+def get_tool_shed_repository_install_dir( app, tool_shed_repository ):
+ return os.path.abspath( tool_shed_repository.repo_files_directory( app ) )
def install_package( app, elem, tool_shed_repository, tool_dependencies=None ):
# The value of tool_dependencies is a partial or full list of ToolDependency records associated with the tool_shed_repository.
sa_session = app.model.context.current
@@ -49,7 +69,11 @@
package_version = elem.get( 'version', None )
if package_name and package_version:
if tool_dependencies:
- install_dir = get_tool_dependency_install_dir( app, tool_shed_repository, package_name, package_version )
+ install_dir = get_tool_dependency_install_dir( app,
+ repository=tool_shed_repository,
+ type='package',
+ name=package_name,
+ version=package_version )
if not os.path.exists( install_dir ):
for package_elem in elem:
if package_elem.tag == 'install':
@@ -140,11 +164,9 @@
env_var_dicts = []
for env_elem in action_elem:
if env_elem.tag == 'environment_variable':
- env_var_name = env_elem.get( 'name', 'PATH' )
- env_var_action = env_elem.get( 'action', 'prepend_to' )
- env_var_text = env_elem.text.replace( '$INSTALL_DIR', install_dir )
- if env_var_text:
- env_var_dicts.append( dict( name=env_var_name, action=env_var_action, value=env_var_text ) )
+ env_var_dict = create_env_var_dict( env_elem, tool_dependency_install_dir=install_dir )
+ if env_var_dict:
+ env_var_dicts.append( env_var_dict )
if env_var_dicts:
action_dict[ env_elem.tag ] = env_var_dicts
else:
@@ -206,11 +228,7 @@
return "Exception executing fabric script %s: %s. " % ( str( proprietary_fabfile_path ), str( e ) )
if returncode:
return message
- message = handle_post_build_processing( app, tool_dependency, install_dir, env_dependency_path, package_name=package_name )
- if message:
- return message
- else:
- return ''
+ handle_environment_settings( app, tool_dependency, install_dir, cmd )
def run_subprocess( app, cmd ):
env = os.environ
PYTHONPATH = env.get( 'PYTHONPATH', '' )
@@ -229,3 +247,47 @@
message = '%s\n' % str( tmp_stderr.read() )
tmp_stderr.close()
return returncode, message
+def set_environment( app, elem, tool_shed_repository ):
+ """
+ Create a ToolDependency to set an environment variable. This is different from the process used to set an environment variable that is associated
+ with a package. An example entry in a tool_dependencies.xml file is:
+ <set_environment version="1.0">
+ <environment_variable name="R_SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
+ </set_environment>
+ """
+ sa_session = app.model.context.current
+ tool_dependency = None
+ env_var_version = elem.get( 'version', '1.0' )
+ for env_var_elem in elem:
+ # The value of env_var_name must match the text value of at least 1 <requirement> tag in the tool config's <requirements> tag set whose
+ # "type" attribute is "set_environment" (e.g., <requirement type="set_environment">R_SCRIPT_PATH</requirement>).
+ env_var_name = env_var_elem.get( 'name', None )
+ env_var_action = env_var_elem.get( 'action', None )
+ if env_var_name and env_var_action:
+ install_dir = get_tool_dependency_install_dir( app,
+ repository=tool_shed_repository,
+ type='set_environment',
+ name=env_var_name,
+ version=None )
+ tool_shed_repository_install_dir = get_tool_shed_repository_install_dir( app, tool_shed_repository )
+ env_var_dict = create_env_var_dict( env_var_elem, tool_shed_repository_install_dir=tool_shed_repository_install_dir )
+ if env_var_dict:
+ if not os.path.exists( install_dir ):
+ os.makedirs( install_dir )
+ tool_dependency = create_or_update_tool_dependency( app,
+ tool_shed_repository,
+ name=env_var_name,
+ version=None,
+ type='set_environment',
+ status=app.model.ToolDependency.installation_status.INSTALLING,
+ set_status=True )
+ cmd = create_or_update_env_shell_file( install_dir, env_var_dict )
+ if env_var_version == '1.0':
+ # Handle setting environment variables using a fabric method.
+ handle_command( app, tool_dependency, install_dir, cmd )
+ sa_session.refresh( tool_dependency )
+ if tool_dependency.status != app.model.ToolDependency.installation_status.ERROR:
+ tool_dependency.status = app.model.ToolDependency.installation_status.INSTALLED
+ sa_session.add( tool_dependency )
+ sa_session.flush()
+ print 'Environment variable ', env_var_name, 'set in', install_dir
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2402,31 +2402,28 @@
command_line = self.interpreter + " " + command_line
return command_line
def build_dependency_shell_commands( self ):
- """
- Return a list of commands to be run to populate the current
- environment to include this tools requirements.
- """
+ """Return a list of commands to be run to populate the current environment to include this tools requirements."""
commands = []
if self.tool_shed_repository:
installed_tool_dependencies = self.tool_shed_repository.installed_tool_dependencies
else:
installed_tool_dependencies = None
for requirement in self.requirements:
- # TODO: currently only supporting requirements of type package,
- # need to implement some mechanism for mapping other types
- # back to packages
log.debug( "Building dependency shell command for dependency '%s'", requirement.name )
- if requirement.type == 'package':
+ script_file = None
+ base_path = None
+ version = None
+ if requirement.type in [ 'package', 'set_environment' ]:
script_file, base_path, version = self.app.toolbox.dependency_manager.find_dep( name=requirement.name,
version=requirement.version,
type=requirement.type,
installed_tool_dependencies=installed_tool_dependencies )
- if script_file is None and base_path is None:
- log.warn( "Failed to resolve dependency on '%s', ignoring", requirement.name )
- elif script_file is None:
- commands.append( 'PACKAGE_BASE=%s; export PACKAGE_BASE; PATH="%s/bin:$PATH"; export PATH' % ( base_path, base_path ) )
- else:
- commands.append( 'PACKAGE_BASE=%s; export PACKAGE_BASE; . %s' % ( base_path, script_file ) )
+ if script_file is None and base_path is None:
+ log.warn( "Failed to resolve dependency on '%s', ignoring", requirement.name )
+ elif requirement.type == 'package' and script_file is None:
+ commands.append( 'PACKAGE_BASE=%s; export PACKAGE_BASE; PATH="%s/bin:$PATH"; export PATH' % ( base_path, base_path ) )
+ else:
+ commands.append( 'PACKAGE_BASE=%s; export PACKAGE_BASE; . %s' % ( base_path, script_file ) )
return commands
def build_redirect_url_params( self, param_dict ):
"""
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/tools/deps/__init__.py
--- a/lib/galaxy/tools/deps/__init__.py
+++ b/lib/galaxy/tools/deps/__init__.py
@@ -9,14 +9,12 @@
class DependencyManager( object ):
"""
- A DependencyManager attempts to resolve named and versioned dependencies
- by searching for them under a list of directories. Directories should be
+ A DependencyManager attempts to resolve named and versioned dependencies by searching for them under a list of directories. Directories should be
of the form:
$BASE/name/version/...
- and should each contain a file 'env.sh' which can be sourced to make the
- dependency available in the current shell environment.
+ and should each contain a file 'env.sh' which can be sourced to make the dependency available in the current shell environment.
"""
def __init__( self, base_paths=[] ):
"""
@@ -32,31 +30,18 @@
self.base_paths.append( os.path.abspath( base_path ) )
def find_dep( self, name, version=None, type='package', installed_tool_dependencies=None ):
"""
- Attempt to find a dependency named `name` at version `version`. If
- version is None, return the "default" version as determined using a
- symbolic link (if found). Returns a triple of:
- env_script, base_path, real_version
+ Attempt to find a dependency named `name` at version `version`. If version is None, return the "default" version as determined using a
+ symbolic link (if found). Returns a triple of: env_script, base_path, real_version
"""
if version is None:
- return self._find_dep_default( name )
+ return self._find_dep_default( name, type=type, installed_tool_dependencies=installed_tool_dependencies )
else:
- return self._find_dep_versioned( name, version, installed_tool_dependencies=installed_tool_dependencies )
+ return self._find_dep_versioned( name, version, type=type, installed_tool_dependencies=installed_tool_dependencies )
def _find_dep_versioned( self, name, version, type='package', installed_tool_dependencies=None ):
- installed_dependency = None
- if installed_tool_dependencies:
- for installed_tool_dependency in installed_tool_dependencies:
- if installed_tool_dependency.name==name and installed_tool_dependency.version==version and installed_tool_dependency.type==type:
- installed_dependency = installed_tool_dependency
- break
+ installed_tool_dependency = self._get_installed_dependency( installed_tool_dependencies, name, type, version=version )
for base_path in self.base_paths:
- if installed_dependency:
- tool_shed_repository = installed_dependency.tool_shed_repository
- path = os.path.join( base_path,
- name,
- version,
- tool_shed_repository.owner,
- tool_shed_repository.name,
- tool_shed_repository.installed_changeset_revision )
+ if installed_tool_dependency:
+ path = self._get_package_installed_dependency_path( installed_tool_dependency, base_path, name, version )
else:
path = os.path.join( base_path, name, version )
script = os.path.join( path, 'env.sh' )
@@ -66,8 +51,14 @@
return None, path, version
else:
return None, None, None
- def _find_dep_default( self, name, type='package' ):
- version = None
+ def _find_dep_default( self, name, type='package', installed_tool_dependencies=None ):
+ if type == 'set_environment' and installed_tool_dependencies:
+ installed_tool_dependency = self._get_installed_dependency( installed_tool_dependencies, name, type, version=None )
+ if installed_tool_dependency:
+ script, path, version = self._get_set_environment_installed_dependency_script_path( installed_tool_dependency, name )
+ if script and path:
+ # Environment settings do not use versions.
+ return script, path, None
for base_path in self.base_paths:
path = os.path.join( base_path, name, 'default' )
if os.path.islink( path ):
@@ -81,3 +72,33 @@
return None, real_path, real_version
else:
return None, None, None
+ def _get_installed_dependency( self, installed_tool_dependencies, name, type, version=None ):
+ for installed_tool_dependency in installed_tool_dependencies:
+ if version:
+ if installed_tool_dependency.name==name and installed_tool_dependency.type==type and installed_tool_dependency.version==version:
+ return installed_tool_dependency
+ else:
+ if installed_tool_dependency.name==name and installed_tool_dependency.type==type:
+ return installed_tool_dependency
+ return None
+ def _get_package_installed_dependency_path( self, installed_tool_dependency, base_path, name, version ):
+ tool_shed_repository = installed_tool_dependency.tool_shed_repository
+ return os.path.join( base_path,
+ name,
+ version,
+ tool_shed_repository.owner,
+ tool_shed_repository.name,
+ tool_shed_repository.installed_changeset_revision )
+ def _get_set_environment_installed_dependency_script_path( self, installed_tool_dependency, name ):
+ tool_shed_repository = installed_tool_dependency.tool_shed_repository
+ for base_path in self.base_paths:
+ path = os.path.abspath( os.path.join( base_path,
+ 'environment_settings',
+ name,
+ tool_shed_repository.owner,
+ tool_shed_repository.name,
+ tool_shed_repository.installed_changeset_revision ) )
+ if os.path.exists( path ):
+ script = os.path.join( path, 'env.sh' )
+ return script, path, None
+ return None, None, None
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -7,7 +7,7 @@
from galaxy.datatypes.checkers import *
from galaxy.util.json import *
from galaxy.tools.search import ToolBoxSearch
-from galaxy.tool_shed.tool_dependencies.install_util import create_or_update_tool_dependency, install_package
+from galaxy.tool_shed.tool_dependencies.install_util import create_or_update_tool_dependency, install_package, set_environment
from galaxy.tool_shed.encoding_util import *
from galaxy.model.orm import *
@@ -255,26 +255,47 @@
"""
can_generate_dependency_metadata = False
for elem in root:
- can_generate_dependency_metadata = False
- tool_dependency_name = elem.get( 'name', None )
+ tool_dependency_type = elem.tag
tool_dependency_version = elem.get( 'version', None )
- tool_dependency_type = elem.tag
- if tool_dependency_name and tool_dependency_version and tool_dependency_type:
- for tool_dict in metadata_dict[ 'tools' ]:
- requirements = tool_dict.get( 'requirements', [] )
- for requirement_dict in requirements:
- req_name = requirement_dict.get( 'name', None )
- req_version = requirement_dict.get( 'version', None )
- req_type = requirement_dict.get( 'type', None )
- if req_name==tool_dependency_name and req_version==tool_dependency_version and req_type==tool_dependency_type:
- can_generate_dependency_metadata = True
+ if tool_dependency_type == 'package':
+ can_generate_dependency_metadata = False
+ tool_dependency_name = elem.get( 'name', None )
+ if tool_dependency_name and tool_dependency_version:
+ for tool_dict in metadata_dict[ 'tools' ]:
+ requirements = tool_dict.get( 'requirements', [] )
+ for requirement_dict in requirements:
+ req_name = requirement_dict.get( 'name', None )
+ req_version = requirement_dict.get( 'version', None )
+ req_type = requirement_dict.get( 'type', None )
+ if req_name==tool_dependency_name and req_version==tool_dependency_version and req_type==tool_dependency_type:
+ can_generate_dependency_metadata = True
+ break
+ if requirements and not can_generate_dependency_metadata:
+ # We've discovered at least 1 combination of name, version and type that is not defined in the <requirement>
+ # tag for any tool in the repository.
break
- if requirements and not can_generate_dependency_metadata:
- # We've discovered at least 1 combination of name, version and type that is not defined in the <requirement>
- # tag for any tool in the repository.
+ if not can_generate_dependency_metadata:
break
- if not can_generate_dependency_metadata:
- break
+ elif tool_dependency_type == 'set_environment':
+ # Here elem is something like: <set_environment version="1.0">
+ for env_var_elem in elem:
+ can_generate_dependency_metadata = False
+ # <environment_variable name="R_SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
+ env_var_name = env_var_elem.get( 'name', None )
+ if env_var_name:
+ for tool_dict in metadata_dict[ 'tools' ]:
+ requirements = tool_dict.get( 'requirements', [] )
+ for requirement_dict in requirements:
+ # {"name": "R_SCRIPT_PATH", "type": "set_environment", "version": null}
+ req_name = requirement_dict.get( 'name', None )
+ req_type = requirement_dict.get( 'type', None )
+ if req_name==env_var_name and req_type==tool_dependency_type:
+ can_generate_dependency_metadata = True
+ break
+ if requirements and not can_generate_dependency_metadata:
+ # We've discovered at least 1 combination of name, version and type that is not defined in the <requirement>
+ # tag for any tool in the repository.
+ break
return can_generate_dependency_metadata
def check_tool_input_params( app, repo_dir, tool_config_name, tool, sample_files, webapp='galaxy' ):
"""
@@ -466,23 +487,43 @@
tool_dependency_objects = []
# Get the tool_dependencies.xml file from the repository.
tool_dependencies_config = get_config_from_disk( 'tool_dependencies.xml', relative_install_dir )
- tree = ElementTree.parse( tool_dependencies_config )
+ try:
+ tree = ElementTree.parse( tool_dependencies_config )
+ except Exception, e:
+ log.debug( "Exception attempting to parse tool_dependencies.xml: %s" %str( e ) )
+ return tool_dependency_objects
root = tree.getroot()
ElementInclude.include( root )
fabric_version_checked = False
for elem in root:
- if elem.tag == 'package':
- package_name = elem.get( 'name', None )
- package_version = elem.get( 'version', None )
- if package_name and package_version:
+ tool_dependency_type = elem.tag
+ if tool_dependency_type == 'package':
+ name = elem.get( 'name', None )
+ version = elem.get( 'version', None )
+ if name and version:
tool_dependency = create_or_update_tool_dependency( app,
tool_shed_repository,
- name=package_name,
- version=package_version,
- type='package',
+ name=name,
+ version=version,
+ type=tool_dependency_type,
status=app.model.ToolDependency.installation_status.NEVER_INSTALLED,
set_status=set_status )
tool_dependency_objects.append( tool_dependency )
+
+ elif tool_dependency_type == 'set_environment':
+ for env_elem in elem:
+ # <environment_variable name="R_SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
+ name = env_elem.get( 'name', None )
+ action = env_elem.get( 'action', None )
+ if name and action:
+ tool_dependency = create_or_update_tool_dependency( app,
+ tool_shed_repository,
+ name=name,
+ version=None,
+ type=tool_dependency_type,
+ status=app.model.ToolDependency.installation_status.NEVER_INSTALLED,
+ set_status=set_status )
+ tool_dependency_objects.append( tool_dependency )
return tool_dependency_objects
def generate_clone_url( trans, repository ):
"""Generate the URL for cloning a repository."""
@@ -528,12 +569,30 @@
if datatypes:
metadata_dict[ 'datatypes' ] = datatypes
return metadata_dict
+def generate_environment_dependency_metadata( elem, tool_dependencies_dict ):
+ """The value of env_var_name must match the value of the "set_environment" type in the tool config's <requirements> tag set."""
+ requirements_dict = {}
+ for env_elem in elem:
+ env_name = env_elem.get( 'name', None )
+ if env_name:
+ requirements_dict [ 'name' ] = env_name
+ requirements_dict [ 'type' ] = 'environment variable'
+ if requirements_dict:
+ if 'set_environment' in tool_dependencies_dict:
+ tool_dependencies_dict[ 'set_environment' ].append( requirements_dict )
+ else:
+ tool_dependencies_dict[ 'set_environment' ] = [ requirements_dict ]
+ return tool_dependencies_dict
def generate_tool_dependency_metadata( tool_dependencies_config, metadata_dict ):
"""
If the combination of name, version and type of each element is defined in the <requirement> tag for at least one tool in the repository,
then update the received metadata_dict with information from the parsed tool_dependencies_config.
"""
- tree = ElementTree.parse( tool_dependencies_config )
+ try:
+ tree = ElementTree.parse( tool_dependencies_config )
+ except Exception, e:
+ log.debug( "Exception attempting to parse tool_dependencies.xml: %s" %str( e ) )
+ return metadata_dict
root = tree.getroot()
ElementInclude.include( root )
tool_dependencies_dict = {}
@@ -541,9 +600,13 @@
for elem in root:
if elem.tag == 'package':
tool_dependencies_dict = generate_package_dependency_metadata( elem, tool_dependencies_dict )
+ elif elem.tag == 'set_environment':
+ tool_dependencies_dict = generate_environment_dependency_metadata( elem, tool_dependencies_dict )
# Handle tool dependency installation via other means here (future).
if tool_dependencies_dict:
metadata_dict[ 'tool_dependencies' ] = tool_dependencies_dict
+ if tool_dependencies_dict:
+ metadata_dict[ 'tool_dependencies' ] = tool_dependencies_dict
return metadata_dict
def generate_metadata_for_changeset_revision( app, repository_clone_url, relative_install_dir=None, repository_files_dir=None,
resetting_all_metadata_on_repository=False, webapp='galaxy' ):
@@ -712,7 +775,7 @@
outputs = []
for output in ttb.outputs:
name, file_name, extra = output
- outputs.append( ( name, strip_path( file_name ) ) )
+ outputs.append( ( name, strip_path( file_name ) if file_name else None ) )
test_dict = dict( name=ttb.name,
required_files=required_files,
inputs=inputs,
@@ -1337,27 +1400,27 @@
ElementInclude.include( root )
fabric_version_checked = False
for elem in root:
- # Only install the package if it is not already installed.
- can_install = False
if elem.tag == 'package':
+ # Only install the tool_dependency if it is not already installed.
+ can_install = False
package_name = elem.get( 'name', None )
package_version = elem.get( 'version', None )
if package_name and package_version:
- # The value of tool_dependencies will be None only when this method is called by the InstallManager. In that case, tool
- # dependency installation is not ajaxian, so the ToolDependency objects do not yet exist.
- if tool_dependencies:
- for tool_dependency in tool_dependencies:
- if tool_dependency.name==package_name and tool_dependency.version==package_version:
- can_install = tool_dependency.status in [ app.model.ToolDependency.installation_status.NEVER_INSTALLED,
- app.model.ToolDependency.installation_status.UNINSTALLED ]
- break
- else:
- can_install = False
+ for tool_dependency in tool_dependencies:
+ if tool_dependency.name==package_name and tool_dependency.version==package_version:
+ can_install = tool_dependency.status in [ app.model.ToolDependency.installation_status.NEVER_INSTALLED,
+ app.model.ToolDependency.installation_status.UNINSTALLED ]
+ break
if can_install:
tool_dependency = install_package( app, elem, tool_shed_repository, tool_dependencies=tool_dependencies )
if tool_dependency and tool_dependency.status in [ app.model.ToolDependency.installation_status.INSTALLED,
app.model.ToolDependency.installation_status.ERROR ]:
installed_tool_dependencies.append( tool_dependency )
+ elif elem.tag == 'set_environment':
+ tool_dependency = set_environment( app, elem, tool_shed_repository )
+ if tool_dependency and tool_dependency.status in [ app.model.ToolDependency.installation_status.INSTALLED,
+ app.model.ToolDependency.installation_status.ERROR ]:
+ installed_tool_dependencies.append( tool_dependency )
return installed_tool_dependencies
def handle_tool_versions( app, tool_version_dicts, tool_shed_repository ):
"""
@@ -1662,7 +1725,12 @@
def reversed_upper_bounded_changelog( repo, included_upper_bounds_changeset_revision ):
return reversed_lower_upper_bounded_changelog( repo, INITIAL_CHANGELOG_HASH, included_upper_bounds_changeset_revision )
def strip_path( fpath ):
- file_path, file_name = os.path.split( fpath )
+ if not fpath:
+ return fpath
+ try:
+ file_path, file_name = os.path.split( fpath )
+ except:
+ file_name = fpath
return file_name
def to_html_escaped( text ):
"""Translates the characters in text to html values"""
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -2,7 +2,6 @@
from galaxy.web.controllers.admin import *
from galaxy.util.json import from_json_string, to_json_string
from galaxy.util.shed_util import *
-from galaxy.tool_shed.tool_dependencies.install_util import get_tool_dependency_install_dir
from galaxy.tool_shed.encoding_util import *
from galaxy import eggs, tools
@@ -1364,10 +1363,11 @@
% ( repository.name, original_section_name )
message += "Uncheck the <b>No changes</b> check box and select a different tool panel section to load the tools in a "
message += "different section in the tool panel."
+ status = 'warning'
else:
message = "The tools contained in your <b>%s</b> repository were last loaded into the tool panel outside of any sections. " % repository.name
message += "Uncheck the <b>No changes</b> check box and select a tool panel section to load the tools into that section."
- status = 'done'
+ status = 'warning'
includes_tool_dependencies = 'tool_dependencies' in metadata
install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=True )
return trans.fill_template( '/admin/tool_shed_repository/reselect_tool_panel_section.mako',
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -2263,25 +2263,27 @@
guid = None
revision_label = get_revision_label( trans, repository, changeset_revision )
repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
- metadata = repository_metadata.metadata
- if 'tools' in metadata:
- for tool_metadata_dict in metadata[ 'tools' ]:
- if tool_metadata_dict[ 'id' ] == tool_id:
- relative_path_to_tool_config = tool_metadata_dict[ 'tool_config' ]
- guid = tool_metadata_dict[ 'guid' ]
- full_path = os.path.abspath( relative_path_to_tool_config )
- can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, full_path, changeset_revision )
- if can_use_disk_file:
- tool, valid, message = load_tool_from_config( trans.app, full_path )
- else:
- # We're attempting to load a tool using a config that no longer exists on disk.
- work_dir = tempfile.mkdtemp()
- manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( relative_path_to_tool_config, repo, changeset_revision )
- if manifest_ctx and ctx_file:
- tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
- break
- if guid:
- tool_lineage = self.get_versions_of_tool( trans, repository, repository_metadata, guid )
+ if repository_metadata:
+ metadata = repository_metadata.metadata
+ if metadata:
+ if 'tools' in metadata:
+ for tool_metadata_dict in metadata[ 'tools' ]:
+ if tool_metadata_dict[ 'id' ] == tool_id:
+ relative_path_to_tool_config = tool_metadata_dict[ 'tool_config' ]
+ guid = tool_metadata_dict[ 'guid' ]
+ full_path = os.path.abspath( relative_path_to_tool_config )
+ can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, full_path, changeset_revision )
+ if can_use_disk_file:
+ tool, valid, message = load_tool_from_config( trans.app, full_path )
+ else:
+ # We're attempting to load a tool using a config that no longer exists on disk.
+ work_dir = tempfile.mkdtemp()
+ manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( relative_path_to_tool_config, repo, changeset_revision )
+ if manifest_ctx and ctx_file:
+ tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ break
+ if guid:
+ tool_lineage = self.get_versions_of_tool( trans, repository, repository_metadata, guid )
is_malicious = changeset_is_malicious( trans, repository_id, repository.tip )
changeset_revision_select_field = build_changeset_revision_select_field( trans,
repository,
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 templates/admin/tool_shed_repository/common.mako
--- a/templates/admin/tool_shed_repository/common.mako
+++ b/templates/admin/tool_shed_repository/common.mako
@@ -72,26 +72,20 @@
<div class="form-row"><div class="toolParamHelp" style="clear: both;"><p>
- These tool dependencies can be automatically installed with the repository. Installing them provides significant benefits and
+ These tool dependencies can be automatically handled with the installed repository, providing significant benefits, and
Galaxy includes various features to manage them.
</p>
- <p>
- Each of these dependencies may require their own build requirements (e.g., CMake, g++, etc). Galaxy will not attempt to install
- these build requirements, so tool dependency installation may partially fail if any are missing from your environment, but the
- repository and all of it's contents will be installed. You can install the missing build requirements and have Galaxy attempt
- to install the tool dependencies again if tool dependency installation fails in any way.
- </p></div></div><div class="form-row">
- <label>Install tool dependencies?</label>
+ <label>Handle tool dependencies?</label><% disabled = trans.app.config.tool_dependency_dir is None %>
${install_tool_dependencies_check_box.get_html( disabled=disabled )}
<div class="toolParamHelp" style="clear: both;">
%if disabled:
- Set the tool_dependency_dir configuration value in your universe_wsgi.ini to automatically install tool dependencies.
+ Set the tool_dependency_dir configuration value in your universe_wsgi.ini to automatically handle tool dependencies.
%else:
- Un-check to skip automatic installation of these tool dependencies.
+ Un-check to skip automatic handling of these tool dependencies.
%endif
</div></div>
@@ -99,42 +93,102 @@
<div class="form-row"><table class="grid"><tr><td colspan="4" bgcolor="#D8D8D8"><b>Tool dependencies</b></td></tr>
- <tr>
- <th>Name</th>
- <th>Version</th>
- <th>Type</th>
- <th>Install directory</th>
- </tr>
+ <%
+ env_settings_heaader_row_displayed = False
+ package_header_row_displayed = False
+ %>
%for repo_info_dict in repo_info_dicts:
%for repository_name, repo_info_tuple in repo_info_dict.items():
<% description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple %>
%if tool_dependencies:
- %for dependency_key, requirements_dict in tool_dependencies.items():
- <%
- name = requirements_dict[ 'name' ]
- version = requirements_dict[ 'version' ]
- type = requirements_dict[ 'type' ]
- install_dir = os.path.join( trans.app.config.tool_dependency_dir,
- name,
- version,
- repository_owner,
- repository_name,
- changeset_revision )
- tool_dependency_readme_text = requirements_dict.get( 'readme', None )
- %>
- %if not os.path.exists( install_dir ):
+ <%
+ # See if tool dependencies are packages, environment settings or both.
+ contains_packages = False
+ for k in tool_dependencies.keys():
+ if k != 'set_environment':
+ contains_packages = True
+ break
+ contains_env_settings = 'set_environment' in tool_dependencies.keys()
+ %>
+ %if contains_packages:
+ %if not package_header_row_displayed:
+ <%
+ info_str = "Each of these packages may require their own build requirements (e.g., CMake, g++, etc). "
+ info_str += "Galaxy will not attempt to install these build requirements, so tool dependency installation "
+ info_str += "may partially fail if any are missing from your environment, but the repository and all of it's "
+ info_str += "contents will be installed. You can install the missing build requirements and have Galaxy attempt "
+ info_str += "to install the packages again if tool dependency installation fails in any way."
+ %>
+ </tr><td bgcolor="#FFFFCC" colspan="4">${info_str}</td></tr><tr>
- <td>${name}</td>
- <td>${version}</td>
- <td>${type}</td>
- <td>${install_dir}</td>
+ <th>Name</th>
+ <th>Version</th>
+ <th>Type</th>
+ <th>Install directory</th></tr>
- %if tool_dependency_readme_text:
- <tr><td colspan="4" bgcolor="#FFFFCC">${name} ${version} requirements and installation information</td></tr>
- <tr><td colspan="4"><pre>${tool_dependency_readme_text}</pre></td></tr>
+ <% package_header_row_displayed = True %>
+ %endif
+ %for dependency_key, requirements_dict in tool_dependencies.items():
+ <%
+ name = requirements_dict[ 'name' ]
+ version = requirements_dict[ 'version' ]
+ type = requirements_dict[ 'type' ]
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ name,
+ version,
+ repository_owner,
+ repository_name,
+ changeset_revision )
+ tool_dependency_readme_text = requirements_dict.get( 'readme', None )
+ %>
+ %if not os.path.exists( install_dir ):
+ <tr>
+ <td>${name}</td>
+ <td>${version}</td>
+ <td>${type}</td>
+ <td>${install_dir}</td>
+ </tr>
+ %if tool_dependency_readme_text:
+ <tr><td colspan="4" bgcolor="#FFFFCC">${name} ${version} requirements and installation information</td></tr>
+ <tr><td colspan="4"><pre>${tool_dependency_readme_text}</pre></td></tr>
+ %endif
%endif
+ %endfor
+ %endif
+ %if contains_env_settings:
+ <% environment_settings = tool_dependencies[ 'set_environment' ] %>
+ %if not env_settings_heaader_row_displayed:
+ <%
+ info_str = "Each of these environment settings will be defined in a file named env.sh in the installation directory."
+ %>
+ </tr><td bgcolor="#FFFFCC" colspan="4">${info_str}</td></tr>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th colspan="2">Install directory for environment shell file</th>
+ </tr>
+ <% env_settings_heaader_row_displayed = True %>
%endif
- %endfor
+ %for environment_setting_dict in environment_settings:
+ <%
+ name = environment_setting_dict[ 'name' ]
+ type = environment_setting_dict[ 'type' ]
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ 'environment_settings',
+ name,
+ repository_owner,
+ repository_name,
+ changeset_revision )
+ %>
+ %if not os.path.exists( install_dir ):
+ <tr>
+ <td>${name}</td>
+ <td>${type}</td>
+ <td colspan="2">${install_dir}</td>
+ </tr>
+ %endif
+ %endfor
+ %endif
%endif
%endfor
%endfor
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako
@@ -22,12 +22,20 @@
%for tool_dependency in tool_dependencies:
<input type="hidden" name="tool_dependency_ids" value="${trans.security.encode_id( tool_dependency.id )}"/><%
- install_dir = os.path.join( trans.app.config.tool_dependency_dir,
- tool_dependency.name,
- tool_dependency.version,
- tool_dependency.tool_shed_repository.owner,
- tool_dependency.tool_shed_repository.name,
- tool_dependency.tool_shed_repository.installed_changeset_revision )
+ if tool_dependency.type == 'package':
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ tool_dependency.name,
+ tool_dependency.version,
+ tool_dependency.tool_shed_repository.owner,
+ tool_dependency.tool_shed_repository.name,
+ tool_dependency.tool_shed_repository.installed_changeset_revision )
+ elif tool_dependency.type == 'set_environment':
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ 'environment_settings',
+ tool_dependency.name,
+ tool_dependency.tool_shed_repository.owner,
+ tool_dependency.tool_shed_repository.name,
+ tool_dependency.tool_shed_repository.installed_changeset_revision )
%>
%if os.path.exists( install_dir ):
<tr>
diff -r 1eba2def52653577163901c765fd4686c9d42dfc -r 6aadac8026cb55844a0e8e49360ad30a9f6d0a25 templates/webapps/community/repository/common.mako
--- a/templates/webapps/community/repository/common.mako
+++ b/templates/webapps/community/repository/common.mako
@@ -92,38 +92,76 @@
<div class="toolFormBody">
%if metadata:
%if 'tool_dependencies' in metadata:
- <div class="form-row">
- <table width="100%">
- <tr bgcolor="#D8D8D8" width="100%">
- <td><b>The following tool dependencies can optionally be automatically installed</i></td>
- </tr>
- </table>
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <% tool_dependencies = metadata[ 'tool_dependencies' ] %>
- <table class="grid">
- <tr>
- <td><b>name</b></td>
- <td><b>version</b></td>
- <td><b>type</b></td>
- </tr>
- %for dependency_key, requirements_dict in tool_dependencies.items():
- <%
- name = requirements_dict[ 'name' ]
- version = requirements_dict[ 'version' ]
- type = requirements_dict[ 'type' ]
-
- %>
+ <%
+ # See if tool dependencies are packages, environment settings or both.
+ tool_dependencies = metadata[ 'tool_dependencies' ]
+ contains_packages = False
+ for k in tool_dependencies.keys():
+ if k != 'set_environment':
+ contains_packages = True
+ break
+ contains_env_settings = 'set_environment' in tool_dependencies.keys()
+ %>
+ %if contains_packages:
+ <div class="form-row">
+ <table width="100%">
+ <tr bgcolor="#D8D8D8" width="100%">
+ <td><b>The following tool dependencies can optionally be automatically installed</i></td>
+ </tr>
+ </table>
+ </div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <table class="grid"><tr>
- <td>${name}</td>
- <td>${version}</td>
- <td>${type}</td>
+ <td><b>name</b></td>
+ <td><b>version</b></td>
+ <td><b>type</b></td></tr>
- %endfor
- </table>
- </div>
- <div style="clear: both"></div>
+ %for dependency_key, requirements_dict in tool_dependencies.items():
+ %if dependency_key != 'set_environment':
+ <%
+ name = requirements_dict[ 'name' ]
+ version = requirements_dict[ 'version' ]
+ type = requirements_dict[ 'type' ]
+ %>
+ <tr>
+ <td>${name}</td>
+ <td>${version}</td>
+ <td>${type}</td>
+ </tr>
+ %endif
+ %endfor
+ </table>
+ </div>
+ <div style="clear: both"></div>
+ %endif
+ %if contains_env_settings:
+ <div class="form-row">
+ <table width="100%">
+ <tr bgcolor="#D8D8D8" width="100%">
+ <td><b>The following environment settings can optionally be handled as part of the installation</i></td>
+ </tr>
+ </table>
+ </div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <table class="grid">
+ <tr>
+ <td><b>name</b></td>
+ <td><b>type</b></td>
+ </tr>
+ <% environment_settings = tool_dependencies[ 'set_environment' ] %>
+ %for requirements_dict in environment_settings:
+ <tr>
+ <td>${requirements_dict[ 'name' ]}</td>
+ <td>${requirements_dict[ 'type' ]}</td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ <div style="clear: both"></div>
+ %endif
%endif
%if 'tools' in metadata:
<div class="form-row">
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Clean up JavaScript loading: (1) ensure galaxy.base is always loaded and (2) remove all duplicate loading of jQuery, bootstrap, and galaxy.base
by Bitbucket 13 Sep '12
by Bitbucket 13 Sep '12
13 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/1eba2def5265/
changeset: 1eba2def5265
user: jgoecks
date: 2012-09-13 16:18:22
summary: Clean up JavaScript loading: (1) ensure galaxy.base is always loaded and (2) remove all duplicate loading of jQuery, bootstrap, and galaxy.base
affected #: 20 files
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/base.mako
--- a/templates/base.mako
+++ b/templates/base.mako
@@ -29,6 +29,7 @@
${h.js(
"libs/jquery/jquery",
+ "libs/json2",
"libs/bootstrap",
"galaxy.base",
"libs/underscore",
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/base_panels.mako
--- a/templates/base_panels.mako
+++ b/templates/base_panels.mako
@@ -48,7 +48,7 @@
<!--[if lt IE 7]>
${h.js( 'libs/IE/IE7', 'libs/IE/ie7-recalc' )}
<![endif]-->
- ${h.js( 'libs/jquery/jquery', 'libs/bootstrap', 'libs/underscore', 'libs/backbone/backbone', 'libs/backbone/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui' )}
+ ${h.js( 'libs/jquery/jquery', 'libs/json2', 'libs/bootstrap', 'libs/underscore', 'libs/backbone/backbone', 'libs/backbone/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui' )}
<script type="text/javascript">
// Set up needed paths.
var galaxy_paths = new GalaxyPaths({
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/dataset/copy_view.mako
--- a/templates/dataset/copy_view.mako
+++ b/templates/dataset/copy_view.mako
@@ -4,7 +4,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
<script type="text/javascript">
$(function() {
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/dataset/edit_attributes.mako
--- a/templates/dataset/edit_attributes.mako
+++ b/templates/dataset/edit_attributes.mako
@@ -11,7 +11,7 @@
<%def name="javascripts()">
${parent.javascripts()}
${message_ns.javascripts()}
- ${h.js( "galaxy.base", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging" )}
+ ${h.js( "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging" )}
</%def><%def name="datatype( dataset, datatypes )">
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/display_base.mako
--- a/templates/display_base.mako
+++ b/templates/display_base.mako
@@ -32,7 +32,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "libs/bootstrap", "galaxy.base", "libs/json2", "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating",
+ ${h.js( "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating",
"galaxy.autocom_tagging", "viz/trackster", "viz/trackster_ui", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.mousewheel",
"libs/jquery/jquery.autocomplete", "libs/jquery/jquery.ui.sortable.slider", "libs/farbtastic", "mvc/data", "viz/visualization" )}
@@ -113,7 +113,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
- ${h.css( "autocomplete_tagging", "embed_item", "trackster", "jquery.rating", "overcast/jquery-ui-1.8.5.custom" )}
+ ${h.css( "autocomplete_tagging", "embed_item", "trackster", "jquery.rating", "jquery-ui/smoothness/jquery-ui-1.8.23.custom" )}
<style type="text/css">
.page-body {
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/history/view.mako
--- a/templates/history/view.mako
+++ b/templates/history/view.mako
@@ -13,7 +13,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "galaxy.base", "libs/jquery/jquery", "libs/json2", "libs/jquery/jstorage" )}
+ ${h.js( "libs/jquery/jstorage" )}
<script type="text/javascript">
$(function() {
init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/library/common/browse_library.mako
--- a/templates/library/common/browse_library.mako
+++ b/templates/library/common/browse_library.mako
@@ -48,7 +48,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js("libs/json2")}
${h.js("libs/jquery/jstorage")}
${common_javascripts()}
${self.grid_javascripts()}
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/library/common/import_datasets_to_histories.mako
--- a/templates/library/common/import_datasets_to_histories.mako
+++ b/templates/library/common/import_datasets_to_histories.mako
@@ -5,7 +5,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
<script type="text/javascript">
$(function() {
$("#select-multiple").click(function() {
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/page/editor.mako
--- a/templates/page/editor.mako
+++ b/templates/page/editor.mako
@@ -21,8 +21,8 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.drop", "libs/jquery/jquery.event.hover", "libs/jquery/jquery.form", "libs/json2", "libs/jquery/jstorage",
- "galaxy.base", "libs/jquery/jquery.wymeditor", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging")}
+ ${h.js( "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.drop", "libs/jquery/jquery.event.hover", "libs/jquery/jquery.form",
+ "libs/jquery/jstorage", "libs/jquery/jquery.wymeditor", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging")}
<script type="text/javascript">
// Useful Galaxy stuff.
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/root/alternate_history.mako
--- a/templates/root/alternate_history.mako
+++ b/templates/root/alternate_history.mako
@@ -286,7 +286,7 @@
${parent.javascripts()}
${h.js(
- "libs/json2", "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete",
+ "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete",
##"libs/handlebars.full",
"galaxy.autocom_tagging",
"mvc/base-mvc", "mvc/ui"
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/root/tool_menu.mako
--- a/templates/root/tool_menu.mako
+++ b/templates/root/tool_menu.mako
@@ -17,7 +17,7 @@
<%def name="javascripts()">
${parent.javascripts()}
${h.templates( "tool_link", "panel_section", "tool_search" )}
- ${h.js( "galaxy.base", "libs/json2", "galaxy.autocom_tagging", "mvc/tools", "libs/bootstrap" )}
+ ${h.js( "galaxy.autocom_tagging", "mvc/tools" )}
<%
# Set up for creating tool panel.
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/tool_form.mako
--- a/templates/tool_form.mako
+++ b/templates/tool_form.mako
@@ -12,7 +12,7 @@
</%def><%def name="javascripts()">
- ${h.js( "libs/jquery/jquery", "galaxy.panels", "galaxy.base", "libs/jquery/jquery.autocomplete", "libs/jquery/jstorage", "libs/bootstrap" )}
+ ${h.js( "galaxy.panels", "libs/jquery/jquery.autocomplete", "libs/jquery/jstorage" )}
<script type="text/javascript">
$(function() {
$(window).bind("refresh_on_change", function() {
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/tracks/browser.mako
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -21,7 +21,7 @@
<script type='text/javascript' src="${h.url_for('/static/scripts/libs/IE/excanvas.js')}"></script><![endif]-->
-${h.js( "galaxy.base", "galaxy.panels", "libs/json2", "libs/jquery/jquery", "libs/bootstrap", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui-1.8.23.custom.min", "mvc/data", "viz/visualization", "viz/trackster", "viz/trackster_ui", "libs/farbtastic" )}
+${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui-1.8.23.custom.min", "mvc/data", "viz/visualization", "viz/trackster", "viz/trackster_ui", "libs/farbtastic" )}
<script type="text/javascript">
//
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/webapps/community/admin/index.mako
--- a/templates/webapps/community/admin/index.mako
+++ b/templates/webapps/community/admin/index.mako
@@ -18,7 +18,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
</%def><%def name="init()">
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/webapps/community/index.mako
--- a/templates/webapps/community/index.mako
+++ b/templates/webapps/community/index.mako
@@ -19,7 +19,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
</%def><%def name="init()">
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/webapps/galaxy/admin/index.mako
--- a/templates/webapps/galaxy/admin/index.mako
+++ b/templates/webapps/galaxy/admin/index.mako
@@ -22,7 +22,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
</%def><%def name="init()">
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/webapps/reports/index.mako
--- a/templates/webapps/reports/index.mako
+++ b/templates/webapps/reports/index.mako
@@ -26,7 +26,6 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery", "galaxy.base" )}
</%def><%def name="left_panel()">
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/workflow/edit_attributes.mako
--- a/templates/workflow/edit_attributes.mako
+++ b/templates/workflow/edit_attributes.mako
@@ -9,7 +9,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "galaxy.base", "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging" )}
+ ${h.js( "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging" )}
</%def>
%if msg:
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/workflow/editor.mako
--- a/templates/workflow/editor.mako
+++ b/templates/workflow/editor.mako
@@ -25,15 +25,11 @@
<script type='text/javascript' src="${h.url_for('/static/scripts/libs/IE/excanvas.js')}"></script><![endif]-->
- ${h.js( "libs/jquery/jquery",
- "libs/bootstrap",
- "libs/jquery/jquery.event.drag",
+ ${h.js( "libs/jquery/jquery.event.drag",
"libs/jquery/jquery.event.drop",
"libs/jquery/jquery.event.hover",
"libs/jquery/jquery.form",
- "libs/json2",
"libs/jquery/jstorage",
- "galaxy.base",
"galaxy.workflow_editor.canvas",
"libs/jquery/jquery.autocomplete",
"galaxy.autocom_tagging")}
diff -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 -r 1eba2def52653577163901c765fd4686c9d42dfc templates/workflow/run.mako
--- a/templates/workflow/run.mako
+++ b/templates/workflow/run.mako
@@ -2,7 +2,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/jquery/jquery.autocomplete", "libs/bootstrap" )}
+ ${h.js( "libs/jquery/jquery.autocomplete" )}
<script type="text/javascript">
$( function() {
function show_tool_body(title){
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Bug fix and code cleanup for recent visualization commits.
by Bitbucket 13 Sep '12
by Bitbucket 13 Sep '12
13 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/7663ed1ce177/
changeset: 7663ed1ce177
user: jgoecks
date: 2012-09-13 15:30:42
summary: Bug fix and code cleanup for recent visualization commits.
affected #: 2 files
diff -r eb55dd8768cefb1548b2ced2e44a7df4fe8dde5e -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 static/scripts/viz/circster.js
--- a/static/scripts/viz/circster.js
+++ b/static/scripts/viz/circster.js
@@ -1,7 +1,7 @@
define( ["libs/d3", "viz/visualization"], function( d3, visualization ) {
// General backbone style inheritence
-var Base = function() { this.initialize && this.initialize.apply(this, arguments) }; Base.extend = Backbone.Model.extend;
+var Base = function() { this.initialize && this.initialize.apply(this, arguments); }; Base.extend = Backbone.Model.extend;
/**
* Renders a full circster visualization
@@ -23,8 +23,8 @@
height = self.$el.height(),
// Compute radius start based on model, will be centered
// and fit entirely inside element by default
- init_radius_start = ( Math.min(width,height)/2
- - this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) );
+ init_radius_start = ( Math.min(width,height)/2 -
+ this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) );
// Set up SVG element.
var svg = d3.select(self.$el[0])
@@ -36,11 +36,11 @@
.append('svg:g')
.call(d3.behavior.zoom().on('zoom', function() {
svg.attr("transform",
- "translate(" + d3.event.translate + ")"
- + " scale(" + d3.event.scale + ")");
+ "translate(" + d3.event.translate + ")" +
+ " scale(" + d3.event.scale + ")");
}))
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
- .append('svg:g')
+ .append('svg:g');
// -- Render each dataset in the visualization. --
@@ -49,7 +49,7 @@
radius_start = init_radius_start + index * (dataset_arc_height + self.track_gap),
track_renderer_class = (dataset instanceof visualization.GenomeWideBigWigData ? CircsterBigWigTrackRenderer : CircsterSummaryTreeTrackRenderer );
- track_renderer = new track_renderer_class({
+ var track_renderer = new track_renderer_class({
track: track,
radius_start: radius_start,
radius_end: radius_start + dataset_arc_height,
@@ -71,8 +71,8 @@
render: function( svg ) {
- genome_arcs = this.chroms_layout(),
- chroms_arcs = this.genome_data_layout();
+ var genome_arcs = this.chroms_layout(),
+ chroms_arcs = this.genome_data_layout();
// -- Render. --
@@ -106,7 +106,7 @@
//.style("stroke", block_color)
//.style("fill", block_color)
- dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color)
+ dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color);
});
},
@@ -160,7 +160,7 @@
/**
* Layout for summary tree data in a circster visualization.
*/
-var CircsterSummaryTrackRenderer = CircsterTrackRenderer.extend({
+var CircsterSummaryTreeTrackRenderer = CircsterTrackRenderer.extend({
/**
* Returns layouts for drawing a chromosome's data.
@@ -230,6 +230,6 @@
return {
CircsterView: CircsterView
-}
+};
});
diff -r eb55dd8768cefb1548b2ced2e44a7df4fe8dde5e -r 7663ed1ce1779b78f5f39037def1c4610b96ce56 static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -783,31 +783,31 @@
return module.exports;
} else if ( typeof define === 'function' && define.amd ) {
// AMD
- exports = {}
- define( function() { return exports } );
- return exports
+ exports = {};
+ define( function() { return exports; } );
+ return exports;
} else {
// Browser global
return window;
}
})();
-exports.BrowserBookmark = BrowserBookmark
-exports.BrowserBookmarkCollection = BrowserBookmarkCollection
-exports.Cache = Cache
-exports.CanvasManager = CanvasManager
-exports.Genome = Genome
-exports.GenomeDataManager = GenomeDataManager
-exports.GenomeRegion = GenomeRegion
-exports.GenomeRegionCollection = GenomeRegionCollection
-exports.GenomeVisualization = GenomeVisualization
-exports.GenomeWideBigWigData = GenomeWideBigWigData
-exports.GenomeWideSummaryTreeData = GenomeWideSummaryTreeData
-exports.ReferenceTrackDataManager = ReferenceTrackDataManager
-exports.ServerStateDeferred = ServerStateDeferred
-exports.TrackBrowserRouter = TrackBrowserRouter
-exports.TrackConfig = TrackConfig
-exports.Visualization = Visualization
-exports.add_datasets = add_datasets
+exports.BrowserBookmark = BrowserBookmark;
+exports.BrowserBookmarkCollection = BrowserBookmarkCollection;
+exports.Cache = Cache;
+exports.CanvasManager = CanvasManager;
+exports.Genome = Genome;
+exports.GenomeDataManager = GenomeDataManager;
+exports.GenomeRegion = GenomeRegion;
+exports.GenomeRegionCollection = GenomeRegionCollection;
+exports.GenomeVisualization = GenomeVisualization;
+exports.GenomeWideBigWigData = GenomeWideBigWigData;
+exports.GenomeWideSummaryTreeData = GenomeWideSummaryTreeData;
+exports.ReferenceTrackDataManager = ReferenceTrackDataManager;
+exports.ServerStateDeferred = ServerStateDeferred;
+exports.TrackBrowserRouter = TrackBrowserRouter;
+exports.TrackConfig = TrackConfig;
+exports.Visualization = Visualization;
+exports.add_datasets = add_datasets;
}).call(this);
\ 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: dannon: Temporarily hide (though not remove) share string option in cloud launch form due to it sometimes failing on the cloudman end.
by Bitbucket 12 Sep '12
by Bitbucket 12 Sep '12
12 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/eb55dd8768ce/
changeset: eb55dd8768ce
user: dannon
date: 2012-09-12 22:23:26
summary: Temporarily hide (though not remove) share string option in cloud launch form due to it sometimes failing on the cloudman end.
affected #: 1 file
diff -r 3668de7a24ef93da9ef6d5ef7f45a61966fbe19f -r eb55dd8768cefb1548b2ced2e44a7df4fe8dde5e templates/cloud/index.mako
--- a/templates/cloud/index.mako
+++ b/templates/cloud/index.mako
@@ -150,8 +150,6 @@
</script></%def>
-
-
<%def name="center_panel()"><div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
@@ -167,9 +165,8 @@
<label for="id_key_id">Key ID</label><input type="text" size="30" maxlength="20" name="key_id" id="id_key_id" value=""/><br/><div class="toolParamHelp">
- This is the text string that uniquely identifies your account, found in the <a
-href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Security Credentials section of the AWS
-Console</a>.
+ This is the text string that uniquely identifies your account, found in the
+ <a href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Security Credentials section of the AWS Console</a>.
</div></div>
@@ -210,11 +207,13 @@
%if share_string:
<input type='hidden' name='share_string' value='${share_string}'/>
%else:
- <div class="form-row">
+ <!-- DBEDIT temporary hide share string due to it being broken on the cloudman end -->
+ <div class="form-row" style="display:none;"><label for="id_share_string">Instance Share String (optional)</label><input type="text" size="120" name="share_string" id="id_share_string"/><br/></div>
%endif
+
<div class="form-row"><label for="id_instance_type">Instance Type</label><select name="instance_type" id="id_instance_type">
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/changeset/3668de7a24ef/
changeset: 3668de7a24ef
user: james_taylor
date: 2012-09-12 21:43:03
summary: adding packed scripts
affected #: 2 files
diff -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd -r 3668de7a24ef93da9ef6d5ef7f45a61966fbe19f static/scripts/packed/require.js
--- /dev/null
+++ b/static/scripts/packed/require.js
@@ -0,0 +1,1 @@
+var requirejs,require,define;(function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.0.6",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,aps=ap.slice,apsp=ap.splice,isBrowser=!!(typeof window!=="undefined"&&navigator&&document),isWebWorker=!isBrowser&&typeof importScripts!=="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=false;function isFunction(it){return ostring.call(it)==="[object Function]"}function isArray(it){return ostring.call(it)==="[object Array]"}function each(ary,func){if(ary){var i;for(i=0;i<ary.length;i+=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function eachReverse(ary,func){if(ary){var i;for(i=ary.length-1;i>-1;i-=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function eachProp(obj,func){var prop;for(prop in obj){if(obj.hasOwnProperty(prop)){if(func(obj[prop],prop)){break}}}}function mixin(target,source,force,deepStringMixin){if(source){eachProp(source,function(value,prop){if(force||!hasProp(target,prop)){if(deepStringMixin&&typeof value!=="string"){if(!target[prop]){target[prop]={}}mixin(target[prop],value,force,deepStringMixin)}else{target[prop]=value}}})}return target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function getGlobal(value){if(!value){return value}var g=global;each(value.split("."),function(part){g=g[part]});return g}function makeContextModuleFunc(func,relMap,enableBuildCallback){return function(){var args=aps.call(arguments,0),lastArg;if(enableBuildCallback&&isFunction((lastArg=args[args.length-1]))){lastArg.__requireJsBuild=true}args.push(relMap);return func.apply(null,args)}}function addRequireMethods(req,context,relMap){each([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(item){var prop=item[1]||item[0];req[item[0]]=context?makeContextModuleFunc(context[prop],relMap):function(){var ctx=contexts[defContextName];return ctx[prop].apply(ctx,arguments)}})}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);e.requireType=id;e.requireModules=requireModules;if(err){e.originalError=err}return e}if(typeof define!=="undefined"){return}if(typeof requirejs!=="undefined"){if(isFunction(requirejs)){return}cfg=requirejs;requirejs=undefined}if(typeof require!=="undefined"&&!isFunction(require)){cfg=require;require=undefined}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},registry={},undefEvents={},defQueue=[],defined={},urlFetched={},requireCounter=1,unnormalizedCounter=1,waitAry=[];function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else{if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else{if(i>0){ary.splice(i-1,2);i-=2}}}}}}function normalize(name,baseName,applyMap){var pkgName,pkgConfig,mapValue,nameParts,i,j,nameSegment,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),normalizedBaseParts=baseParts,map=config.map,starMap=map&&map["*"];if(name&&name.charAt(0)==="."){if(baseName){if(config.pkgs[baseName]){normalizedBaseParts=baseParts=[baseName]}else{normalizedBaseParts=baseParts.slice(0,baseParts.length-1)}name=normalizedBaseParts.concat(name.split("/"));trimDots(name);pkgConfig=config.pkgs[(pkgName=name[0])];name=name.join("/");if(pkgConfig&&name===pkgName+"/"+pkgConfig.main){name=pkgName}}else{if(name.indexOf("./")===0){name=name.substring(2)}}}if(applyMap&&(baseParts||starMap)&&map){nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice(0,j).join("/")];if(mapValue){mapValue=mapValue[nameSegment];if(mapValue){foundMap=mapValue;foundI=i;break}}}}if(foundMap){break}if(!foundStarMap&&starMap&&starMap[nameSegment]){foundStarMap=starMap[nameSegment];starI=i}}if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}return name}function removeScript(name){if(isBrowser){each(scripts(),function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName){scriptNode.parentNode.removeChild(scriptNode);return true}})}}function hasPathFallback(id){var pathConfig=config.paths[id];if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1){removeScript(id);pathConfig.shift();context.undef(id);context.require([id]);return true}}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,index=name?name.indexOf("!"):-1,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=true,normalizedName="";if(!name){isDefine=false;name="_@r"+(requireCounter+=1)}if(index!==-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}if(prefix){prefix=normalize(prefix,parentName,applyMap);pluginModule=defined[prefix]}if(name){if(prefix){if(pluginModule&&pluginModule.normalize){normalizedName=pluginModule.normalize(name,function(name){return normalize(name,parentName,applyMap)})}else{normalizedName=normalize(name,parentName,applyMap)}}else{normalizedName=normalize(name,parentName,applyMap);url=context.nameToUrl(normalizedName)}}suffix=prefix&&!pluginModule&&!isNormalized?"_unnormalized"+(unnormalizedCounter+=1):"";return{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!suffix,url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=registry[id];if(!mod){mod=registry[id]=new context.Module(depMap)}return mod}function on(depMap,name,fn){var id=depMap.id,mod=registry[id];if(hasProp(defined,id)&&(!mod||mod.defineEmitComplete)){if(name==="defined"){fn(defined[id])}}else{getModule(depMap).on(name,fn)}}function onError(err,errback){var ids=err.requireModules,notified=false;if(errback){errback(err)}else{each(ids,function(id){var mod=registry[id];if(mod){mod.error=err;if(mod.events.error){notified=true;mod.emit("error",err)}}});if(!notified){req.onError(err)}}}function takeGlobalQueue(){if(globalDefQueue.length){apsp.apply(defQueue,[defQueue.length-1,0].concat(globalDefQueue));globalDefQueue=[]}}function makeRequire(mod,enableBuildCallback,altRequire){var relMap=mod&&mod.map,modRequire=makeContextModuleFunc(altRequire||context.require,relMap,enableBuildCallback);addRequireMethods(modRequire,context,relMap);modRequire.isBrowser=isBrowser;return modRequire}handlers={require:function(mod){return makeRequire(mod)},exports:function(mod){mod.usingExports=true;if(mod.map.isDefine){return(mod.exports=defined[mod.map.id]={})}},module:function(mod){return(mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return(config.config&&config.config[mod.map.id])||{}},exports:defined[mod.map.id]})}};function removeWaiting(id){delete registry[id];each(waitAry,function(mod,i){if(mod.map.id===id){waitAry.splice(i,1);if(!mod.defined){context.waitCount-=1}return true}})}function findCycle(mod,traced,processed){var id=mod.map.id,depArray=mod.depMaps,foundModule;if(!mod.inited){return}if(traced[id]){return mod}traced[id]=true;each(depArray,function(depMap){var depId=depMap.id,depMod=registry[depId];if(!depMod||processed[depId]||!depMod.inited||!depMod.enabled){return}return(foundModule=findCycle(depMod,traced,processed))});processed[id]=true;return foundModule}function forceExec(mod,traced,uninited){var id=mod.map.id,depArray=mod.depMaps;if(!mod.inited||!mod.map.isDefine){return}if(traced[id]){return defined[id]}traced[id]=mod;each(depArray,function(depMap){var depId=depMap.id,depMod=registry[depId],value;if(handlers[depId]){return}if(depMod){if(!depMod.inited||!depMod.enabled){uninited[id]=true;return}value=forceExec(depMod,traced,uninited);if(!uninited[depId]){mod.defineDepById(depId,value)}}});mod.check(true);return defined[id]}function modCheck(mod){mod.check()}function checkLoaded(){var map,modId,err,usingPathFallback,waitInterval=config.waitSeconds*1000,expired=waitInterval&&(context.startTime+waitInterval)<new Date().getTime(),noLoads=[],stillLoading=false,needCycleCheck=true;if(inCheckLoaded){return}inCheckLoaded=true;eachProp(registry,function(mod){map=mod.map;modId=map.id;if(!mod.enabled){return}if(!mod.error){if(!mod.inited&&expired){if(hasPathFallback(modId)){usingPathFallback=true;stillLoading=true}else{noLoads.push(modId);removeScript(modId)}}else{if(!mod.inited&&mod.fetched&&map.isDefine){stillLoading=true;if(!map.prefix){return(needCycleCheck=false)}}}}});if(expired&&noLoads.length){err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads);err.contextName=context.contextName;return onError(err)}if(needCycleCheck){each(waitAry,function(mod){if(mod.defined){return}var cycleMod=findCycle(mod,{},{}),traced={};if(cycleMod){forceExec(cycleMod,traced,{});eachProp(traced,modCheck)}});eachProp(registry,modCheck)}if((!expired||usingPathFallback)&&stillLoading){if((isBrowser||isWebWorker)&&!checkLoadedTimeoutId){checkLoadedTimeoutId=setTimeout(function(){checkLoadedTimeoutId=0;checkLoaded()},50)}}inCheckLoaded=false}Module=function(map){this.events=undefEvents[map.id]||{};this.map=map;this.shim=config.shim[map.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Module.prototype={init:function(depMaps,factory,errback,options){options=options||{};if(this.inited){return}this.factory=factory;if(errback){this.on("error",errback)}else{if(this.events.error){errback=bind(this,function(err){this.emit("error",err)})}}this.depMaps=depMaps&&depMaps.slice(0);this.depMaps.rjsSkipMap=depMaps.rjsSkipMap;this.errback=errback;this.inited=true;this.ignore=options.ignore;if(options.enabled||this.enabled){this.enable()}else{this.check()}},defineDepById:function(id,depExports){var i;each(this.depMaps,function(map,index){if(map.id===id){i=index;return true}});return this.defineDep(i,depExports)},defineDep:function(i,depExports){if(!this.depMatched[i]){this.depMatched[i]=true;this.depCount-=1;this.depExports[i]=depExports}},fetch:function(){if(this.fetched){return}this.fetched=true;context.startTime=(new Date()).getTime();var map=this.map;if(this.shim){makeRequire(this,true)(this.shim.deps||[],bind(this,function(){return map.prefix?this.callPlugin():this.load()}))}else{return map.prefix?this.callPlugin():this.load()}},load:function(){var url=this.map.url;if(!urlFetched[url]){urlFetched[url]=true;context.load(this.map.id,url)}},check:function(silent){if(!this.enabled||this.enabling){return}var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(!this.inited){this.fetch()}else{if(this.error){this.emit("error",this.error)}else{if(!this.defining){this.defining=true;if(this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error){try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}}else{exports=context.execCb(id,factory,depExports,exports)}if(this.map.isDefine){cjsModule=this.module;if(cjsModule&&cjsModule.exports!==undefined&&cjsModule.exports!==this.exports){exports=cjsModule.exports}else{if(exports===undefined&&this.usingExports){exports=this.exports}}}if(err){err.requireMap=this.map;err.requireModules=[this.map.id];err.requireType="define";return onError((this.error=err))}}else{exports=factory}this.exports=exports;if(this.map.isDefine&&!this.ignore){defined[id]=exports;if(req.onResourceLoad){req.onResourceLoad(context,this.map,this.depMaps)}}delete registry[id];this.defined=true;context.waitCount-=1;if(context.waitCount===0){waitAry=[]}}this.defining=false;if(!silent){if(this.defined&&!this.defineEmitted){this.defineEmitted=true;this.emit("defined",this.exports);this.defineEmitComplete=true}}}}}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix,null,false,true);on(pluginMap,"defined",bind(this,function(plugin){var load,normalizedMap,normalizedMod,name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){if(plugin.normalize){name=plugin.normalize(name,function(name){return normalize(name,parentName,true)})||""}normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap,false,true);on(normalizedMap,"defined",bind(this,function(value){this.init([],function(){return value},null,{enabled:true,ignore:true})}));normalizedMod=registry[normalizedMap.id];if(normalizedMod){if(this.events.error){normalizedMod.on("error",bind(this,function(err){this.emit("error",err)}))}normalizedMod.enable()}return}load=bind(this,function(value){this.init([],function(){return value},null,{enabled:true})});load.error=bind(this,function(err){this.inited=true;this.error=err;err.requireModules=[id];eachProp(registry,function(mod){if(mod.map.id.indexOf(id+"_unnormalized")===0){removeWaiting(mod.map.id)}});onError(err)});load.fromText=function(moduleName,text){var hasInteractive=useInteractive;if(hasInteractive){useInteractive=false}getModule(makeModuleMap(moduleName));req.exec(text);if(hasInteractive){useInteractive=true}context.completeLoad(moduleName)};plugin.load(map.name,makeRequire(map.parentMap,true,function(deps,cb,er){deps.rjsSkipMap=true;return context.require(deps,cb,er)}),load,config)}));context.enable(pluginMap,this);this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){this.enabled=true;if(!this.waitPushed){waitAry.push(this);context.waitCount+=1;this.waitPushed=true}this.enabling=true;each(this.depMaps,bind(this,function(depMap,i){var id,mod,handler;if(typeof depMap==="string"){depMap=makeModuleMap(depMap,(this.map.isDefine?this.map:this.map.parentMap),false,!this.depMaps.rjsSkipMap);this.depMaps[i]=depMap;handler=handlers[depMap.id];if(handler){this.depExports[i]=handler(this);return}this.depCount+=1;on(depMap,"defined",bind(this,function(depExports){this.defineDep(i,depExports);this.check()}));if(this.errback){on(depMap,"error",this.errback)}}id=depMap.id;mod=registry[id];if(!handlers[id]&&mod&&!mod.enabled){context.enable(depMap,this)}}));eachProp(this.pluginMaps,bind(this,function(pluginMap){var mod=registry[pluginMap.id];if(mod&&!mod.enabled){context.enable(pluginMap,this)}}));this.enabling=false;this.check()},on:function(name,cb){var cbs=this.events[name];if(!cbs){cbs=this.events[name]=[]}cbs.push(cb)},emit:function(name,evt){each(this.events[name],function(cb){cb(evt)});if(name==="error"){delete this.events[name]}}};function callGetModule(args){getModule(makeModuleMap(args[0],null,true)).init(args[1],args[2])}function removeListener(node,func,name,ieName){if(node.detachEvent&&!isOpera){if(ieName){node.detachEvent(ieName,func)}}else{node.removeEventListener(name,func,false)}}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;removeListener(node,context.onScriptLoad,"load","onreadystatechange");removeListener(node,context.onScriptError,"error");return{node:node,id:node&&node.getAttribute("data-requiremodule")}}return(context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,waitCount:0,defQueue:defQueue,Module:Module,makeModuleMap:makeModuleMap,configure:function(cfg){if(cfg.baseUrl){if(cfg.baseUrl.charAt(cfg.baseUrl.length-1)!=="/"){cfg.baseUrl+="/"}}var pkgs=config.pkgs,shim=config.shim,paths=config.paths,map=config.map;mixin(config,cfg,true);config.paths=mixin(paths,cfg.paths,true);if(cfg.map){config.map=mixin(map||{},cfg.map,true,true)}if(cfg.shim){eachProp(cfg.shim,function(value,id){if(isArray(value)){value={deps:value}}if(value.exports&&!value.exports.__buildReady){value.exports=context.makeShimExports(value.exports)}shim[id]=value});config.shim=shim}if(cfg.packages){each(cfg.packages,function(pkgObj){var location;pkgObj=typeof pkgObj==="string"?{name:pkgObj}:pkgObj;location=pkgObj.location;pkgs[pkgObj.name]={name:pkgObj.name,location:location||pkgObj.name,main:(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}});config.pkgs=pkgs}eachProp(registry,function(mod,id){if(!mod.inited&&!mod.map.unnormalized){mod.map=makeModuleMap(id)}});if(cfg.deps||cfg.callback){context.require(cfg.deps||[],cfg.callback)}},makeShimExports:function(exports){var func;if(typeof exports==="string"){func=function(){return getGlobal(exports)};func.exports=exports;return func}else{return function(){return exports.apply(global,arguments)}}},requireDefined:function(id,relMap){return hasProp(defined,makeModuleMap(id,relMap,false,true).id)},requireSpecified:function(id,relMap){id=makeModuleMap(id,relMap,false,true).id;return hasProp(defined,id)||hasProp(registry,id)},require:function(deps,callback,errback,relMap){var moduleName,id,map,requireMod,args;if(typeof deps==="string"){if(isFunction(callback)){return onError(makeError("requireargs","Invalid require call"),errback)}if(req.get){return req.get(context,deps,callback)}moduleName=deps;relMap=callback;map=makeModuleMap(moduleName,relMap,false,true);id=map.id;if(!hasProp(defined,id)){return onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName))}return defined[id]}if(errback&&!isFunction(errback)){relMap=errback;errback=undefined}if(callback&&!isFunction(callback)){relMap=callback;callback=undefined}takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]))}else{callGetModule(args)}}requireMod=getModule(makeModuleMap(null,relMap));requireMod.init(deps,callback,errback,{enabled:true});checkLoaded();return context.require},undef:function(id){takeGlobalQueue();var map=makeModuleMap(id,null,true),mod=registry[id];delete defined[id];delete urlFetched[map.url];delete undefEvents[id];if(mod){if(mod.events.defined){undefEvents[id]=mod.events}removeWaiting(id)}},enable:function(depMap,parent){var mod=registry[depMap.id];if(mod){getModule(depMap).enable()}},completeLoad:function(moduleName){var found,args,mod,shim=config.shim[moduleName]||{},shExports=shim.exports&&shim.exports.exports;takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){args[0]=moduleName;if(found){break}found=true}else{if(args[0]===moduleName){found=true}}callGetModule(args)}mod=registry[moduleName];if(!found&&!defined[moduleName]&&mod&&!mod.inited){if(config.enforceDefine&&(!shExports||!getGlobal(shExports))){if(hasPathFallback(moduleName)){return}else{return onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]))}}else{callGetModule([moduleName,(shim.deps||[]),shim.exports])}}checkLoaded()},toUrl:function(moduleNamePlusExt,relModuleMap){var index=moduleNamePlusExt.lastIndexOf("."),ext=null;if(index!==-1){ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length);moduleNamePlusExt=moduleNamePlusExt.substring(0,index)}return context.nameToUrl(normalize(moduleNamePlusExt,relModuleMap&&relModuleMap.id,true),ext)},nameToUrl:function(moduleName,ext){var paths,pkgs,pkg,pkgPath,syms,i,parentModule,url,parentPath;if(req.jsExtRegExp.test(moduleName)){url=moduleName+(ext||"")}else{paths=config.paths;pkgs=config.pkgs;syms=moduleName.split("/");for(i=syms.length;i>0;i-=1){parentModule=syms.slice(0,i).join("/");pkg=pkgs[parentModule];parentPath=paths[parentModule];if(parentPath){if(isArray(parentPath)){parentPath=parentPath[0]}syms.splice(0,i,parentPath);break}else{if(pkg){if(moduleName===pkg.name){pkgPath=pkg.location+"/"+pkg.main}else{pkgPath=pkg.location}syms.splice(0,i,pkgPath);break}}}url=syms.join("/");url+=(ext||(/\?/.test(url)?"":".js"));url=(url.charAt(0)==="/"||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs?url+((url.indexOf("?")===-1?"?":"&")+config.urlArgs):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if(evt.type==="load"||(readyRegExp.test((evt.currentTarget||evt.srcElement).readyState))){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){return onError(makeError("scripterror","Script error",evt,[data.id]))}}})}req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;if(!isArray(deps)&&typeof deps!=="string"){config=deps;if(isArray(callback)){deps=callback;callback=errback;errback=optional}else{deps=[]}}if(config&&config.context){contextName=config.context}context=contexts[contextName];if(!context){context=contexts[contextName]=req.s.newContext(contextName)}if(config){context.configure(config)}return context.require(deps,callback,errback)};req.config=function(config){return req(config)};if(!require){require=req}req.version=version;req.jsExtRegExp=/^\/|:|\?|\.js$/;req.isBrowser=isBrowser;s=req.s={contexts:contexts,newContext:newContext};req({});addRequireMethods(req);if(isBrowser){head=s.head=document.getElementsByTagName("head")[0];baseElement=document.getElementsByTagName("base")[0];if(baseElement){head=s.head=baseElement.parentNode}}req.onError=function(err){throw err};req.load=function(context,moduleName,url){var config=(context&&context.config)||{},node;if(isBrowser){node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");node.type=config.scriptType||"text/javascript";node.charset="utf-8";node.async=true;node.setAttribute("data-requirecontext",context.contextName);node.setAttribute("data-requiremodule",moduleName);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){useInteractive=true;node.attachEvent("onreadystatechange",context.onScriptLoad)}else{node.addEventListener("load",context.onScriptLoad,false);node.addEventListener("error",context.onScriptError,false)}node.src=url;currentlyAddingScript=node;if(baseElement){head.insertBefore(node,baseElement)}else{head.appendChild(node)}currentlyAddingScript=null;return node}else{if(isWebWorker){importScripts(url);context.completeLoad(moduleName)}}};function getInteractiveScript(){if(interactiveScript&&interactiveScript.readyState==="interactive"){return interactiveScript}eachReverse(scripts(),function(script){if(script.readyState==="interactive"){return(interactiveScript=script)}});return interactiveScript}if(isBrowser){eachReverse(scripts(),function(script){if(!head){head=script.parentNode}dataMain=script.getAttribute("data-main");if(dataMain){if(!cfg.baseUrl){src=dataMain.split("/");mainScript=src.pop();subPath=src.length?src.join("/")+"/":"./";cfg.baseUrl=subPath;dataMain=mainScript}dataMain=dataMain.replace(jsSuffixRegExp,"");cfg.deps=cfg.deps?cfg.deps.concat(dataMain):[dataMain];return true}})}define=function(name,deps,callback){var node,context;if(typeof name!=="string"){callback=deps;deps=name;name=null}if(!isArray(deps)){callback=deps;deps=[]}if(!deps.length&&isFunction(callback)){if(callback.length){callback.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(match,dep){deps.push(dep)});deps=(callback.length===1?["require"]:["require","exports","module"]).concat(deps)}}if(useInteractive){node=currentlyAddingScript||getInteractiveScript();if(node){if(!name){name=node.getAttribute("data-requiremodule")}context=contexts[node.getAttribute("data-requirecontext")]}}(context?context.defQueue:globalDefQueue).push([name,deps,callback])};define.amd={jQuery:true};req.exec=function(text){return eval(text)};req(cfg)}(this));
\ No newline at end of file
diff -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd -r 3668de7a24ef93da9ef6d5ef7f45a61966fbe19f static/scripts/packed/viz/circster.js
--- /dev/null
+++ b/static/scripts/packed/viz/circster.js
@@ -0,0 +1,1 @@
+define(["libs/d3","viz/visualization"],function(d,e){var c=function(){this.initialize&&this.initialize.apply(this,arguments)};c.extend=Backbone.Model.extend;var b=Backbone.View.extend({className:"circster",initialize:function(h){this.total_gap=h.total_gap;this.genome=h.genome;this.dataset_arc_height=h.dataset_arc_height;this.track_gap=5},render:function(){var j=this,l=this.dataset_arc_height,m=j.$el.width(),h=j.$el.height(),k=(Math.min(m,h)/2-this.model.get("tracks").length*(this.dataset_arc_height+this.track_gap));var i=d.select(j.$el[0]).append("svg").attr("width",m).attr("height",h).attr("pointer-events","all").append("svg:g").call(d.behavior.zoom().on("zoom",function(){i.attr("transform","translate("+d.event.translate+") scale("+d.event.scale+")")})).attr("transform","translate("+m/2+","+h/2+")").append("svg:g");this.model.get("tracks").each(function(n,p){var q=n.get("genome_wide_data"),r=k+p*(l+j.track_gap),o=(q instanceof e.GenomeWideBigWigData?f:CircsterSummaryTreeTrackRenderer);track_renderer=new o({track:n,radius_start:r,radius_end:r+l,genome:j.genome,total_gap:j.total_gap});track_renderer.render(i)})}});var a=c.extend({initialize:function(h){this.options=h},render:function(i){genome_arcs=this.chroms_layout(),chroms_arcs=this.genome_data_layout();var n=this.options.radius_start,l=this.options.radius_end,o=i.append("g").attr("id","inner-arc"),m=d.svg.arc().innerRadius(n).outerRadius(l),h=o.selectAll("#inner-arc>path").data(genome_arcs).enter().append("path").attr("d",m).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(p){return p.data.chrom});var j=this.options.track.get("prefs"),k=j.block_color;_.each(chroms_arcs,function(p){if(!p){return}var s=i.append("g"),r=d.svg.arc().innerRadius(n),q=s.selectAll("path").data(p).enter();q.append("path").attr("d",r).style("stroke",k)})},chroms_layout:function(){var i=this.options.genome.get_chroms_info(),k=d.layout.pie().value(function(m){return m.len}).sort(null),l=k(i),h=this.options.total_gap/i.length,j=_.map(l,function(o,n){var m=o.endAngle-h;o.endAngle=(m>o.startAngle?m:o.startAngle);return o});return j},chrom_data_layout:function(k,j,i,l,h){},genome_data_layout:function(){var i=this,h=this.chroms_layout(),m=this.options.track.get("genome_wide_data"),l=this.options.radius_start,j=this.options.radius_end,k=_.zip(h,m.get("data")),n=_.map(k,function(p){var q=p[0],o=p[1];return i.chrom_data_layout(q,o,l,j,m.get("min"),m.get("max"))});return n}});var g=a.extend({chrom_data_layout:function(r,i,o,n,k,p){if(!i||typeof i==="string"){return null}var l=i[0],q=i[3],j=d.scale.linear().domain([k,p]).range([o,n]),m=d.layout.pie().value(function(s){return q}).startAngle(r.startAngle).endAngle(r.endAngle),h=m(l);_.each(l,function(s,t){h[t].outerRadius=j(s[1])});return h}});var f=a.extend({chrom_data_layout:function(q,i,o,n,k,p){var l=i.data;if(l.length===0){return}var j=d.scale.linear().domain([k,p]).range([o,n]),m=d.layout.pie().value(function(s,r){if(r+1===l.length){return 0}return l[r+1][0]-l[r][0]}).startAngle(q.startAngle).endAngle(q.endAngle),h=m(l);_.each(l,function(r,s){h[s].outerRadius=j(r[1])});return h}});return{CircsterView: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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/3e41b027b184/
changeset: 3e41b027b184
user: james_taylor
date: 2012-09-12 00:24:26
summary: circster: moving some rendering code around to enable faster bigwig rendering, adding a Base class using Backbone style inheritence
affected #: 1 file
diff -r 72f1dcdf1c542e6d4689305f5de2077c0bfb4035 -r 3e41b027b1840bfd7f6e08b7c425c87508a19c4f static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -7,7 +7,7 @@
* changes; this is advantageous because multiple views can use the same object
* and models can be used without views.
*/
-
+
// --------- Models ---------
/**
@@ -690,12 +690,58 @@
});
+// General backbone style inheritence
+var Base = function() { this.__init__ && this.__init__.apply(this, arguments) }; Base.extend = Backbone.Model.extend;
-var CircsterDataLayout = Backbone.Model.extend({
- defaults: {
- genome: null,
- dataset: null,
- total_gap: null
+// ---- Circster views ----
+
+var CircsterTrackView = Base.extend( {
+
+ __init__: function( options ) {
+ this.options = options;
+ },
+
+ render: function() {
+
+ genome_arcs = this.chroms_layout(),
+ chroms_arcs = this.genome_data_layout();
+
+ // -- Render. --
+
+ // Draw background arcs for each chromosome.
+ var svg = this.options.svg,
+ radius_start = this.options.radius_start,
+ radius_end = this.options.radius_end,
+ base_arc = svg.append("g").attr("id", "inner-arc"),
+ arc_gen = d3.svg.arc()
+ .innerRadius(radius_start)
+ .outerRadius(radius_end),
+ // Draw arcs.
+ chroms_elts = base_arc.selectAll("#inner-arc>path")
+ .data(genome_arcs).enter().append("path")
+ .attr("d", arc_gen)
+ .style("stroke", "#ccc")
+ .style("fill", "#ccc")
+ .append("title").text(function(d) { return d.data.chrom; });
+
+ // For each chromosome, draw dataset.
+ var prefs = this.options.track.get('prefs'),
+ block_color = prefs.block_color;
+
+ _.each(chroms_arcs, function(chrom_layout) {
+ if (!chrom_layout) { return; }
+
+ var group = svg.append("g"),
+ arc_gen = d3.svg.arc().innerRadius(radius_start),
+ dataset_elts = group.selectAll("path")
+ .data(chrom_layout).enter()
+ ;
+ //.style("stroke", block_color)
+ //.style("fill", block_color)
+
+ dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color)
+
+ });
},
/**
@@ -704,10 +750,10 @@
*/
chroms_layout: function() {
// Setup chroms layout using pie.
- var chroms_info = this.attributes.genome.get_chroms_info(),
+ var chroms_info = this.options.genome.get_chroms_info(),
pie_layout = d3.layout.pie().value(function(d) { return d.len; }).sort(null),
init_arcs = pie_layout(chroms_info),
- gap_per_chrom = this.attributes.total_gap / chroms_info.length,
+ gap_per_chrom = this.options.total_gap / chroms_info.length,
chrom_arcs = _.map(init_arcs, function(arc, index) {
// For short chroms, endAngle === startAngle.
var new_endAngle = arc.endAngle - gap_per_chrom;
@@ -726,9 +772,9 @@
genome_data_layout: function() {
var self = this,
chrom_arcs = this.chroms_layout(),
- dataset = this.get('track').get('genome_wide_data'),
- r_start = this.get('radius_start'),
- r_end = this.get('radius_end'),
+ dataset = this.options.track.get('genome_wide_data'),
+ r_start = this.options.radius_start,
+ r_end = this.options.radius_end,
// Merge chroms layout with data.
layout_and_data = _.zip(chrom_arcs, dataset.get('data')),
@@ -747,7 +793,7 @@
/**
* Layout for summary tree data in a circster visualization.
*/
-var CircsterSummaryTreeLayout = CircsterDataLayout.extend({
+var CircsterSummaryTrackView = CircsterTrackView.extend({
/**
* Returns layouts for drawing a chromosome's data.
@@ -782,7 +828,7 @@
/**
* Layout for BigWig data in a circster visualization.
*/
-var CircsterBigWigLayout = CircsterDataLayout.extend({
+var CircsterBigWigTrackView = CircsterTrackView.extend({
/**
* Returns layouts for drawing a chromosome's data.
@@ -860,47 +906,19 @@
this.model.get('tracks').each(function(track, index) {
var dataset = track.get('genome_wide_data'),
radius_start = init_radius_start + index * (dataset_arc_height + self.track_gap),
- // Layout chromosome arcs.
- layout_class = (dataset instanceof GenomeWideBigWigData ? CircsterBigWigLayout : CircsterSummaryTreeLayout ),
- arcs_layout = new layout_class({
- track: track,
- radius_start: radius_start,
- radius_end: radius_start + dataset_arc_height,
- genome: self.genome,
- total_gap: self.total_gap
- }),
- genome_arcs = arcs_layout.chroms_layout(),
- chroms_arcs = arcs_layout.genome_data_layout();
-
- // -- Render. --
+ track_view_class = (dataset instanceof GenomeWideBigWigData ? CircsterBigWigTrackView : CircsterSummaryTreeTrackView );
- // Draw background arcs for each chromosome.
- var base_arc = svg.append("g").attr("id", "inner-arc"),
- arc_gen = d3.svg.arc()
- .innerRadius(radius_start)
- .outerRadius(radius_start + dataset_arc_height),
- // Draw arcs.
- chroms_elts = base_arc.selectAll("#inner-arc>path")
- .data(genome_arcs).enter().append("path")
- .attr("d", arc_gen)
- .style("stroke", "#ccc")
- .style("fill", "#ccc")
- .append("title").text(function(d) { return d.data.chrom; });
+ track_view = new track_view_class({
+ track: track,
+ radius_start: radius_start,
+ radius_end: radius_start + dataset_arc_height,
+ genome: self.genome,
+ total_gap: self.total_gap,
+ svg: svg
+ });
- // For each chromosome, draw dataset.
- var prefs = track.get('prefs'),
- block_color = prefs.block_color;
- _.each(chroms_arcs, function(chrom_layout) {
- if (!chrom_layout) { return; }
+ track_view.render();
- var group = svg.append("g"),
- arc_gen = d3.svg.arc().innerRadius(radius_start),
- dataset_elts = group.selectAll("path")
- .data(chrom_layout).enter().append("path")
- .attr("d", arc_gen)
- .style("stroke", block_color)
- .style("fill", block_color);
- });
});
}
});
https://bitbucket.org/galaxy/galaxy-central/changeset/db2be15c1258/
changeset: db2be15c1258
user: james_taylor
date: 2012-09-12 00:43:09
summary: circster: pull out circster code an encapsulate
affected #: 3 files
diff -r 3e41b027b1840bfd7f6e08b7c425c87508a19c4f -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 static/scripts/viz/circster.js
--- /dev/null
+++ b/static/scripts/viz/circster.js
@@ -0,0 +1,244 @@
+(function(){
+
+// General backbone style inheritence
+var Base = function() { this.initialize && this.initialize.apply(this, arguments) }; Base.extend = Backbone.Model.extend;
+
+// ---- Circster views ----
+
+/**
+ * -- Views --
+ */
+
+var CircsterView = Backbone.View.extend({
+ className: 'circster',
+
+ initialize: function(options) {
+ this.total_gap = options.total_gap;
+ this.genome = options.genome;
+ this.dataset_arc_height = options.dataset_arc_height;
+ this.track_gap = 5;
+ },
+
+ render: function() {
+ var self = this,
+ dataset_arc_height = this.dataset_arc_height,
+ width = self.$el.width(),
+ height = self.$el.height(),
+ // Compute radius start based on model, will be centered
+ // and fit entirely inside element by default
+ init_radius_start = ( Math.min(width,height)/2
+ - this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) );
+
+ // Set up SVG element.
+ var svg = d3.select(self.$el[0])
+ .append("svg")
+ .attr("width", width)
+ .attr("height", height)
+ .attr("pointer-events", "all")
+ // Set up zooming, dragging.
+ .append('svg:g')
+ .call(d3.behavior.zoom().on('zoom', function() {
+ svg.attr("transform",
+ "translate(" + d3.event.translate + ")"
+ + " scale(" + d3.event.scale + ")");
+ }))
+ .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
+ .append('svg:g')
+
+
+ // -- Render each dataset in the visualization. --
+ this.model.get('tracks').each(function(track, index) {
+ var dataset = track.get('genome_wide_data'),
+ radius_start = init_radius_start + index * (dataset_arc_height + self.track_gap),
+ track_view_class = (dataset instanceof GenomeWideBigWigData ? CircsterBigWigTrackView : CircsterSummaryTreeTrackView );
+
+ track_view = new track_view_class({
+ track: track,
+ radius_start: radius_start,
+ radius_end: radius_start + dataset_arc_height,
+ genome: self.genome,
+ total_gap: self.total_gap,
+ svg: svg
+ });
+
+ track_view.render();
+
+ });
+ }
+});
+
+var CircsterTrackView = Base.extend( {
+
+ initialize: function( options ) {
+ this.options = options;
+ },
+
+ render: function() {
+
+ genome_arcs = this.chroms_layout(),
+ chroms_arcs = this.genome_data_layout();
+
+ // -- Render. --
+
+ // Draw background arcs for each chromosome.
+ var svg = this.options.svg,
+ radius_start = this.options.radius_start,
+ radius_end = this.options.radius_end,
+ base_arc = svg.append("g").attr("id", "inner-arc"),
+ arc_gen = d3.svg.arc()
+ .innerRadius(radius_start)
+ .outerRadius(radius_end),
+ // Draw arcs.
+ chroms_elts = base_arc.selectAll("#inner-arc>path")
+ .data(genome_arcs).enter().append("path")
+ .attr("d", arc_gen)
+ .style("stroke", "#ccc")
+ .style("fill", "#ccc")
+ .append("title").text(function(d) { return d.data.chrom; });
+
+ // For each chromosome, draw dataset.
+ var prefs = this.options.track.get('prefs'),
+ block_color = prefs.block_color;
+
+ _.each(chroms_arcs, function(chrom_layout) {
+ if (!chrom_layout) { return; }
+
+ var group = svg.append("g"),
+ arc_gen = d3.svg.arc().innerRadius(radius_start),
+ dataset_elts = group.selectAll("path")
+ .data(chrom_layout).enter()
+ ;
+ //.style("stroke", block_color)
+ //.style("fill", block_color)
+
+ dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color)
+
+ });
+ },
+
+ /**
+ * Returns arc layouts for genome's chromosomes/contigs. Arcs are arranged in a circle
+ * separated by gaps.
+ */
+ chroms_layout: function() {
+ // Setup chroms layout using pie.
+ var chroms_info = this.options.genome.get_chroms_info(),
+ pie_layout = d3.layout.pie().value(function(d) { return d.len; }).sort(null),
+ init_arcs = pie_layout(chroms_info),
+ gap_per_chrom = this.options.total_gap / chroms_info.length,
+ chrom_arcs = _.map(init_arcs, function(arc, index) {
+ // For short chroms, endAngle === startAngle.
+ var new_endAngle = arc.endAngle - gap_per_chrom;
+ arc.endAngle = (new_endAngle > arc.startAngle ? new_endAngle : arc.startAngle);
+ return arc;
+ });
+ return chrom_arcs;
+ },
+
+ /**
+ * Returns layouts for drawing a chromosome's data.
+ */
+ chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, max) {
+ },
+
+ genome_data_layout: function() {
+ var self = this,
+ chrom_arcs = this.chroms_layout(),
+ dataset = this.options.track.get('genome_wide_data'),
+ r_start = this.options.radius_start,
+ r_end = this.options.radius_end,
+
+ // Merge chroms layout with data.
+ layout_and_data = _.zip(chrom_arcs, dataset.get('data')),
+
+ // Do dataset layout for each chromosome's data using pie layout.
+ chroms_data_layout = _.map(layout_and_data, function(chrom_info) {
+ var chrom_arc = chrom_info[0],
+ chrom_data = chrom_info[1];
+ return self.chrom_data_layout(chrom_arc, chrom_data, r_start, r_end, dataset.get('min'), dataset.get('max'));
+ });
+
+ return chroms_data_layout;
+ }
+});
+
+/**
+ * Layout for summary tree data in a circster visualization.
+ */
+var CircsterSummaryTrackView = CircsterTrackView.extend({
+
+ /**
+ * Returns layouts for drawing a chromosome's data.
+ */
+ chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
+ // If no chrom data, return null.
+ if (!chrom_data || typeof chrom_data === "string") {
+ return null;
+ }
+
+ var data = chrom_data[0],
+ delta = chrom_data[3],
+ scale = d3.scale.linear()
+ .domain( [min, max] )
+ .range( [inner_radius, outer_radius] ),
+ arc_layout = d3.layout.pie().value(function(d) {
+ return delta;
+ })
+ .startAngle(chrom_arc.startAngle)
+ .endAngle(chrom_arc.endAngle),
+ arcs = arc_layout(data);
+
+ // Use scale to assign outer radius.
+ _.each(data, function(datum, index) {
+ arcs[index].outerRadius = scale(datum[1]);
+ });
+
+ return arcs;
+ }
+});
+
+/**
+ * Layout for BigWig data in a circster visualization.
+ */
+var CircsterBigWigTrackView = CircsterTrackView.extend({
+
+ /**
+ * Returns layouts for drawing a chromosome's data.
+ */
+ chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
+ var data = chrom_data.data;
+ if (data.length === 0) { return; }
+
+ var scale = d3.scale.linear()
+ .domain( [min, max] )
+ .range( [inner_radius, outer_radius] ),
+ arc_layout = d3.layout.pie().value(function(d, i) {
+ // If at end of data, draw nothing.
+ if (i + 1 === data.length) { return 0; }
+
+ // Layout is from current position to next position.
+ return data[i+1][0] - data[i][0];
+ })
+ .startAngle(chrom_arc.startAngle)
+ .endAngle(chrom_arc.endAngle),
+ arcs = arc_layout(data);
+
+ // Use scale to assign outer radius.
+ _.each(data, function(datum, index) {
+ arcs[index].outerRadius = scale(datum[1]);
+ });
+
+ return arcs;
+ }
+
+});
+
+// ---- Browser or CommonJS compatible exports ----
+
+if (typeof exports === 'undefined') {
+ var exports = this;
+}
+
+exports.CircsterView = CircsterView;
+
+}).call(this);
diff -r 3e41b027b1840bfd7f6e08b7c425c87508a19c4f -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -690,239 +690,6 @@
});
-// General backbone style inheritence
-var Base = function() { this.__init__ && this.__init__.apply(this, arguments) }; Base.extend = Backbone.Model.extend;
-
-// ---- Circster views ----
-
-var CircsterTrackView = Base.extend( {
-
- __init__: function( options ) {
- this.options = options;
- },
-
- render: function() {
-
- genome_arcs = this.chroms_layout(),
- chroms_arcs = this.genome_data_layout();
-
- // -- Render. --
-
- // Draw background arcs for each chromosome.
- var svg = this.options.svg,
- radius_start = this.options.radius_start,
- radius_end = this.options.radius_end,
- base_arc = svg.append("g").attr("id", "inner-arc"),
- arc_gen = d3.svg.arc()
- .innerRadius(radius_start)
- .outerRadius(radius_end),
- // Draw arcs.
- chroms_elts = base_arc.selectAll("#inner-arc>path")
- .data(genome_arcs).enter().append("path")
- .attr("d", arc_gen)
- .style("stroke", "#ccc")
- .style("fill", "#ccc")
- .append("title").text(function(d) { return d.data.chrom; });
-
- // For each chromosome, draw dataset.
- var prefs = this.options.track.get('prefs'),
- block_color = prefs.block_color;
-
- _.each(chroms_arcs, function(chrom_layout) {
- if (!chrom_layout) { return; }
-
- var group = svg.append("g"),
- arc_gen = d3.svg.arc().innerRadius(radius_start),
- dataset_elts = group.selectAll("path")
- .data(chrom_layout).enter()
- ;
- //.style("stroke", block_color)
- //.style("fill", block_color)
-
- dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color)
-
- });
- },
-
- /**
- * Returns arc layouts for genome's chromosomes/contigs. Arcs are arranged in a circle
- * separated by gaps.
- */
- chroms_layout: function() {
- // Setup chroms layout using pie.
- var chroms_info = this.options.genome.get_chroms_info(),
- pie_layout = d3.layout.pie().value(function(d) { return d.len; }).sort(null),
- init_arcs = pie_layout(chroms_info),
- gap_per_chrom = this.options.total_gap / chroms_info.length,
- chrom_arcs = _.map(init_arcs, function(arc, index) {
- // For short chroms, endAngle === startAngle.
- var new_endAngle = arc.endAngle - gap_per_chrom;
- arc.endAngle = (new_endAngle > arc.startAngle ? new_endAngle : arc.startAngle);
- return arc;
- });
- return chrom_arcs;
- },
-
- /**
- * Returns layouts for drawing a chromosome's data.
- */
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, max) {
- },
-
- genome_data_layout: function() {
- var self = this,
- chrom_arcs = this.chroms_layout(),
- dataset = this.options.track.get('genome_wide_data'),
- r_start = this.options.radius_start,
- r_end = this.options.radius_end,
-
- // Merge chroms layout with data.
- layout_and_data = _.zip(chrom_arcs, dataset.get('data')),
-
- // Do dataset layout for each chromosome's data using pie layout.
- chroms_data_layout = _.map(layout_and_data, function(chrom_info) {
- var chrom_arc = chrom_info[0],
- chrom_data = chrom_info[1];
- return self.chrom_data_layout(chrom_arc, chrom_data, r_start, r_end, dataset.get('min'), dataset.get('max'));
- });
-
- return chroms_data_layout;
- }
-});
-
-/**
- * Layout for summary tree data in a circster visualization.
- */
-var CircsterSummaryTrackView = CircsterTrackView.extend({
-
- /**
- * Returns layouts for drawing a chromosome's data.
- */
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
- // If no chrom data, return null.
- if (!chrom_data || typeof chrom_data === "string") {
- return null;
- }
-
- var data = chrom_data[0],
- delta = chrom_data[3],
- scale = d3.scale.linear()
- .domain( [min, max] )
- .range( [inner_radius, outer_radius] ),
- arc_layout = d3.layout.pie().value(function(d) {
- return delta;
- })
- .startAngle(chrom_arc.startAngle)
- .endAngle(chrom_arc.endAngle),
- arcs = arc_layout(data);
-
- // Use scale to assign outer radius.
- _.each(data, function(datum, index) {
- arcs[index].outerRadius = scale(datum[1]);
- });
-
- return arcs;
- }
-});
-
-/**
- * Layout for BigWig data in a circster visualization.
- */
-var CircsterBigWigTrackView = CircsterTrackView.extend({
-
- /**
- * Returns layouts for drawing a chromosome's data.
- */
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
- var data = chrom_data.data;
- if (data.length === 0) { return; }
-
- var scale = d3.scale.linear()
- .domain( [min, max] )
- .range( [inner_radius, outer_radius] ),
- arc_layout = d3.layout.pie().value(function(d, i) {
- // If at end of data, draw nothing.
- if (i + 1 === data.length) { return 0; }
-
- // Layout is from current position to next position.
- return data[i+1][0] - data[i][0];
- })
- .startAngle(chrom_arc.startAngle)
- .endAngle(chrom_arc.endAngle),
- arcs = arc_layout(data);
-
- // Use scale to assign outer radius.
- _.each(data, function(datum, index) {
- arcs[index].outerRadius = scale(datum[1]);
- });
-
- return arcs;
- }
-
-});
-
-/**
- * -- Views --
- */
-
-var CircsterView = Backbone.View.extend({
- className: 'circster',
-
- initialize: function(options) {
- this.total_gap = options.total_gap;
- this.genome = options.genome;
- this.dataset_arc_height = options.dataset_arc_height;
- this.track_gap = 5;
- },
-
- render: function() {
- var self = this,
- dataset_arc_height = this.dataset_arc_height,
- width = self.$el.width(),
- height = self.$el.height(),
- // Compute radius start based on model, will be centered
- // and fit entirely inside element by default
- init_radius_start = ( Math.min(width,height)/2
- - this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) );
-
- // Set up SVG element.
- var svg = d3.select(self.$el[0])
- .append("svg")
- .attr("width", width)
- .attr("height", height)
- .attr("pointer-events", "all")
- // Set up zooming, dragging.
- .append('svg:g')
- .call(d3.behavior.zoom().on('zoom', function() {
- svg.attr("transform",
- "translate(" + d3.event.translate + ")"
- + " scale(" + d3.event.scale + ")");
- }))
- .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
- .append('svg:g')
-
-
- // -- Render each dataset in the visualization. --
- this.model.get('tracks').each(function(track, index) {
- var dataset = track.get('genome_wide_data'),
- radius_start = init_radius_start + index * (dataset_arc_height + self.track_gap),
- track_view_class = (dataset instanceof GenomeWideBigWigData ? CircsterBigWigTrackView : CircsterSummaryTreeTrackView );
-
- track_view = new track_view_class({
- track: track,
- radius_start: radius_start,
- radius_end: radius_start + dataset_arc_height,
- genome: self.genome,
- total_gap: self.total_gap,
- svg: svg
- });
-
- track_view.render();
-
- });
- }
-});
-
/**
* -- Routers --
*/
diff -r 3e41b027b1840bfd7f6e08b7c425c87508a19c4f -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 templates/visualization/circster.mako
--- a/templates/visualization/circster.mako
+++ b/templates/visualization/circster.mako
@@ -16,7 +16,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/d3", "mvc/data", "viz/visualization" )}
+ ${h.js( "libs/d3", "mvc/data", "viz/visualization", "viz/circster" )}
<script type="text/javascript">
$(function() {
https://bitbucket.org/galaxy/galaxy-central/changeset/45ddaa89e985/
changeset: 45ddaa89e985
user: james_taylor
date: 2012-09-12 21:38:52
summary: js: introducing a requirejs starting with circster. circster.js is a pure AMD module. visualization.js is AMD/browser compatible
affected #: 5 files
diff -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -13,4 +13,5 @@
var DatasetCollection = Backbone.Collection.extend({
model: Dataset
-});
\ No newline at end of file
+});
+
diff -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd static/scripts/require.js
--- /dev/null
+++ b/static/scripts/require.js
@@ -0,0 +1,2041 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */
+
+var requirejs, require, define;
+(function (global) {
+ var req, s, head, baseElement, dataMain, src,
+ interactiveScript, currentlyAddingScript, mainScript, subPath,
+ version = '2.0.6',
+ commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+ cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+ jsSuffixRegExp = /\.js$/,
+ currDirRegExp = /^\.\//,
+ op = Object.prototype,
+ ostring = op.toString,
+ hasOwn = op.hasOwnProperty,
+ ap = Array.prototype,
+ aps = ap.slice,
+ apsp = ap.splice,
+ isBrowser = !!(typeof window !== 'undefined' && navigator && document),
+ isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+ //PS3 indicates loaded and complete, but need to wait for complete
+ //specifically. Sequence is 'loading', 'loaded', execution,
+ // then 'complete'. The UA check is unfortunate, but not sure how
+ //to feature test w/o causing perf issues.
+ readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+ /^complete$/ : /^(complete|loaded)$/,
+ defContextName = '_',
+ //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+ isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+ contexts = {},
+ cfg = {},
+ globalDefQueue = [],
+ useInteractive = false;
+
+ function isFunction(it) {
+ return ostring.call(it) === '[object Function]';
+ }
+
+ function isArray(it) {
+ return ostring.call(it) === '[object Array]';
+ }
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Helper function for iterating over an array backwards. If the func
+ * returns a true value, it will break out of the loop.
+ */
+ function eachReverse(ary, func) {
+ if (ary) {
+ var i;
+ for (i = ary.length - 1; i > -1; i -= 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Cycles over properties in an object and calls a function for each
+ * property value. If the function returns a truthy value, then the
+ * iteration is stopped.
+ */
+ function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (obj.hasOwnProperty(prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Simple function to mix in properties from source into target,
+ * but only if target does not already have a property of the same name.
+ * This is not robust in IE for transferring methods that match
+ * Object.prototype names, but the uses of mixin here seem unlikely to
+ * trigger a problem related to that.
+ */
+ function mixin(target, source, force, deepStringMixin) {
+ if (source) {
+ eachProp(source, function (value, prop) {
+ if (force || !hasProp(target, prop)) {
+ if (deepStringMixin && typeof value !== 'string') {
+ if (!target[prop]) {
+ target[prop] = {};
+ }
+ mixin(target[prop], value, force, deepStringMixin);
+ } else {
+ target[prop] = value;
+ }
+ }
+ });
+ }
+ return target;
+ }
+
+ //Similar to Function.prototype.bind, but the 'this' object is specified
+ //first, since it is easier to read/figure out what 'this' will be.
+ function bind(obj, fn) {
+ return function () {
+ return fn.apply(obj, arguments);
+ };
+ }
+
+ function scripts() {
+ return document.getElementsByTagName('script');
+ }
+
+ //Allow getting a global that expressed in
+ //dot notation, like 'a.b.c'.
+ function getGlobal(value) {
+ if (!value) {
+ return value;
+ }
+ var g = global;
+ each(value.split('.'), function (part) {
+ g = g[part];
+ });
+ return g;
+ }
+
+ function makeContextModuleFunc(func, relMap, enableBuildCallback) {
+ return function () {
+ //A version of a require function that passes a moduleName
+ //value for items that may need to
+ //look up paths relative to the moduleName
+ var args = aps.call(arguments, 0), lastArg;
+ if (enableBuildCallback &&
+ isFunction((lastArg = args[args.length - 1]))) {
+ lastArg.__requireJsBuild = true;
+ }
+ args.push(relMap);
+ return func.apply(null, args);
+ };
+ }
+
+ function addRequireMethods(req, context, relMap) {
+ each([
+ ['toUrl'],
+ ['undef'],
+ ['defined', 'requireDefined'],
+ ['specified', 'requireSpecified']
+ ], function (item) {
+ var prop = item[1] || item[0];
+ req[item[0]] = context ? makeContextModuleFunc(context[prop], relMap) :
+ //If no context, then use default context. Reference from
+ //contexts instead of early binding to default context, so
+ //that during builds, the latest instance of the default
+ //context with its config gets used.
+ function () {
+ var ctx = contexts[defContextName];
+ return ctx[prop].apply(ctx, arguments);
+ };
+ });
+ }
+
+ /**
+ * Constructs an error with a pointer to an URL with more information.
+ * @param {String} id the error ID that maps to an ID on a web page.
+ * @param {String} message human readable error.
+ * @param {Error} [err] the original error, if there is one.
+ *
+ * @returns {Error}
+ */
+ function makeError(id, msg, err, requireModules) {
+ var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+ e.requireType = id;
+ e.requireModules = requireModules;
+ if (err) {
+ e.originalError = err;
+ }
+ return e;
+ }
+
+ if (typeof define !== 'undefined') {
+ //If a define is already in play via another AMD loader,
+ //do not overwrite.
+ return;
+ }
+
+ if (typeof requirejs !== 'undefined') {
+ if (isFunction(requirejs)) {
+ //Do not overwrite and existing requirejs instance.
+ return;
+ }
+ cfg = requirejs;
+ requirejs = undefined;
+ }
+
+ //Allow for a require config object
+ if (typeof require !== 'undefined' && !isFunction(require)) {
+ //assume it is a config object.
+ cfg = require;
+ require = undefined;
+ }
+
+ function newContext(contextName) {
+ var inCheckLoaded, Module, context, handlers,
+ checkLoadedTimeoutId,
+ config = {
+ waitSeconds: 7,
+ baseUrl: './',
+ paths: {},
+ pkgs: {},
+ shim: {}
+ },
+ registry = {},
+ undefEvents = {},
+ defQueue = [],
+ defined = {},
+ urlFetched = {},
+ requireCounter = 1,
+ unnormalizedCounter = 1,
+ //Used to track the order in which modules
+ //should be executed, by the order they
+ //load. Important for consistent cycle resolution
+ //behavior.
+ waitAry = [];
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; ary[i]; i += 1) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
+ //End of the line. Keep at least one non-dot
+ //path segment at the front so it can be mapped
+ //correctly to disk. Otherwise, there is likely
+ //no path mapping for a path starting with '..'.
+ //This can still fail, but catches the most reasonable
+ //uses of ..
+ break;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @param {Boolean} applyMap apply the map config to the value. Should
+ * only be done if this normalization is for a dependency ID.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName, applyMap) {
+ var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
+ foundMap, foundI, foundStarMap, starI,
+ baseParts = baseName && baseName.split('/'),
+ normalizedBaseParts = baseParts,
+ map = config.map,
+ starMap = map && map['*'];
+
+ //Adjust any relative paths.
+ if (name && name.charAt(0) === '.') {
+ //If have a base name, try to normalize against it,
+ //otherwise, assume it is a top-level require that will
+ //be relative to baseUrl in the end.
+ if (baseName) {
+ if (config.pkgs[baseName]) {
+ //If the baseName is a package name, then just treat it as one
+ //name to concat the name with.
+ normalizedBaseParts = baseParts = [baseName];
+ } else {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ }
+
+ name = normalizedBaseParts.concat(name.split('/'));
+ trimDots(name);
+
+ //Some use of packages may use a . path to reference the
+ //'main' module name, so normalize for that.
+ pkgConfig = config.pkgs[(pkgName = name[0])];
+ name = name.join('/');
+ if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
+ name = pkgName;
+ }
+ } else if (name.indexOf('./') === 0) {
+ // No baseName, so this is ID is resolved relative
+ // to baseUrl, pull off the leading dot.
+ name = name.substring(2);
+ }
+ }
+
+ //Apply map config if available.
+ if (applyMap && (baseParts || starMap) && map) {
+ nameParts = name.split('/');
+
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join('/');
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = map[baseParts.slice(0, j).join('/')];
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = mapValue[nameSegment];
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundMap) {
+ break;
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
+ foundStarMap = starMap[nameSegment];
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ function removeScript(name) {
+ if (isBrowser) {
+ each(scripts(), function (scriptNode) {
+ if (scriptNode.getAttribute('data-requiremodule') === name &&
+ scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+ scriptNode.parentNode.removeChild(scriptNode);
+ return true;
+ }
+ });
+ }
+ }
+
+ function hasPathFallback(id) {
+ var pathConfig = config.paths[id];
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+ removeScript(id);
+ //Pop off the first array value, since it failed, and
+ //retry
+ pathConfig.shift();
+ context.undef(id);
+ context.require([id]);
+ return true;
+ }
+ }
+
+ /**
+ * Creates a module mapping that includes plugin prefix, module
+ * name, and path. If parentModuleMap is provided it will
+ * also normalize the name via require.normalize()
+ *
+ * @param {String} name the module name
+ * @param {String} [parentModuleMap] parent module map
+ * for the module name, used to resolve relative names.
+ * @param {Boolean} isNormalized: is the ID already normalized.
+ * This is true if this call is done for a define() module ID.
+ * @param {Boolean} applyMap: apply the map config to the ID.
+ * Should only be true if this map is for a dependency.
+ *
+ * @returns {Object}
+ */
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+ var url, pluginModule, suffix,
+ index = name ? name.indexOf('!') : -1,
+ prefix = null,
+ parentName = parentModuleMap ? parentModuleMap.name : null,
+ originalName = name,
+ isDefine = true,
+ normalizedName = '';
+
+ //If no name, then it means it is a require call, generate an
+ //internal name.
+ if (!name) {
+ isDefine = false;
+ name = '_@r' + (requireCounter += 1);
+ }
+
+ if (index !== -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+
+ if (prefix) {
+ prefix = normalize(prefix, parentName, applyMap);
+ pluginModule = defined[prefix];
+ }
+
+ //Account for relative paths if there is a base name.
+ if (name) {
+ if (prefix) {
+ if (pluginModule && pluginModule.normalize) {
+ //Plugin is loaded, use its normalize method.
+ normalizedName = pluginModule.normalize(name, function (name) {
+ return normalize(name, parentName, applyMap);
+ });
+ } else {
+ normalizedName = normalize(name, parentName, applyMap);
+ }
+ } else {
+ //A regular module.
+ normalizedName = normalize(name, parentName, applyMap);
+ url = context.nameToUrl(normalizedName);
+ }
+ }
+
+ //If the id is a plugin id that cannot be determined if it needs
+ //normalization, stamp it with a unique ID so two matching relative
+ //ids that may conflict can be separate.
+ suffix = prefix && !pluginModule && !isNormalized ?
+ '_unnormalized' + (unnormalizedCounter += 1) :
+ '';
+
+ return {
+ prefix: prefix,
+ name: normalizedName,
+ parentMap: parentModuleMap,
+ unnormalized: !!suffix,
+ url: url,
+ originalName: originalName,
+ isDefine: isDefine,
+ id: (prefix ?
+ prefix + '!' + normalizedName :
+ normalizedName) + suffix
+ };
+ }
+
+ function getModule(depMap) {
+ var id = depMap.id,
+ mod = registry[id];
+
+ if (!mod) {
+ mod = registry[id] = new context.Module(depMap);
+ }
+
+ return mod;
+ }
+
+ function on(depMap, name, fn) {
+ var id = depMap.id,
+ mod = registry[id];
+
+ if (hasProp(defined, id) &&
+ (!mod || mod.defineEmitComplete)) {
+ if (name === 'defined') {
+ fn(defined[id]);
+ }
+ } else {
+ getModule(depMap).on(name, fn);
+ }
+ }
+
+ function onError(err, errback) {
+ var ids = err.requireModules,
+ notified = false;
+
+ if (errback) {
+ errback(err);
+ } else {
+ each(ids, function (id) {
+ var mod = registry[id];
+ if (mod) {
+ //Set error on module, so it skips timeout checks.
+ mod.error = err;
+ if (mod.events.error) {
+ notified = true;
+ mod.emit('error', err);
+ }
+ }
+ });
+
+ if (!notified) {
+ req.onError(err);
+ }
+ }
+ }
+
+ /**
+ * Internal method to transfer globalQueue items to this context's
+ * defQueue.
+ */
+ function takeGlobalQueue() {
+ //Push all the globalDefQueue items into the context's defQueue
+ if (globalDefQueue.length) {
+ //Array splice in the values since the context code has a
+ //local var ref to defQueue, so cannot just reassign the one
+ //on context.
+ apsp.apply(defQueue,
+ [defQueue.length - 1, 0].concat(globalDefQueue));
+ globalDefQueue = [];
+ }
+ }
+
+ /**
+ * Helper function that creates a require function object to give to
+ * modules that ask for it as a dependency. It needs to be specific
+ * per module because of the implication of path mappings that may
+ * need to be relative to the module name.
+ */
+ function makeRequire(mod, enableBuildCallback, altRequire) {
+ var relMap = mod && mod.map,
+ modRequire = makeContextModuleFunc(altRequire || context.require,
+ relMap,
+ enableBuildCallback);
+
+ addRequireMethods(modRequire, context, relMap);
+ modRequire.isBrowser = isBrowser;
+
+ return modRequire;
+ }
+
+ handlers = {
+ 'require': function (mod) {
+ return makeRequire(mod);
+ },
+ 'exports': function (mod) {
+ mod.usingExports = true;
+ if (mod.map.isDefine) {
+ return (mod.exports = defined[mod.map.id] = {});
+ }
+ },
+ 'module': function (mod) {
+ return (mod.module = {
+ id: mod.map.id,
+ uri: mod.map.url,
+ config: function () {
+ return (config.config && config.config[mod.map.id]) || {};
+ },
+ exports: defined[mod.map.id]
+ });
+ }
+ };
+
+ function removeWaiting(id) {
+ //Clean up machinery used for waiting modules.
+ delete registry[id];
+
+ each(waitAry, function (mod, i) {
+ if (mod.map.id === id) {
+ waitAry.splice(i, 1);
+ if (!mod.defined) {
+ context.waitCount -= 1;
+ }
+ return true;
+ }
+ });
+ }
+
+ function findCycle(mod, traced, processed) {
+ var id = mod.map.id,
+ depArray = mod.depMaps,
+ foundModule;
+
+ //Do not bother with unitialized modules or not yet enabled
+ //modules.
+ if (!mod.inited) {
+ return;
+ }
+
+ //Found the cycle.
+ if (traced[id]) {
+ return mod;
+ }
+
+ traced[id] = true;
+
+ //Trace through the dependencies.
+ each(depArray, function (depMap) {
+ var depId = depMap.id,
+ depMod = registry[depId];
+
+ if (!depMod || processed[depId] ||
+ !depMod.inited || !depMod.enabled) {
+ return;
+ }
+
+ return (foundModule = findCycle(depMod, traced, processed));
+ });
+
+ processed[id] = true;
+
+ return foundModule;
+ }
+
+ function forceExec(mod, traced, uninited) {
+ var id = mod.map.id,
+ depArray = mod.depMaps;
+
+ if (!mod.inited || !mod.map.isDefine) {
+ return;
+ }
+
+ if (traced[id]) {
+ return defined[id];
+ }
+
+ traced[id] = mod;
+
+ each(depArray, function (depMap) {
+ var depId = depMap.id,
+ depMod = registry[depId],
+ value;
+
+ if (handlers[depId]) {
+ return;
+ }
+
+ if (depMod) {
+ if (!depMod.inited || !depMod.enabled) {
+ //Dependency is not inited,
+ //so this module cannot be
+ //given a forced value yet.
+ uninited[id] = true;
+ return;
+ }
+
+ //Get the value for the current dependency
+ value = forceExec(depMod, traced, uninited);
+
+ //Even with forcing it may not be done,
+ //in particular if the module is waiting
+ //on a plugin resource.
+ if (!uninited[depId]) {
+ mod.defineDepById(depId, value);
+ }
+ }
+ });
+
+ mod.check(true);
+
+ return defined[id];
+ }
+
+ function modCheck(mod) {
+ mod.check();
+ }
+
+ function checkLoaded() {
+ var map, modId, err, usingPathFallback,
+ waitInterval = config.waitSeconds * 1000,
+ //It is possible to disable the wait interval by using waitSeconds of 0.
+ expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+ noLoads = [],
+ stillLoading = false,
+ needCycleCheck = true;
+
+ //Do not bother if this call was a result of a cycle break.
+ if (inCheckLoaded) {
+ return;
+ }
+
+ inCheckLoaded = true;
+
+ //Figure out the state of all the modules.
+ eachProp(registry, function (mod) {
+ map = mod.map;
+ modId = map.id;
+
+ //Skip things that are not enabled or in error state.
+ if (!mod.enabled) {
+ return;
+ }
+
+ if (!mod.error) {
+ //If the module should be executed, and it has not
+ //been inited and time is up, remember it.
+ if (!mod.inited && expired) {
+ if (hasPathFallback(modId)) {
+ usingPathFallback = true;
+ stillLoading = true;
+ } else {
+ noLoads.push(modId);
+ removeScript(modId);
+ }
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
+ stillLoading = true;
+ if (!map.prefix) {
+ //No reason to keep looking for unfinished
+ //loading. If the only stillLoading is a
+ //plugin resource though, keep going,
+ //because it may be that a plugin resource
+ //is waiting on a non-plugin cycle.
+ return (needCycleCheck = false);
+ }
+ }
+ }
+ });
+
+ if (expired && noLoads.length) {
+ //If wait time expired, throw error of unloaded modules.
+ err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+ err.contextName = context.contextName;
+ return onError(err);
+ }
+
+ //Not expired, check for a cycle.
+ if (needCycleCheck) {
+
+ each(waitAry, function (mod) {
+ if (mod.defined) {
+ return;
+ }
+
+ var cycleMod = findCycle(mod, {}, {}),
+ traced = {};
+
+ if (cycleMod) {
+ forceExec(cycleMod, traced, {});
+
+ //traced modules may have been
+ //removed from the registry, but
+ //their listeners still need to
+ //be called.
+ eachProp(traced, modCheck);
+ }
+ });
+
+ //Now that dependencies have
+ //been satisfied, trigger the
+ //completion check that then
+ //notifies listeners.
+ eachProp(registry, modCheck);
+ }
+
+ //If still waiting on loads, and the waiting load is something
+ //other than a plugin resource, or there are still outstanding
+ //scripts, then just try back later.
+ if ((!expired || usingPathFallback) && stillLoading) {
+ //Something is still waiting to load. Wait for it, but only
+ //if a timeout is not already in effect.
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+ checkLoadedTimeoutId = setTimeout(function () {
+ checkLoadedTimeoutId = 0;
+ checkLoaded();
+ }, 50);
+ }
+ }
+
+ inCheckLoaded = false;
+ }
+
+ Module = function (map) {
+ this.events = undefEvents[map.id] || {};
+ this.map = map;
+ this.shim = config.shim[map.id];
+ this.depExports = [];
+ this.depMaps = [];
+ this.depMatched = [];
+ this.pluginMaps = {};
+ this.depCount = 0;
+
+ /* this.exports this.factory
+ this.depMaps = [],
+ this.enabled, this.fetched
+ */
+ };
+
+ Module.prototype = {
+ init: function (depMaps, factory, errback, options) {
+ options = options || {};
+
+ //Do not do more inits if already done. Can happen if there
+ //are multiple define calls for the same module. That is not
+ //a normal, common case, but it is also not unexpected.
+ if (this.inited) {
+ return;
+ }
+
+ this.factory = factory;
+
+ if (errback) {
+ //Register for errors on this module.
+ this.on('error', errback);
+ } else if (this.events.error) {
+ //If no errback already, but there are error listeners
+ //on this module, set up an errback to pass to the deps.
+ errback = bind(this, function (err) {
+ this.emit('error', err);
+ });
+ }
+
+ //Do a copy of the dependency array, so that
+ //source inputs are not modified. For example
+ //"shim" deps are passed in here directly, and
+ //doing a direct modification of the depMaps array
+ //would affect that config.
+ this.depMaps = depMaps && depMaps.slice(0);
+ this.depMaps.rjsSkipMap = depMaps.rjsSkipMap;
+
+ this.errback = errback;
+
+ //Indicate this module has be initialized
+ this.inited = true;
+
+ this.ignore = options.ignore;
+
+ //Could have option to init this module in enabled mode,
+ //or could have been previously marked as enabled. However,
+ //the dependencies are not known until init is called. So
+ //if enabled previously, now trigger dependencies as enabled.
+ if (options.enabled || this.enabled) {
+ //Enable this module and dependencies.
+ //Will call this.check()
+ this.enable();
+ } else {
+ this.check();
+ }
+ },
+
+ defineDepById: function (id, depExports) {
+ var i;
+
+ //Find the index for this dependency.
+ each(this.depMaps, function (map, index) {
+ if (map.id === id) {
+ i = index;
+ return true;
+ }
+ });
+
+ return this.defineDep(i, depExports);
+ },
+
+ defineDep: function (i, depExports) {
+ //Because of cycles, defined callback for a given
+ //export can be called more than once.
+ if (!this.depMatched[i]) {
+ this.depMatched[i] = true;
+ this.depCount -= 1;
+ this.depExports[i] = depExports;
+ }
+ },
+
+ fetch: function () {
+ if (this.fetched) {
+ return;
+ }
+ this.fetched = true;
+
+ context.startTime = (new Date()).getTime();
+
+ var map = this.map;
+
+ //If the manager is for a plugin managed resource,
+ //ask the plugin to load it now.
+ if (this.shim) {
+ makeRequire(this, true)(this.shim.deps || [], bind(this, function () {
+ return map.prefix ? this.callPlugin() : this.load();
+ }));
+ } else {
+ //Regular dependency.
+ return map.prefix ? this.callPlugin() : this.load();
+ }
+ },
+
+ load: function () {
+ var url = this.map.url;
+
+ //Regular dependency.
+ if (!urlFetched[url]) {
+ urlFetched[url] = true;
+ context.load(this.map.id, url);
+ }
+ },
+
+ /**
+ * Checks is the module is ready to define itself, and if so,
+ * define it. If the silent argument is true, then it will just
+ * define, but not notify listeners, and not ask for a context-wide
+ * check of all loaded modules. That is useful for cycle breaking.
+ */
+ check: function (silent) {
+ if (!this.enabled || this.enabling) {
+ return;
+ }
+
+ var err, cjsModule,
+ id = this.map.id,
+ depExports = this.depExports,
+ exports = this.exports,
+ factory = this.factory;
+
+ if (!this.inited) {
+ this.fetch();
+ } else if (this.error) {
+ this.emit('error', this.error);
+ } else if (!this.defining) {
+ //The factory could trigger another require call
+ //that would result in checking this module to
+ //define itself again. If already in the process
+ //of doing that, skip this work.
+ this.defining = true;
+
+ if (this.depCount < 1 && !this.defined) {
+ if (isFunction(factory)) {
+ //If there is an error listener, favor passing
+ //to that instead of throwing an error.
+ if (this.events.error) {
+ try {
+ exports = context.execCb(id, factory, depExports, exports);
+ } catch (e) {
+ err = e;
+ }
+ } else {
+ exports = context.execCb(id, factory, depExports, exports);
+ }
+
+ if (this.map.isDefine) {
+ //If setting exports via 'module' is in play,
+ //favor that over return value and exports. After that,
+ //favor a non-undefined return value over exports use.
+ cjsModule = this.module;
+ if (cjsModule &&
+ cjsModule.exports !== undefined &&
+ //Make sure it is not already the exports value
+ cjsModule.exports !== this.exports) {
+ exports = cjsModule.exports;
+ } else if (exports === undefined && this.usingExports) {
+ //exports already set the defined value.
+ exports = this.exports;
+ }
+ }
+
+ if (err) {
+ err.requireMap = this.map;
+ err.requireModules = [this.map.id];
+ err.requireType = 'define';
+ return onError((this.error = err));
+ }
+
+ } else {
+ //Just a literal value
+ exports = factory;
+ }
+
+ this.exports = exports;
+
+ if (this.map.isDefine && !this.ignore) {
+ defined[id] = exports;
+
+ if (req.onResourceLoad) {
+ req.onResourceLoad(context, this.map, this.depMaps);
+ }
+ }
+
+ //Clean up
+ delete registry[id];
+
+ this.defined = true;
+ context.waitCount -= 1;
+ if (context.waitCount === 0) {
+ //Clear the wait array used for cycles.
+ waitAry = [];
+ }
+ }
+
+ //Finished the define stage. Allow calling check again
+ //to allow define notifications below in the case of a
+ //cycle.
+ this.defining = false;
+
+ if (!silent) {
+ if (this.defined && !this.defineEmitted) {
+ this.defineEmitted = true;
+ this.emit('defined', this.exports);
+ this.defineEmitComplete = true;
+ }
+ }
+ }
+ },
+
+ callPlugin: function () {
+ var map = this.map,
+ id = map.id,
+ pluginMap = makeModuleMap(map.prefix, null, false, true);
+
+ on(pluginMap, 'defined', bind(this, function (plugin) {
+ var load, normalizedMap, normalizedMod,
+ name = this.map.name,
+ parentName = this.map.parentMap ? this.map.parentMap.name : null;
+
+ //If current map is not normalized, wait for that
+ //normalized name to load instead of continuing.
+ if (this.map.unnormalized) {
+ //Normalize the ID if the plugin allows it.
+ if (plugin.normalize) {
+ name = plugin.normalize(name, function (name) {
+ return normalize(name, parentName, true);
+ }) || '';
+ }
+
+ normalizedMap = makeModuleMap(map.prefix + '!' + name,
+ this.map.parentMap,
+ false,
+ true);
+ on(normalizedMap,
+ 'defined', bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true,
+ ignore: true
+ });
+ }));
+ normalizedMod = registry[normalizedMap.id];
+ if (normalizedMod) {
+ if (this.events.error) {
+ normalizedMod.on('error', bind(this, function (err) {
+ this.emit('error', err);
+ }));
+ }
+ normalizedMod.enable();
+ }
+
+ return;
+ }
+
+ load = bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true
+ });
+ });
+
+ load.error = bind(this, function (err) {
+ this.inited = true;
+ this.error = err;
+ err.requireModules = [id];
+
+ //Remove temp unnormalized modules for this module,
+ //since they will never be resolved otherwise now.
+ eachProp(registry, function (mod) {
+ if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+ removeWaiting(mod.map.id);
+ }
+ });
+
+ onError(err);
+ });
+
+ //Allow plugins to load other code without having to know the
+ //context or how to 'complete' the load.
+ load.fromText = function (moduleName, text) {
+ /*jslint evil: true */
+ var hasInteractive = useInteractive;
+
+ //Turn off interactive script matching for IE for any define
+ //calls in the text, then turn it back on at the end.
+ if (hasInteractive) {
+ useInteractive = false;
+ }
+
+ //Prime the system by creating a module instance for
+ //it.
+ getModule(makeModuleMap(moduleName));
+
+ req.exec(text);
+
+ if (hasInteractive) {
+ useInteractive = true;
+ }
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+
+ //Use parentName here since the plugin's name is not reliable,
+ //could be some weird string with no path that actually wants to
+ //reference the parentName's path.
+ plugin.load(map.name, makeRequire(map.parentMap, true, function (deps, cb, er) {
+ deps.rjsSkipMap = true;
+ return context.require(deps, cb, er);
+ }), load, config);
+ }));
+
+ context.enable(pluginMap, this);
+ this.pluginMaps[pluginMap.id] = pluginMap;
+ },
+
+ enable: function () {
+ this.enabled = true;
+
+ if (!this.waitPushed) {
+ waitAry.push(this);
+ context.waitCount += 1;
+ this.waitPushed = true;
+ }
+
+ //Set flag mentioning that the module is enabling,
+ //so that immediate calls to the defined callbacks
+ //for dependencies do not trigger inadvertent load
+ //with the depCount still being zero.
+ this.enabling = true;
+
+ //Enable each dependency
+ each(this.depMaps, bind(this, function (depMap, i) {
+ var id, mod, handler;
+
+ if (typeof depMap === 'string') {
+ //Dependency needs to be converted to a depMap
+ //and wired up to this module.
+ depMap = makeModuleMap(depMap,
+ (this.map.isDefine ? this.map : this.map.parentMap),
+ false,
+ !this.depMaps.rjsSkipMap);
+ this.depMaps[i] = depMap;
+
+ handler = handlers[depMap.id];
+
+ if (handler) {
+ this.depExports[i] = handler(this);
+ return;
+ }
+
+ this.depCount += 1;
+
+ on(depMap, 'defined', bind(this, function (depExports) {
+ this.defineDep(i, depExports);
+ this.check();
+ }));
+
+ if (this.errback) {
+ on(depMap, 'error', this.errback);
+ }
+ }
+
+ id = depMap.id;
+ mod = registry[id];
+
+ //Skip special modules like 'require', 'exports', 'module'
+ //Also, don't call enable if it is already enabled,
+ //important in circular dependency cases.
+ if (!handlers[id] && mod && !mod.enabled) {
+ context.enable(depMap, this);
+ }
+ }));
+
+ //Enable each plugin that is used in
+ //a dependency
+ eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+ var mod = registry[pluginMap.id];
+ if (mod && !mod.enabled) {
+ context.enable(pluginMap, this);
+ }
+ }));
+
+ this.enabling = false;
+
+ this.check();
+ },
+
+ on: function (name, cb) {
+ var cbs = this.events[name];
+ if (!cbs) {
+ cbs = this.events[name] = [];
+ }
+ cbs.push(cb);
+ },
+
+ emit: function (name, evt) {
+ each(this.events[name], function (cb) {
+ cb(evt);
+ });
+ if (name === 'error') {
+ //Now that the error handler was triggered, remove
+ //the listeners, since this broken Module instance
+ //can stay around for a while in the registry/waitAry.
+ delete this.events[name];
+ }
+ }
+ };
+
+ function callGetModule(args) {
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+ }
+
+ function removeListener(node, func, name, ieName) {
+ //Favor detachEvent because of IE9
+ //issue, see attachEvent/addEventListener comment elsewhere
+ //in this file.
+ if (node.detachEvent && !isOpera) {
+ //Probably IE. If not it will throw an error, which will be
+ //useful to know.
+ if (ieName) {
+ node.detachEvent(ieName, func);
+ }
+ } else {
+ node.removeEventListener(name, func, false);
+ }
+ }
+
+ /**
+ * Given an event from a script node, get the requirejs info from it,
+ * and then removes the event listeners on the node.
+ * @param {Event} evt
+ * @returns {Object}
+ */
+ function getScriptData(evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ var node = evt.currentTarget || evt.srcElement;
+
+ //Remove the listeners once here.
+ removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+ removeListener(node, context.onScriptError, 'error');
+
+ return {
+ node: node,
+ id: node && node.getAttribute('data-requiremodule')
+ };
+ }
+
+ return (context = {
+ config: config,
+ contextName: contextName,
+ registry: registry,
+ defined: defined,
+ urlFetched: urlFetched,
+ waitCount: 0,
+ defQueue: defQueue,
+ Module: Module,
+ makeModuleMap: makeModuleMap,
+
+ /**
+ * Set a configuration for the context.
+ * @param {Object} cfg config object to integrate.
+ */
+ configure: function (cfg) {
+ //Make sure the baseUrl ends in a slash.
+ if (cfg.baseUrl) {
+ if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+ cfg.baseUrl += '/';
+ }
+ }
+
+ //Save off the paths and packages since they require special processing,
+ //they are additive.
+ var pkgs = config.pkgs,
+ shim = config.shim,
+ paths = config.paths,
+ map = config.map;
+
+ //Mix in the config values, favoring the new values over
+ //existing ones in context.config.
+ mixin(config, cfg, true);
+
+ //Merge paths.
+ config.paths = mixin(paths, cfg.paths, true);
+
+ //Merge map
+ if (cfg.map) {
+ config.map = mixin(map || {}, cfg.map, true, true);
+ }
+
+ //Merge shim
+ if (cfg.shim) {
+ eachProp(cfg.shim, function (value, id) {
+ //Normalize the structure
+ if (isArray(value)) {
+ value = {
+ deps: value
+ };
+ }
+ if (value.exports && !value.exports.__buildReady) {
+ value.exports = context.makeShimExports(value.exports);
+ }
+ shim[id] = value;
+ });
+ config.shim = shim;
+ }
+
+ //Adjust packages if necessary.
+ if (cfg.packages) {
+ each(cfg.packages, function (pkgObj) {
+ var location;
+
+ pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
+ location = pkgObj.location;
+
+ //Create a brand new object on pkgs, since currentPackages can
+ //be passed in again, and config.pkgs is the internal transformed
+ //state for all package configs.
+ pkgs[pkgObj.name] = {
+ name: pkgObj.name,
+ location: location || pkgObj.name,
+ //Remove leading dot in main, so main paths are normalized,
+ //and remove any trailing .js, since different package
+ //envs have different conventions: some use a module name,
+ //some use a file name.
+ main: (pkgObj.main || 'main')
+ .replace(currDirRegExp, '')
+ .replace(jsSuffixRegExp, '')
+ };
+ });
+
+ //Done with modifications, assing packages back to context config
+ config.pkgs = pkgs;
+ }
+
+ //If there are any "waiting to execute" modules in the registry,
+ //update the maps for them, since their info, like URLs to load,
+ //may have changed.
+ eachProp(registry, function (mod, id) {
+ //If module already has init called, since it is too
+ //late to modify them, and ignore unnormalized ones
+ //since they are transient.
+ if (!mod.inited && !mod.map.unnormalized) {
+ mod.map = makeModuleMap(id);
+ }
+ });
+
+ //If a deps array or a config callback is specified, then call
+ //require with those args. This is useful when require is defined as a
+ //config object before require.js is loaded.
+ if (cfg.deps || cfg.callback) {
+ context.require(cfg.deps || [], cfg.callback);
+ }
+ },
+
+ makeShimExports: function (exports) {
+ var func;
+ if (typeof exports === 'string') {
+ func = function () {
+ return getGlobal(exports);
+ };
+ //Save the exports for use in nodefine checking.
+ func.exports = exports;
+ return func;
+ } else {
+ return function () {
+ return exports.apply(global, arguments);
+ };
+ }
+ },
+
+ requireDefined: function (id, relMap) {
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+ },
+
+ requireSpecified: function (id, relMap) {
+ id = makeModuleMap(id, relMap, false, true).id;
+ return hasProp(defined, id) || hasProp(registry, id);
+ },
+
+ require: function (deps, callback, errback, relMap) {
+ var moduleName, id, map, requireMod, args;
+ if (typeof deps === 'string') {
+ if (isFunction(callback)) {
+ //Invalid call
+ return onError(makeError('requireargs', 'Invalid require call'), errback);
+ }
+
+ //Synchronous access to one module. If require.get is
+ //available (as in the Node adapter), prefer that.
+ //In this case deps is the moduleName and callback is
+ //the relMap
+ if (req.get) {
+ return req.get(context, deps, callback);
+ }
+
+ //Just return the module wanted. In this scenario, the
+ //second arg (if passed) is just the relMap.
+ moduleName = deps;
+ relMap = callback;
+
+ //Normalize module name, if it contains . or ..
+ map = makeModuleMap(moduleName, relMap, false, true);
+ id = map.id;
+
+ if (!hasProp(defined, id)) {
+ return onError(makeError('notloaded', 'Module name "' +
+ id +
+ '" has not been loaded yet for context: ' +
+ contextName));
+ }
+ return defined[id];
+ }
+
+ //Callback require. Normalize args. if callback or errback is
+ //not a function, it means it is a relMap. Test errback first.
+ if (errback && !isFunction(errback)) {
+ relMap = errback;
+ errback = undefined;
+ }
+ if (callback && !isFunction(callback)) {
+ relMap = callback;
+ callback = undefined;
+ }
+
+ //Any defined modules in the global queue, intake them now.
+ takeGlobalQueue();
+
+ //Make sure any remaining defQueue items get properly processed.
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
+ } else {
+ //args are id, deps, factory. Should be normalized by the
+ //define() function.
+ callGetModule(args);
+ }
+ }
+
+ //Mark all the dependencies as needing to be loaded.
+ requireMod = getModule(makeModuleMap(null, relMap));
+
+ requireMod.init(deps, callback, errback, {
+ enabled: true
+ });
+
+ checkLoaded();
+
+ return context.require;
+ },
+
+ undef: function (id) {
+ //Bind any waiting define() calls to this context,
+ //fix for #408
+ takeGlobalQueue();
+
+ var map = makeModuleMap(id, null, true),
+ mod = registry[id];
+
+ delete defined[id];
+ delete urlFetched[map.url];
+ delete undefEvents[id];
+
+ if (mod) {
+ //Hold on to listeners in case the
+ //module will be attempted to be reloaded
+ //using a different config.
+ if (mod.events.defined) {
+ undefEvents[id] = mod.events;
+ }
+
+ removeWaiting(id);
+ }
+ },
+
+ /**
+ * Called to enable a module if it is still in the registry
+ * awaiting enablement. parent module is passed in for context,
+ * used by the optimizer.
+ */
+ enable: function (depMap, parent) {
+ var mod = registry[depMap.id];
+ if (mod) {
+ getModule(depMap).enable();
+ }
+ },
+
+ /**
+ * Internal method used by environment adapters to complete a load event.
+ * A load event could be a script load or just a load pass from a synchronous
+ * load call.
+ * @param {String} moduleName the name of the module to potentially complete.
+ */
+ completeLoad: function (moduleName) {
+ var found, args, mod,
+ shim = config.shim[moduleName] || {},
+ shExports = shim.exports && shim.exports.exports;
+
+ takeGlobalQueue();
+
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ args[0] = moduleName;
+ //If already found an anonymous module and bound it
+ //to this name, then this is some other anon module
+ //waiting for its completeLoad to fire.
+ if (found) {
+ break;
+ }
+ found = true;
+ } else if (args[0] === moduleName) {
+ //Found matching define call for this script!
+ found = true;
+ }
+
+ callGetModule(args);
+ }
+
+ //Do this after the cycle of callGetModule in case the result
+ //of those calls/init calls changes the registry.
+ mod = registry[moduleName];
+
+ if (!found && !defined[moduleName] && mod && !mod.inited) {
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+ if (hasPathFallback(moduleName)) {
+ return;
+ } else {
+ return onError(makeError('nodefine',
+ 'No define call for ' + moduleName,
+ null,
+ [moduleName]));
+ }
+ } else {
+ //A script that does not call define(), so just simulate
+ //the call for it.
+ callGetModule([moduleName, (shim.deps || []), shim.exports]);
+ }
+ }
+
+ checkLoaded();
+ },
+
+ /**
+ * Converts a module name + .extension into an URL path.
+ * *Requires* the use of a module name. It does not support using
+ * plain URLs like nameToUrl.
+ */
+ toUrl: function (moduleNamePlusExt, relModuleMap) {
+ var index = moduleNamePlusExt.lastIndexOf('.'),
+ ext = null;
+
+ if (index !== -1) {
+ ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+ }
+
+ return context.nameToUrl(normalize(moduleNamePlusExt, relModuleMap && relModuleMap.id, true),
+ ext);
+ },
+
+ /**
+ * Converts a module name to a file path. Supports cases where
+ * moduleName may actually be just an URL.
+ * Note that it **does not** call normalize on the moduleName,
+ * it is assumed to have already been normalized. This is an
+ * internal API, not a public one. Use toUrl for the public API.
+ */
+ nameToUrl: function (moduleName, ext) {
+ var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
+ parentPath;
+
+ //If a colon is in the URL, it indicates a protocol is used and it is just
+ //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+ //or ends with .js, then assume the user meant to use an url and not a module id.
+ //The slash is important for protocol-less URLs as well as full paths.
+ if (req.jsExtRegExp.test(moduleName)) {
+ //Just a plain path, not module name lookup, so just return it.
+ //Add extension if it is included. This is a bit wonky, only non-.js things pass
+ //an extension, this method probably needs to be reworked.
+ url = moduleName + (ext || '');
+ } else {
+ //A module that needs to be converted to a path.
+ paths = config.paths;
+ pkgs = config.pkgs;
+
+ syms = moduleName.split('/');
+ //For each module name segment, see if there is a path
+ //registered for it. Start with most specific name
+ //and work up from it.
+ for (i = syms.length; i > 0; i -= 1) {
+ parentModule = syms.slice(0, i).join('/');
+ pkg = pkgs[parentModule];
+ parentPath = paths[parentModule];
+ if (parentPath) {
+ //If an array, it means there are a few choices,
+ //Choose the one that is desired
+ if (isArray(parentPath)) {
+ parentPath = parentPath[0];
+ }
+ syms.splice(0, i, parentPath);
+ break;
+ } else if (pkg) {
+ //If module name is just the package name, then looking
+ //for the main module.
+ if (moduleName === pkg.name) {
+ pkgPath = pkg.location + '/' + pkg.main;
+ } else {
+ pkgPath = pkg.location;
+ }
+ syms.splice(0, i, pkgPath);
+ break;
+ }
+ }
+
+ //Join the path parts together, then figure out if baseUrl is needed.
+ url = syms.join('/');
+ url += (ext || (/\?/.test(url) ? '' : '.js'));
+ url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+ }
+
+ return config.urlArgs ? url +
+ ((url.indexOf('?') === -1 ? '?' : '&') +
+ config.urlArgs) : url;
+ },
+
+ //Delegates to req.load. Broken out as a separate function to
+ //allow overriding in the optimizer.
+ load: function (id, url) {
+ req.load(context, id, url);
+ },
+
+ /**
+ * Executes a module callack function. Broken out as a separate function
+ * solely to allow the build system to sequence the files in the built
+ * layer in the right sequence.
+ *
+ * @private
+ */
+ execCb: function (name, callback, args, exports) {
+ return callback.apply(exports, args);
+ },
+
+ /**
+ * callback for script loads, used to check status of loading.
+ *
+ * @param {Event} evt the event from the browser for the script
+ * that was loaded.
+ */
+ onScriptLoad: function (evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ if (evt.type === 'load' ||
+ (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+ //Reset interactive script so a script node is not held onto for
+ //to long.
+ interactiveScript = null;
+
+ //Pull out the name of the module and the context.
+ var data = getScriptData(evt);
+ context.completeLoad(data.id);
+ }
+ },
+
+ /**
+ * Callback for script errors.
+ */
+ onScriptError: function (evt) {
+ var data = getScriptData(evt);
+ if (!hasPathFallback(data.id)) {
+ return onError(makeError('scripterror', 'Script error', evt, [data.id]));
+ }
+ }
+ });
+ }
+
+ /**
+ * Main entry point.
+ *
+ * If the only argument to require is a string, then the module that
+ * is represented by that string is fetched for the appropriate context.
+ *
+ * If the first argument is an array, then it will be treated as an array
+ * of dependency string names to fetch. An optional function callback can
+ * be specified to execute when all of those dependencies are available.
+ *
+ * Make a local req variable to help Caja compliance (it assumes things
+ * on a require that are not standardized), and to give a short
+ * name for minification/local scope use.
+ */
+ req = requirejs = function (deps, callback, errback, optional) {
+
+ //Find the right context, use default
+ var context, config,
+ contextName = defContextName;
+
+ // Determine if have config object in the call.
+ if (!isArray(deps) && typeof deps !== 'string') {
+ // deps is a config object
+ config = deps;
+ if (isArray(callback)) {
+ // Adjust args if there are dependencies
+ deps = callback;
+ callback = errback;
+ errback = optional;
+ } else {
+ deps = [];
+ }
+ }
+
+ if (config && config.context) {
+ contextName = config.context;
+ }
+
+ context = contexts[contextName];
+ if (!context) {
+ context = contexts[contextName] = req.s.newContext(contextName);
+ }
+
+ if (config) {
+ context.configure(config);
+ }
+
+ return context.require(deps, callback, errback);
+ };
+
+ /**
+ * Support require.config() to make it easier to cooperate with other
+ * AMD loaders on globally agreed names.
+ */
+ req.config = function (config) {
+ return req(config);
+ };
+
+ /**
+ * Export require as a global, but only if it does not already exist.
+ */
+ if (!require) {
+ require = req;
+ }
+
+ req.version = version;
+
+ //Used to filter out dependencies that are already paths.
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
+ req.isBrowser = isBrowser;
+ s = req.s = {
+ contexts: contexts,
+ newContext: newContext
+ };
+
+ //Create default context.
+ req({});
+
+ //Exports some context-sensitive methods on global require, using
+ //default context if no context specified.
+ addRequireMethods(req);
+
+ if (isBrowser) {
+ head = s.head = document.getElementsByTagName('head')[0];
+ //If BASE tag is in play, using appendChild is a problem for IE6.
+ //When that browser dies, this can be removed. Details in this jQuery bug:
+ //http://dev.jquery.com/ticket/2709
+ baseElement = document.getElementsByTagName('base')[0];
+ if (baseElement) {
+ head = s.head = baseElement.parentNode;
+ }
+ }
+
+ /**
+ * Any errors that require explicitly generates will be passed to this
+ * function. Intercept/override it if you want custom error handling.
+ * @param {Error} err the error object.
+ */
+ req.onError = function (err) {
+ throw err;
+ };
+
+ /**
+ * Does the request to load a module for the browser case.
+ * Make this a separate function to allow other environments
+ * to override it.
+ *
+ * @param {Object} context the require context to find state.
+ * @param {String} moduleName the name of the module.
+ * @param {Object} url the URL to the module.
+ */
+ req.load = function (context, moduleName, url) {
+ var config = (context && context.config) || {},
+ node;
+ if (isBrowser) {
+ //In the browser so use a script tag
+ node = config.xhtml ?
+ document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+ document.createElement('script');
+ node.type = config.scriptType || 'text/javascript';
+ node.charset = 'utf-8';
+ node.async = true;
+
+ node.setAttribute('data-requirecontext', context.contextName);
+ node.setAttribute('data-requiremodule', moduleName);
+
+ //Set up load listener. Test attachEvent first because IE9 has
+ //a subtle issue in its addEventListener and script onload firings
+ //that do not match the behavior of all other browsers with
+ //addEventListener support, which fire the onload event for a
+ //script right after the script execution. See:
+ //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+ //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+ //script execution mode.
+ if (node.attachEvent &&
+ //Check if node.attachEvent is artificially added by custom script or
+ //natively supported by browser
+ //read https://github.com/jrburke/requirejs/issues/187
+ //if we can NOT find [native code] then it must NOT natively supported.
+ //in IE8, node.attachEvent does not have toString()
+ //Note the test for "[native code" with no closing brace, see:
+ //https://github.com/jrburke/requirejs/issues/273
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+ !isOpera) {
+ //Probably IE. IE (at least 6-8) do not fire
+ //script onload right after executing the script, so
+ //we cannot tie the anonymous define call to a name.
+ //However, IE reports the script as being in 'interactive'
+ //readyState at the time of the define call.
+ useInteractive = true;
+
+ node.attachEvent('onreadystatechange', context.onScriptLoad);
+ //It would be great to add an error handler here to catch
+ //404s in IE9+. However, onreadystatechange will fire before
+ //the error handler, so that does not help. If addEvenListener
+ //is used, then IE will fire error before load, but we cannot
+ //use that pathway given the connect.microsoft.com issue
+ //mentioned above about not doing the 'script execute,
+ //then fire the script load event listener before execute
+ //next script' that other browsers do.
+ //Best hope: IE10 fixes the issues,
+ //and then destroys all installs of IE 6-9.
+ //node.attachEvent('onerror', context.onScriptError);
+ } else {
+ node.addEventListener('load', context.onScriptLoad, false);
+ node.addEventListener('error', context.onScriptError, false);
+ }
+ node.src = url;
+
+ //For some cache cases in IE 6-8, the script executes before the end
+ //of the appendChild execution, so to tie an anonymous define
+ //call to the module name (which is stored on the node), hold on
+ //to a reference to this node, but clear after the DOM insertion.
+ currentlyAddingScript = node;
+ if (baseElement) {
+ head.insertBefore(node, baseElement);
+ } else {
+ head.appendChild(node);
+ }
+ currentlyAddingScript = null;
+
+ return node;
+ } else if (isWebWorker) {
+ //In a web worker, use importScripts. This is not a very
+ //efficient use of importScripts, importScripts will block until
+ //its script is downloaded and evaluated. However, if web workers
+ //are in play, the expectation that a build has been done so that
+ //only one script needs to be loaded anyway. This may need to be
+ //reevaluated if other use cases become common.
+ importScripts(url);
+
+ //Account for anonymous modules
+ context.completeLoad(moduleName);
+ }
+ };
+
+ function getInteractiveScript() {
+ if (interactiveScript && interactiveScript.readyState === 'interactive') {
+ return interactiveScript;
+ }
+
+ eachReverse(scripts(), function (script) {
+ if (script.readyState === 'interactive') {
+ return (interactiveScript = script);
+ }
+ });
+ return interactiveScript;
+ }
+
+ //Look for a data-main script attribute, which could also adjust the baseUrl.
+ if (isBrowser) {
+ //Figure out baseUrl. Get it from the script tag with require.js in it.
+ eachReverse(scripts(), function (script) {
+ //Set the 'head' where we can append children by
+ //using the script's parent.
+ if (!head) {
+ head = script.parentNode;
+ }
+
+ //Look for a data-main attribute to set main script for the page
+ //to load. If it is there, the path to data main becomes the
+ //baseUrl, if it is not already set.
+ dataMain = script.getAttribute('data-main');
+ if (dataMain) {
+ //Set final baseUrl if there is not already an explicit one.
+ if (!cfg.baseUrl) {
+ //Pull off the directory of data-main for use as the
+ //baseUrl.
+ src = dataMain.split('/');
+ mainScript = src.pop();
+ subPath = src.length ? src.join('/') + '/' : './';
+
+ cfg.baseUrl = subPath;
+ dataMain = mainScript;
+ }
+
+ //Strip off any trailing .js since dataMain is now
+ //like a module name.
+ dataMain = dataMain.replace(jsSuffixRegExp, '');
+
+ //Put the data-main script in the files to load.
+ cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * The function that handles definitions of modules. Differs from
+ * require() in that a string for the module should be the first argument,
+ * and the function to execute after dependencies are loaded should
+ * return a value to define the module corresponding to the first argument's
+ * name.
+ */
+ define = function (name, deps, callback) {
+ var node, context;
+
+ //Allow for anonymous functions
+ if (typeof name !== 'string') {
+ //Adjust args appropriately
+ callback = deps;
+ deps = name;
+ name = null;
+ }
+
+ //This module may not have dependencies
+ if (!isArray(deps)) {
+ callback = deps;
+ deps = [];
+ }
+
+ //If no name, and callback is a function, then figure out if it a
+ //CommonJS thing with dependencies.
+ if (!deps.length && isFunction(callback)) {
+ //Remove comments from the callback string,
+ //look for require calls, and pull them into the dependencies,
+ //but only if there are function args.
+ if (callback.length) {
+ callback
+ .toString()
+ .replace(commentRegExp, '')
+ .replace(cjsRequireRegExp, function (match, dep) {
+ deps.push(dep);
+ });
+
+ //May be a CommonJS thing even without require calls, but still
+ //could use exports, and module. Avoid doing exports and module
+ //work though if it just needs require.
+ //REQUIRES the function to expect the CommonJS variables in the
+ //order listed below.
+ deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
+ }
+ }
+
+ //If in IE 6-8 and hit an anonymous define() call, do the interactive
+ //work.
+ if (useInteractive) {
+ node = currentlyAddingScript || getInteractiveScript();
+ if (node) {
+ if (!name) {
+ name = node.getAttribute('data-requiremodule');
+ }
+ context = contexts[node.getAttribute('data-requirecontext')];
+ }
+ }
+
+ //Always save off evaluating the def call until the script onload handler.
+ //This allows multiple modules to be in a file without prematurely
+ //tracing dependencies, and allows for anonymous module support,
+ //where the module name is not known until the script onload event
+ //occurs. If no context, use the global queue, and get it processed
+ //in the onscript load callback.
+ (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+
+
+ /**
+ * Executes the text. Normally just uses eval, but can be modified
+ * to use a better, environment-specific call. Only used for transpiling
+ * loader plugins, not for plain JS modules.
+ * @param {String} text the text to execute/evaluate.
+ */
+ req.exec = function (text) {
+ /*jslint evil: true */
+ return eval(text);
+ };
+
+ //Set up with config info.
+ req(cfg);
+}(this));
diff -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd static/scripts/viz/circster.js
--- a/static/scripts/viz/circster.js
+++ b/static/scripts/viz/circster.js
@@ -1,14 +1,11 @@
-(function(){
+define( ["libs/d3", "viz/visualization"], function( d3, visualization ) {
// General backbone style inheritence
var Base = function() { this.initialize && this.initialize.apply(this, arguments) }; Base.extend = Backbone.Model.extend;
-// ---- Circster views ----
-
/**
- * -- Views --
- */
-
+ * Renders a full circster visualization
+ */
var CircsterView = Backbone.View.extend({
className: 'circster',
@@ -50,30 +47,29 @@
this.model.get('tracks').each(function(track, index) {
var dataset = track.get('genome_wide_data'),
radius_start = init_radius_start + index * (dataset_arc_height + self.track_gap),
- track_view_class = (dataset instanceof GenomeWideBigWigData ? CircsterBigWigTrackView : CircsterSummaryTreeTrackView );
+ track_renderer_class = (dataset instanceof visualization.GenomeWideBigWigData ? CircsterBigWigTrackRenderer : CircsterSummaryTreeTrackRenderer );
- track_view = new track_view_class({
+ track_renderer = new track_renderer_class({
track: track,
radius_start: radius_start,
radius_end: radius_start + dataset_arc_height,
genome: self.genome,
- total_gap: self.total_gap,
- svg: svg
+ total_gap: self.total_gap
});
- track_view.render();
+ track_renderer.render( svg );
});
}
});
-var CircsterTrackView = Base.extend( {
+var CircsterTrackRenderer = Base.extend( {
initialize: function( options ) {
this.options = options;
},
- render: function() {
+ render: function( svg ) {
genome_arcs = this.chroms_layout(),
chroms_arcs = this.genome_data_layout();
@@ -81,8 +77,7 @@
// -- Render. --
// Draw background arcs for each chromosome.
- var svg = this.options.svg,
- radius_start = this.options.radius_start,
+ var radius_start = this.options.radius_start,
radius_end = this.options.radius_end,
base_arc = svg.append("g").attr("id", "inner-arc"),
arc_gen = d3.svg.arc()
@@ -165,7 +160,7 @@
/**
* Layout for summary tree data in a circster visualization.
*/
-var CircsterSummaryTrackView = CircsterTrackView.extend({
+var CircsterSummaryTrackRenderer = CircsterTrackRenderer.extend({
/**
* Returns layouts for drawing a chromosome's data.
@@ -200,7 +195,7 @@
/**
* Layout for BigWig data in a circster visualization.
*/
-var CircsterBigWigTrackView = CircsterTrackView.extend({
+var CircsterBigWigTrackRenderer = CircsterTrackRenderer.extend({
/**
* Returns layouts for drawing a chromosome's data.
@@ -233,12 +228,8 @@
});
-// ---- Browser or CommonJS compatible exports ----
-
-if (typeof exports === 'undefined') {
- var exports = this;
+return {
+ CircsterView: CircsterView
}
-exports.CircsterView = CircsterView;
-
-}).call(this);
+});
diff -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -1,3 +1,5 @@
+(function(){
+
/**
* Model, view, and controller objects for Galaxy visualization framework.
*
@@ -551,7 +553,7 @@
{
type: Backbone.HasOne,
key: 'region',
- relatedModel: 'GenomeRegion'
+ relatedModel: GenomeRegion
}
]
});
@@ -645,7 +647,7 @@
{
type: Backbone.HasMany,
key: 'tracks',
- relatedModel: 'BackboneTrack'
+ relatedModel: BackboneTrack
}
],
@@ -772,3 +774,40 @@
}
});
};
+
+// ---- Exports ----
+
+var exports = (function() {
+ if ( typeof module !== 'undefined' && module.exports ) {
+ // CommonJS
+ return module.exports;
+ } else if ( typeof define === 'function' && define.amd ) {
+ // AMD
+ exports = {}
+ define( function() { return exports } );
+ return exports
+ } else {
+ // Browser global
+ return window;
+ }
+})();
+
+exports.BrowserBookmark = BrowserBookmark
+exports.BrowserBookmarkCollection = BrowserBookmarkCollection
+exports.Cache = Cache
+exports.CanvasManager = CanvasManager
+exports.Genome = Genome
+exports.GenomeDataManager = GenomeDataManager
+exports.GenomeRegion = GenomeRegion
+exports.GenomeRegionCollection = GenomeRegionCollection
+exports.GenomeVisualization = GenomeVisualization
+exports.GenomeWideBigWigData = GenomeWideBigWigData
+exports.GenomeWideSummaryTreeData = GenomeWideSummaryTreeData
+exports.ReferenceTrackDataManager = ReferenceTrackDataManager
+exports.ServerStateDeferred = ServerStateDeferred
+exports.TrackBrowserRouter = TrackBrowserRouter
+exports.TrackConfig = TrackConfig
+exports.Visualization = Visualization
+exports.add_datasets = add_datasets
+
+}).call(this);
\ No newline at end of file
diff -r db2be15c12584351ef4f58bff0069ee5a4eed5a9 -r 45ddaa89e9855d21ce2f6a29a0eb90cc61abd7cd templates/visualization/circster.mako
--- a/templates/visualization/circster.mako
+++ b/templates/visualization/circster.mako
@@ -16,71 +16,83 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/d3", "mvc/data", "viz/visualization", "viz/circster" )}
+ ${h.js( "require", "mvc/data" )}
<script type="text/javascript">
- $(function() {
- // -- Visualization menu and set up.
- var menu = create_icon_buttons_menu([
- { icon_class: 'plus-button', title: 'Add tracks', on_click: function() { add_tracks(); } },
- { icon_class: 'disk--arrow', title: 'Save', on_click: function() {
- // Show saving dialog box
- show_modal("Saving...", "progress");
- $.ajax({
- url: "${h.url_for( action='save' )}",
- type: "POST",
- data: {
- 'id': view.vis_id,
- 'title': view.name,
- 'dbkey': view.dbkey,
- 'type': 'trackster',
- 'config': JSON.stringify(payload)
- },
- dataType: "json",
- success: function(vis_info) {
- hide_modal();
- view.vis_id = vis_info.vis_id;
- view.has_changes = false;
+ require.config({
+ baseUrl: "${h.url_for('/static/scripts')}",
+ shim: {
+ "libs/d3": { exports: "d3" }
+ }
+ });
- // Needed to set URL when first saving a visualization.
- window.history.pushState({}, "", vis_info.url + window.location.hash);
- },
- error: function() {
- show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
- { "Close" : hide_modal } );
- }
+ require( [ "libs/d3", "viz/visualization", "viz/circster" ], function( d3, visualization, circster ) {
+
+ $(function() {
+
+ // -- Visualization menu and set up.
+ var menu = create_icon_buttons_menu([
+ { icon_class: 'plus-button', title: 'Add tracks', on_click: function() { add_tracks(); } },
+ { icon_class: 'disk--arrow', title: 'Save', on_click: function() {
+ // Show saving dialog box
+ show_modal("Saving...", "progress");
+
+ $.ajax({
+ url: "${h.url_for( action='save' )}",
+ type: "POST",
+ data: {
+ 'id': view.vis_id,
+ 'title': view.name,
+ 'dbkey': view.dbkey,
+ 'type': 'trackster',
+ 'config': JSON.stringify(payload)
+ },
+ dataType: "json",
+ success: function(vis_info) {
+ hide_modal();
+ view.vis_id = vis_info.vis_id;
+ view.has_changes = false;
+
+ // Needed to set URL when first saving a visualization.
+ window.history.pushState({}, "", vis_info.url + window.location.hash);
+ },
+ error: function() {
+ show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
+ { "Close" : hide_modal } );
+ }
+ });
+ } },
+ { icon_class: 'cross-circle', title: 'Close', on_click: function() {
+ window.location = "${h.url_for( controller='visualization', action='list' )}";
+ } }
+ ], {
+ tooltip_config: { placement: 'bottom' }
+ });
+
+ menu.$el.attr("style", "float: right");
+ $("#center .unified-panel-header-inner").append(menu.$el);
+ // Manual tooltip config because default gravity is S and cannot be changed.
+ $(".menu-button").tooltip( { placement: 'bottom' } );
+
+ // -- Viz set up. --
+
+ var genome = new visualization.Genome(JSON.parse('${ h.to_json_string( genome ) }'))
+ vis = new visualization.GenomeVisualization(JSON.parse('${ h.to_json_string( viz_config ) }')),
+ viz_view = new circster.CircsterView({
+ el: $('#vis'),
+ // Gap is difficult to set because it very dependent on chromosome size and organization.
+ total_gap: 2 * Math.PI * 0.1,
+ genome: genome,
+ model: vis,
+ dataset_arc_height: 25
});
- } },
- { icon_class: 'cross-circle', title: 'Close', on_click: function() {
- window.location = "${h.url_for( controller='visualization', action='list' )}";
- } }
- ], {
- tooltip_config: { placement: 'bottom' }
+
+ // -- Render viz. --
+
+ viz_view.render();
+
});
-
- menu.$el.attr("style", "float: right");
- $("#center .unified-panel-header-inner").append(menu.$el);
- // Manual tooltip config because default gravity is S and cannot be changed.
- $(".menu-button").tooltip( { placement: 'bottom' } );
-
- // -- Viz set up. --
-
- var genome = new Genome(JSON.parse('${ h.to_json_string( genome ) }'))
- visualization = new GenomeVisualization(JSON.parse('${ h.to_json_string( viz_config ) }')),
- viz_view = new CircsterView({
- el: $('#vis'),
- // Gap is difficult to set because it very dependent on chromosome size and organization.
- total_gap: 2 * Math.PI * 0.1,
- genome: genome,
- model: visualization,
- dataset_arc_height: 25
- });
-
- // -- Render viz. --
-
- viz_view.render();
-
});
</script></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0