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
November 2013
- 1 participants
- 208 discussions
commit/galaxy-central: carlfeberhard: HDA API, show: remove force_history_refresh, add annotation; update: allow annotation or genome_build == None; Users API: add 'tags_used' as list of unique tags used by the user; History panel tags & annotations: into Backbone sub-views, cleanup; pack scripts
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/599706931211/
Changeset: 599706931211
User: carlfeberhard
Date: 2013-11-05 21:32:07
Summary: HDA API, show: remove force_history_refresh, add annotation; update: allow annotation or genome_build == None; Users API: add 'tags_used' as list of unique tags used by the user; History panel tags & annotations: into Backbone sub-views, cleanup; pack scripts
Affected #: 33 files
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1751,6 +1751,7 @@
misc_info = hda.info,
misc_blurb = hda.blurb )
+ # add tags string list
tags_str_list = []
for tag in self.tags:
tag_str = tag.user_tname
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -596,6 +596,8 @@
return self.get_inaccessible_hda_dict( trans, hda )
hda_dict[ 'accessible' ] = True
+ hda_dict[ 'annotation' ] = hda.get_item_annotation_str( trans.sa_session, trans.user, hda )
+
# ---- return here if deleted AND purged OR can't access
purged = ( hda.purged or hda.dataset.purged )
if ( hda.deleted and purged ):
@@ -632,14 +634,6 @@
if hda.deleted and not purged:
return trans.security.encode_dict_ids( hda_dict )
- # if a tool declares 'force_history_refresh' in its xml, when the hda -> ready, reload the history panel
- # expensive
- #if( ( hda.state in [ 'running', 'queued' ] )
- #and ( hda.creating_job and hda.creating_job.tool_id ) ):
- # tool_used = trans.app.toolbox.get_tool( hda.creating_job.tool_id )
- # if tool_used and tool_used.force_history_refresh:
- # hda_dict[ 'force_history_refresh' ] = True
-
return trans.security.encode_dict_ids( hda_dict )
def get_inaccessible_hda_dict( self, trans, hda ):
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -361,7 +361,7 @@
if not isinstance( val, bool ):
raise ValueError( 'published must be a boolean: %s' %( str( type( val ) ) ) )
validated_payload[ 'published' ] = val
- elif key == 'genome_build':
+ elif key == 'genome_build' and val is not None:
if not ( isinstance( val, str ) or isinstance( val, unicode ) ):
raise ValueError( 'genome_build must be a string: %s' %( str( type( val ) ) ) )
validated_payload[ 'genome_build' ] = sanitize_html( val, 'utf-8' )
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -406,7 +406,7 @@
if not ( isinstance( val, str ) or isinstance( val, unicode ) ):
raise ValueError( 'genome_build must be a string: %s' %( str( type( val ) ) ) )
validated_payload[ 'dbkey' ] = util.sanitize_html.sanitize_html( val, 'utf-8' )
- elif key == 'annotation':
+ elif key == 'annotation' and val is not None:
if not ( isinstance( val, str ) or isinstance( val, unicode ) ):
raise ValueError( 'annotation must be a string or unicode: %s' %( str( type( val ) ) ) )
validated_payload[ 'annotation' ] = util.sanitize_html.sanitize_html( val, 'utf-8' )
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 lib/galaxy/webapps/galaxy/api/users.py
--- a/lib/galaxy/webapps/galaxy/api/users.py
+++ b/lib/galaxy/webapps/galaxy/api/users.py
@@ -71,6 +71,8 @@
raise HTTPBadRequest( detail='Invalid user id ( %s ) specified' % id )
item = user.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id,
'total_disk_usage': float } )
+
+ # add a list of tags used by the user (as strings)
item[ 'tags_used' ] = self.get_user_tags_used( trans, user=user )
#TODO: move into api_values (needs trans, tho - can we do that with api_keys/@property??)
#TODO: works with other users (from admin)??
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/annotations.js
--- a/static/scripts/mvc/annotations.js
+++ b/static/scripts/mvc/annotations.js
@@ -1,35 +1,71 @@
-/*==============================================================================
-Backbone MV for Annotations
+/** A view on any model that has a 'annotation' attribute
+ */
+var AnnotationEditor = BaseView.extend( LoggableMixin ).extend( HiddenUntilActivatedViewMixin ).extend({
+ tagName : 'div',
+ className : 'annotation-display',
-TODO:
+ /** Set up listeners, parse options */
+ initialize : function( options ){
+ options = options || {};
+ this.tooltipConfig = options.tooltipConfig || { placement: 'bottom' };
+ //console.debug( this, options );
+ // only listen to the model only for changes to annotations
+ this.listenTo( this.model, 'change:annotation', function(){
+ this.render();
+ });
+ this.hiddenUntilActivated( options.$activator, options );
+ },
-==============================================================================*/
-/** Single Tag model
- */
-var Annotation = BaseModel.extend( LoggableMixin ).extend({
-
- // uncomment this out see log messages
- logger : console,
-
- toString : function(){
- return 'Annotation()';
- }
+ /** Build the DOM elements, call select to on the created input, and set up behaviors */
+ render : function(){
+ var view = this;
+ this.$el.html( this._template() );
+ this.$el.find( "[title]" ).tooltip( this.tooltipConfig );
+
+ //TODO: handle empties better
+ this.$annotation().make_text_editable({
+ use_textarea: true,
+ on_finish: function( newAnnotation ){
+ view.$annotation().text( newAnnotation );
+ view.model.save({ annotation: newAnnotation }, { silent: true })
+ .fail( function(){
+ view.$annotation().text( view.model.previous( 'annotation' ) );
+ });
+ }
+ });
+ return this;
+ },
+
+ /** @returns {String} the html text used to build the view's DOM */
+ _template : function(){
+ var annotation = this.model.get( 'annotation' );
+ //if( !annotation ){
+ // //annotation = [ '<em class="annotation-empty">', _l( 'Click to add an annotation' ), '</em>' ].join( '' );
+ // annotation = [ '<em class="annotation-empty"></em>' ].join( '' );
+ //}
+ return [
+ //TODO: make prompt optional
+ '<label class="prompt">', _l( 'Annotation' ), '</label>',
+ // set up initial tags by adding as CSV to input vals (necc. to init select2)
+ '<div class="annotation" title="', _l( 'Edit annotation' ), '">',
+ annotation,
+ '</div>'
+ ].join( '' );
+ },
+
+ /** @returns {jQuery} the main element for this view */
+ $annotation : function(){
+ return this.$el.find( '.annotation' );
+ },
+
+ /** shut down event listeners and remove this view's DOM */
+ remove : function(){
+ this.$annotation.off();
+ this.stopListening( this.model );
+ Backbone.View.prototype.remove.call( this );
+ },
+
+ /** string rep */
+ toString : function(){ return [ 'AnnotationEditor(', this.model + '', ')' ].join(''); }
});
-
-//------------------------------------------------------------------------------
-/** Single Tag view
- */
-var AnnotationView = BaseView.extend( LoggableMixin ).extend({
-
- // uncomment this out see log messages
- logger : console,
-
- toString : function(){
- return 'AnnotationView()';
- }
-});
-
-//==============================================================================
-/** YAGNI? A collection of Annotations, mainView?
- */
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/base-mvc.js
--- a/static/scripts/mvc/base-mvc.js
+++ b/static/scripts/mvc/base-mvc.js
@@ -219,6 +219,51 @@
//==============================================================================
+var HiddenUntilActivatedViewMixin = /** @lends hiddenUntilActivatedMixin# */{
+
+ /** */
+ hiddenUntilActivated : function( $activator, options ){
+ // call this in your view's initialize fn
+ options = options || {};
+ this.HUAVOptions = {
+ $elementShown : this.$el,
+ showFn : jQuery.prototype.toggle,
+ showSpeed : 'fast'
+ };
+ _.extend( this.HUAVOptions, options || {});
+ this.HUAVOptions.hasBeenShown = this.HUAVOptions.$elementShown.is( ':visible' );
+
+ if( $activator ){
+ var mixin = this;
+ $activator.on( 'click', function( ev ){
+ mixin.toggle( mixin.HUAVOptions.showSpeed );
+ });
+ }
+ },
+
+ /** */
+ toggle : function(){
+ // can be called manually as well with normal toggle arguments
+ if( this.HUAVOptions.$elementShown.is( ':hidden' ) ){
+ // fire the optional fns on the first/each showing - good for render()
+ if( !this.HUAVOptions.hasBeenShown ){
+ if( _.isFunction( this.HUAVOptions.onshowFirstTime ) ){
+ this.HUAVOptions.hasBeenShown = true;
+ this.HUAVOptions.onshowFirstTime.call( this );
+ }
+ } else {
+ if( _.isFunction( this.HUAVOptions.onshow ) ){
+ this.HUAVOptions.onshow.call( this );
+ }
+ }
+ }
+ return this.HUAVOptions.showFn.apply( this.HUAVOptions.$elementShown, arguments );
+ }
+};
+
+
+
+//==============================================================================
function LoadingIndicator( $where, options ){
options = options || {};
var self = this;
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -180,8 +180,6 @@
});
};
}
- //return new IconButtonView({ model : new IconButton( displayBtnData ) }).render().$el;
-
displayBtnData.faIcon = 'fa-eye';
return faIconButton( displayBtnData );
},
@@ -199,7 +197,6 @@
// return either: a single download icon-button (if there are no meta files)
if( _.isEmpty( meta_files ) ){
return $([
- //'<a href="', urls.download, '" title="', _l( 'Download' ), '" class="icon-button disk"></a>'
'<a href="' + urls.download + '" title="' + _l( 'Download' ) + '" class="icon-btn">',
'<span class="fa fa-floppy-o"></span>',
'</a>'
@@ -207,7 +204,7 @@
}
// or a popupmenu with links to download assoc. meta files (if there are meta files)
-//TODO: Popupmenu
+ //TODO: Popupmenu
var menuId = 'dataset-' + this.model.get( 'id' ) + '-popup',
html = [
'<div popupmenu="' + menuId + '">',
@@ -240,12 +237,6 @@
*/
_render_showParamsButton : function(){
// gen. safe to show in all cases
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'View details' ),
- // href : this.urls.show_params,
- // target : 'galaxy_main',
- // icon_class : 'information'
- //}) }).render().$el;
return faIconButton({
title : _l( 'View details' ),
href : this.urls.show_params,
@@ -339,8 +330,10 @@
/** Render an HDA whose job has failed. */
_render_body_error : function(){
- var html = _l( 'An error occurred with this dataset' )
- + ': <i>' + $.trim( this.model.get( 'misc_info' ) ) + '</i>';
+ var html = [
+ '<span class="help-text">', _l( 'An error occurred with this dataset' ), ':</span>',
+ '<div class="job-error-text">', $.trim( this.model.get( 'misc_info' ) ), '</div>'
+ ].join( '' );
if( !this.model.get( 'purged' ) ){
html = '<div>' + this.model.get( 'misc_blurb' ) + '</div>' + html;
}
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -86,10 +86,6 @@
editBtnData.disabled = true;
editBtnData.title = _l( 'This dataset must finish uploading before it can be edited' );
}
-
-
- //return new IconButtonView({ model : new IconButton( editBtnData ) }).render().$el;
-
editBtnData.faIcon = 'fa-pencil';
return faIconButton( editBtnData );
},
@@ -124,8 +120,6 @@
enabled : false
};
}
- //return new IconButtonView({ model : new IconButton( deleteBtnData ) }).render().$el;
-
deleteBtnData.faIcon = 'fa-times';
return faIconButton( deleteBtnData );
},
@@ -138,14 +132,6 @@
if( this.model.get( 'state' ) !== hdaModel.HistoryDatasetAssociation.STATES.ERROR ){
return null;
}
-
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'View or report this error' ),
- // href : this.urls.report_error,
- // target : 'galaxy_main',
- // icon_class : 'bug'
- //})}).render().$el;
-
return faIconButton({
title : _l( 'View or report this error' ),
href : this.urls.report_error,
@@ -158,13 +144,6 @@
* @returns {jQuery} rendered DOM
*/
_render_rerunButton : function(){
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'Run this job again' ),
- // href : this.urls.rerun,
- // target : 'galaxy_main',
- // icon_class : 'arrow-circle'
- //}) }).render().$el;
-
return faIconButton({
title : _l( 'Run this job again' ),
href : this.urls.rerun,
@@ -204,15 +183,6 @@
// Add dbkey to params if it exists.
if( dbkey ){ params.dbkey = dbkey; }
- // render the icon from template
- //var visualizationsButton = new IconButtonView({ model : new IconButton({
- // title : _l( 'Visualize' ),
- // href : this.urls.visualization,
- // icon_class : 'chart_curve'
- //})});
- //var $icon = visualizationsButton.render().addClass( 'visualize-icon' ); // needed?
- ////return visualizationsButton.render().$el;
-
var $icon = faIconButton({
title : _l( 'Visualize' ),
href : this.urls.visualization,
@@ -264,13 +234,6 @@
|| !( visualizations && !_.isEmpty( visualizations ) ) ){
return null;
}
-
- // render the icon from template
- //var visualizationsButton = new IconButtonView({ model : new IconButton({
- // title : _l( 'Visualize' ),
- // icon_class : 'chart_curve'
- //})});
- //var $icon = visualizationsButton.render().$el;
var $icon = faIconButton({
title : _l( 'Visualize' ),
faIcon : 'fa-bar-chart-o'
@@ -293,49 +256,6 @@
return $icon;
},
- // ......................................................................... secondary actions
- /** Render icon-button to load and display tagging html.
- * @returns {jQuery} rendered DOM
- */
- _render_tagButton : function(){
- if( !this.hasUser ){
- return null;
- }
-
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'Edit dataset tags' ),
- // target : 'galaxy_main',
- // href : this.urls.tags.get,
- // icon_class : 'tags'
- //})}).render().$el;
-
- return faIconButton({
- title : _l( 'Edit dataset tags' ),
- classes : 'dataset-tag-btn',
- faIcon : 'fa-tags'
- });
- },
-
- /** Render icon-button to load and display annotation html.
- * @returns {jQuery} rendered DOM
- */
- _render_annotateButton : function(){
- if( !this.hasUser ){
- return null;
- }
-
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'Edit dataset annotation' ),
- // target : 'galaxy_main',
- // icon_class : 'annotate'
- //})}).render().$el;
- return faIconButton({
- title : _l( 'Edit dataset annotation' ),
- classes : 'dataset-annotate-btn',
- faIcon : 'fa-comment'
- });
- },
-
// ......................................................................... state body renderers
/** Render an HDA where the metadata wasn't produced correctly.
* Overridden to add a link to dataset/edit
@@ -375,16 +295,37 @@
this.makeDbkeyEditLink( $body );
// more actions/buttons
- $body.find( '.dataset-actions .left' ).append( this._render_visualizationsButton() );
- $body.find( '.dataset-actions .right' ).append([
- this._render_tagButton(),
- this._render_annotateButton()
- ]);
+ if( this.hasUser ){
+ $body.find( '.dataset-actions .left' ).append( this._render_visualizationsButton() );
+ this._renderTags( $body );
+ this._renderAnnotation( $body );
+ }
+ return $body;
+ },
+
+ _renderTags : function( $where ){
this.tagsEditor = new TagsEditor({
- model : this.model,
- el : $body.find( '.tags-display' )
- }).render();
- return $body;
+ model : this.model,
+ el : $where.find( '.tags-display' ),
+ onshowFirstTime : function(){ this.render(); },
+ $activator : faIconButton({
+ title : _l( 'Edit dataset tags' ),
+ classes : 'dataset-tag-btn',
+ faIcon : 'fa-tags'
+ }).appendTo( $where.find( '.dataset-actions .right' ) )
+ });
+ },
+ _renderAnnotation : function( $where ){
+ this.annotationEditor = new AnnotationEditor({
+ model : this.model,
+ el : $where.find( '.annotation-display' ),
+ onshowFirstTime : function(){ this.render(); },
+ $activator : faIconButton({
+ title : _l( 'Edit dataset annotation' ),
+ classes : 'dataset-annotate-btn',
+ faIcon : 'fa-comment'
+ }).appendTo( $where.find( '.dataset-actions .right' ) )
+ });
},
makeDbkeyEditLink : function( $body ){
@@ -402,73 +343,16 @@
'click .dataset-title-bar' : 'toggleBodyVisibility',
'click .dataset-undelete' : function( ev ){ this.model.undelete(); return false; },
'click .dataset-unhide' : function( ev ){ this.model.unhide(); return false; },
- 'click .dataset-purge' : 'confirmPurge',
-
- 'click .dataset-tag-btn' : 'displayTags',
- 'click .dataset-annotate-btn' : 'loadAndDisplayAnnotation'
+ 'click .dataset-purge' : 'confirmPurge'
},
/** listener for item purge */
confirmPurge : function _confirmPurge( ev ){
-//TODO: confirm dialog
+ //TODO: confirm dialog
this.model.purge();
return false;
},
- // ......................................................................... tags
- /** Find the tag area and, if initial: load the html (via ajax) for displaying them; otherwise, unhide/hide
- */
-//TODO: into sub-MV
- displayTags : function( event ){
- this.$el.find( '.tags-display' ).slideToggle( this.fxSpeed );
- return false;
- },
-
- // ......................................................................... annotations
- /** Find the annotation area and, if initial: load the html (via ajax) for displaying them; otherwise, unhide/hide
- */
- loadAndDisplayAnnotation : function( event ){
-//TODO: this is a drop in from history.mako - should use MV as well
- this.log( this + '.loadAndDisplayAnnotation', event );
- var view = this,
- $annotationArea = this.$el.find( '.annotation-display' ),
- $annotationElem = $annotationArea.find( '.annotation' );
-
- // Show or hide annotation area; if showing annotation area and it's empty, fill it.
- if ( $annotationArea.is( ":hidden" ) ){
- if( !jQuery.trim( $annotationElem.html() ) ){
- // Need to fill annotation element.
- var xhr = $.ajax( this.urls.annotation.get );
- xhr.fail( function( xhr, status, error ){
- view.log( "Annotation failed", xhr, status, error );
- view.trigger( 'error', view, xhr, {}, _l( "Annotation failed" ) );
- });
- xhr.done( function( html ){
- html = html || "<em>" + _l( "Describe or add notes to dataset" ) + "</em>";
- $annotationElem.html( html );
- $annotationArea.find( "[title]" ).tooltip();
-
- $annotationElem.make_text_editable({
- use_textarea: true,
- on_finish: function( newAnnotation ){
- $annotationElem.text( newAnnotation );
- view.model.save({ annotation: newAnnotation }, { silent: true })
- .fail( function(){
- $annotationElem.text( view.model.previous( 'annotation' ) );
- });
- }
- });
- $annotationArea.slideDown( view.fxSpeed );
- });
- } else {
- $annotationArea.slideDown( view.fxSpeed );
- }
- } else {
- $annotationArea.slideUp( view.fxSpeed );
- }
- return false;
- },
-
// ......................................................................... misc
/** string rep */
toString : function(){
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -56,7 +56,7 @@
},
/** fetch location of this HDA's history in the api */
- urlRoot: 'api/histories/',
+ urlRoot: '/api/histories/',
/** full url spec. for this HDA */
url : function(){
return this.urlRoot + this.get( 'history_id' ) + '/contents/' + this.get( 'id' );
@@ -80,10 +80,6 @@
'annotation': { 'get': galaxy_config.root + 'dataset/get_annotation_async?id=' + id,
'set': galaxy_config.root + 'dataset/annotate_async?id=' + id },
- 'tags' : { 'get': galaxy_config.root + 'tag/get_tagging_elt_async?item_id='
- + id + '&item_class=HistoryDatasetAssociation',
- 'set': galaxy_config.root + 'tag/retag?item_id='
- + id + '&item_class=HistoryDatasetAssociation' },
'meta_download' : galaxy_config.root + 'dataset/get_metadata_file?hda_id=' + id + '&metadata_name='
};
return urls;
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -25,8 +25,8 @@
name : 'Unnamed History',
state : 'new',
- diskSize : 0,
- deleted : false
+ diskSize : 0,
+ deleted : false
},
// ........................................................................ urls
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -13,9 +13,6 @@
tags & annotations -> out
use model.save instead of urls
- meta:
- convert function comments to jsDoc style, complete comments
-
feature creep:
lineage
hide button
@@ -633,14 +630,8 @@
} else {
$newRender.append( HistoryPanel.templates.historyPanel( this.model.toJSON() ) );
- $newRender.find( '.history-secondary-actions' ).append([
- this._render_tagButton(),
- this._render_annotateButton()
- ]);
- this.tagsEditor = new TagsEditor({
- model : this.model,
- el : $newRender.find( '.history-controls .tags-display' )
- }).render();
+ this._renderTags( $newRender );
+ this._renderAnnotation( $newRender );
}
this._setUpBehaviours( $newRender );
@@ -654,34 +645,29 @@
return $newRender;
},
- /** Render icon-button to load and display tagging html.
- * @returns {jQuery} rendered DOM
- */
- _render_tagButton : function(){
- return faIconButton({
- title : _l( 'Edit history tags' ),
- classes : 'history-tag-button',
- faIcon : 'fa-tags'
+ _renderTags : function( $where ){
+ this.tagsEditor = new TagsEditor({
+ model : this.model,
+ el : $where.find( '.history-controls .tags-display' ),
+ onshowFirstTime : function(){ this.render(); },
+ $activator : faIconButton({
+ title : _l( 'Edit history tags' ),
+ classes : 'history-tag-btn',
+ faIcon : 'fa-tags'
+ }).appendTo( $where.find( '.history-secondary-actions' ) )
});
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'Edit history tags' ),
- // icon_class : 'tags'
- //})}).render().$el;
},
-
- /** Render icon-button to load and display annotation html.
- * @returns {jQuery} rendered DOM
- */
- _render_annotateButton : function(){
- return faIconButton({
- title : _l( 'Edit history tags' ),
- classes : 'history-annotate-button',
- faIcon : 'fa-comment'
+ _renderAnnotation : function( $where ){
+ this.annotationEditor = new AnnotationEditor({
+ model : this.model,
+ el : $where.find( '.history-controls .annotation-display' ),
+ onshowFirstTime : function(){ this.render(); },
+ $activator : faIconButton({
+ title : _l( 'Edit history tags' ),
+ classes : 'history-annotate-btn',
+ faIcon : 'fa-comment'
+ }).appendTo( $where.find( '.history-secondary-actions' ) )
});
- //return new IconButtonView({ model : new IconButton({
- // title : _l( 'Edit history annotation' ),
- // icon_class : 'annotate'
- //})}).render().$el;
},
/** Set up HistoryPanel js/widget behaviours
@@ -694,24 +680,7 @@
// anon users shouldn't have access to any of the following
if( !this.model || !Galaxy.currUser || Galaxy.currUser.isAnonymous() ){ return; }
- // annotation slide down
- var panel = this,
- // need specific selector ('annotation-display' is used in HDAs, too)
- $historyAnnotationArea = $where.find( '.history-controls .annotation-display' );
- $where.find( '.history-controls .history-annotate-button' ).click( function() {
- if( $historyAnnotationArea.is( ":hidden" ) ){
- //HACK: for whitespace added to annotation
- var $anno = panel.$el.find( '.history-controls .annotation' );
- $anno.text( jQuery.trim( $anno.text() ) );
- $historyAnnotationArea.slideDown( panel.fxSpeed );
-
- } else {
- $historyAnnotationArea.slideUp( panel.fxSpeed );
- }
- return false;
- });
- //<em>{{#local}}Describe or add notes to history{{/local}}</em>
-
+ var panel = this;//,
$where.find( '.history-name' ).make_text_editable({
on_finish: function( newName ){
$where.find( '.history-name' ).text( newName );
@@ -721,17 +690,6 @@
});
}
});
-
- $where.find( '.history-controls .annotation' ).make_text_editable({
- use_textarea : true,
- on_finish: function( newAnnotation ){
- $where.find( '.history-controls .annotation' ).text( newAnnotation );
- panel.model.save({ annotation: newAnnotation })
- .fail( function(){
- $where.find( '.history-controls .annotation' ).text( panel.model.previous( 'annotation' ) );
- });
- }
- });
},
/** Set up/render a view for each HDA to be shown, init with model and listeners.
@@ -759,9 +717,8 @@
// ------------------------------------------------------------------------ panel events
/** event map */
events : {
- 'click .history-tag-button' : 'displayTags',
-//TODO: switch to common close (X) idiom
// allow (error) messages to be clicked away
+ //TODO: switch to common close (X) idiom
'click .message-container' : 'clearMessages'
},
@@ -802,14 +759,6 @@
return this.storage.get( 'show_hidden' );
},
- /** Find the tag area and, if initial: load the html (via ajax) for displaying them; otherwise, unhide/hide
- */
-//TODO: into sub-MV
- displayTags : function( event ){
- this.$el.find( '.history-controls .tags-display' ).slideToggle( this.fxSpeed );
- return false;
- },
-
// ........................................................................ loading indicator
/** hide the panel and display a loading indicator (in the panel's parent) when history model's are switched */
showLoadingIndicator : function( msg, speed, callback ){
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/mvc/tags.js
--- a/static/scripts/mvc/tags.js
+++ b/static/scripts/mvc/tags.js
@@ -1,74 +1,88 @@
-/** */
-var TagsEditor = Backbone.View.extend( LoggableMixin ).extend({
+/** A view on any model that has a 'tags' attribute (a list of tag strings)
+ * Incorporates the select2 jQuery plugin for tags display/editing:
+ * http://ivaynberg.github.io/select2/
+ */
+var TagsEditor = Backbone.View.extend( LoggableMixin ).extend( HiddenUntilActivatedViewMixin ).extend({
tagName : 'div',
className : 'tags-display',
- /** */
+ /** Set up listeners, parse options */
initialize : function( options ){
//console.debug( this, options );
+ // only listen to the model only for changes to tags - re-render
this.listenTo( this.model, 'change:tags', function(){
this.render();
});
+ this.hiddenUntilActivated( options.$activator, options );
},
- /** */
+ /** Build the DOM elements, call select to on the created input, and set up behaviors */
render : function(){
var view = this;
+ this.$el.html( this._template() );
- this.$el.html( this.template() );
- this.$el.find( '.tags-input' ).select2({
+ this.$input().select2({
placeholder : 'Add tags',
width : '100%',
tags : function(){
// initialize possible tags in the dropdown based on all the tags the user has used so far
- return view.getTagsUsed();
+ return view._getTagsUsed();
}
});
- this._behaviors();
+
+ this._setUpBehaviors();
return this;
},
- /** */
- template : function(){
+ /** @returns {String} the html text used to build the view's DOM */
+ _template : function(){
return [
//TODO: make prompt optional
'<label class="prompt">', _l( 'Tags' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
- '<input class="tags-input" value="', this.tagsToCSV( this.model.get( 'tags' ) ), '" />'
+ '<input class="tags-input" value="', this.tagsToCSV(), '" />'
].join( '' );
},
- /** */
- tagsToCSV : function( tagsArray ){
+ /** @returns {String} the sorted, comma-separated tags from the model */
+ tagsToCSV : function(){
+ var tagsArray = this.model.get( 'tags' );
if( !_.isArray( tagsArray ) || _.isEmpty( tagsArray ) ){
return '';
}
return tagsArray.sort().join( ',' );
},
- /** */
- getTagsUsed : function(){
- return _.map( Galaxy.currUser.get( 'tags_used' ), function( tag ){
- return { id: tag, text: tag };
- });
+ /** @returns {jQuery} the input for this view */
+ $input : function(){
+ return this.$el.find( '.tags-input' );
},
- /** */
- _behaviors : function(){
+ /** @returns {String[]} all tags used by the current user */
+ _getTagsUsed : function(){
+//TODO: global
+ return Galaxy.currUser.get( 'tags_used' );
+ },
+
+ /** set up any event listeners on the view's DOM (mostly handled by select2) */
+ _setUpBehaviors : function(){
var view = this;
- this.$el.find( '.tags-input' ).on( 'change', function( event ){
+ this.$input().on( 'change', function( event ){
// save the model's tags in either remove or added event
view.model.save({ tags: event.val }, { silent: true });
// if it's new, add the tag to the users tags
if( event.added ){
- view.addNewTagToTagsUsed( event.added.text );
+ view._addNewTagToTagsUsed( event.added.text );
}
});
},
- /** */
- addNewTagToTagsUsed : function( newTag ){
+ /** add a new tag (if not already there) to the list of all tags used by the user
+ * @param {String} newTag the tag to add to the list of used
+ */
+ _addNewTagToTagsUsed : function( newTag ){
+//TODO: global
var tagsUsed = Galaxy.currUser.get( 'tags_used' );
if( !_.contains( tagsUsed, newTag ) ){
tagsUsed.push( newTag );
@@ -77,12 +91,13 @@
}
},
- /** */
+ /** shut down event listeners and remove this view's DOM */
remove : function(){
- this.$el.off();
+ this.$input.off();
+ this.stopListening( this.model );
Backbone.View.prototype.remove.call( this );
},
- /** */
- toString : function(){ return [ 'TagSetView(', this.model + '', ')' ].join(''); }
+ /** string rep */
+ toString : function(){ return [ 'TagsEditor(', this.model + '', ')' ].join(''); }
});
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/annotations.js
--- a/static/scripts/packed/mvc/annotations.js
+++ b/static/scripts/packed/mvc/annotations.js
@@ -1,1 +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
+var AnnotationEditor=BaseView.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(a){a=a||{};this.tooltipConfig=a.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(b){a.$annotation().text(b);a.model.save({annotation:b},{silent:true}).fail(function(){a.$annotation().text(a.model.previous("annotation"))})}});return this},_template:function(){var a=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',a,"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/base-mvc.js
--- a/static/scripts/packed/mvc/base-mvc.js
+++ b/static/scripts/packed/mvc/base-mvc.js
@@ -1,1 +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(){if(this.logger){var a=this.logger.log;if(typeof this.logger.log==="object"){a=Function.prototype.bind.call(this.logger.log,this.logger)}return a.apply(this.logger,arguments)}return undefined}};var PersistentStorage=function(k,g){if(!k){throw ("PersistentStorage needs storageKey argument")}g=g||{};var i=sessionStorage,c=function j(m){var n=this.getItem(m);return(n!==null)?(JSON.parse(this.getItem(m))):(null)},b=function e(m,n){return this.setItem(m,JSON.stringify(n))},d=function f(m){return this.removeItem(m)};function a(n,m){n=n||{};m=m||null;return{get:function(o){if(o===undefined){return n}else{if(n.hasOwnProperty(o)){return(jQuery.type(n[o])==="object")?(new a(n[o],this)):(n[o])}}return undefined},set:function(o,p){n[o]=p;this._save();return this},deleteKey:function(o){delete n[o];this._save();return this},_save:function(){return m._save()},toString:function(){return("StorageRecursionHelper("+n+")")}}}var l={},h=c.call(i,k);if(h===null||h===undefined){h=jQuery.extend(true,{},g);b.call(i,k,h)}l=new a(h);jQuery.extend(l,{_save:function(m){return b.call(i,k,l.get())},destroy:function(){return d.call(i,k)},toString:function(){return"PersistentStorage("+k+")"}});return l};function LoadingIndicator(a,c){c=c||{};var b=this;function d(){var e=['<div class="loading-indicator">','<span class="fa fa-spinner fa-spin fa-lg" style="color: grey"></span>','<span style="margin-left: 8px; color: grey"><i>loading...</i></span>',"</div>"].join("\n");return $(e).css(c.css||{position:"fixed",margin:"12px 0px 0px 10px",opacity:"0.85"}).hide()}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ No newline at end of file
+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(){if(this.logger){var a=this.logger.log;if(typeof this.logger.log==="object"){a=Function.prototype.bind.call(this.logger.log,this.logger)}return a.apply(this.logger,arguments)}return undefined}};var PersistentStorage=function(k,g){if(!k){throw ("PersistentStorage needs storageKey argument")}g=g||{};var i=sessionStorage,c=function j(m){var n=this.getItem(m);return(n!==null)?(JSON.parse(this.getItem(m))):(null)},b=function e(m,n){return this.setItem(m,JSON.stringify(n))},d=function f(m){return this.removeItem(m)};function a(n,m){n=n||{};m=m||null;return{get:function(o){if(o===undefined){return n}else{if(n.hasOwnProperty(o)){return(jQuery.type(n[o])==="object")?(new a(n[o],this)):(n[o])}}return undefined},set:function(o,p){n[o]=p;this._save();return this},deleteKey:function(o){delete n[o];this._save();return this},_save:function(){return m._save()},toString:function(){return("StorageRecursionHelper("+n+")")}}}var l={},h=c.call(i,k);if(h===null||h===undefined){h=jQuery.extend(true,{},g);b.call(i,k,h)}l=new a(h);jQuery.extend(l,{_save:function(m){return b.call(i,k,l.get())},destroy:function(){return d.call(i,k)},toString:function(){return"PersistentStorage("+k+")"}});return l};var HiddenUntilActivatedViewMixin={hiddenUntilActivated:function(a,c){c=c||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,c||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");if(a){var b=this;a.on("click",function(d){b.toggle(b.HUAVOptions.showSpeed)})}},toggle:function(){if(this.HUAVOptions.$elementShown.is(":hidden")){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}else{if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this)}}}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};function LoadingIndicator(a,c){c=c||{};var b=this;function d(){var e=['<div class="loading-indicator">','<span class="fa fa-spinner fa-spin fa-lg" style="color: grey"></span>','<span style="margin-left: 8px; color: grey"><i>loading...</i></span>',"</div>"].join("\n");return $(e).css(c.css||{position:"fixed",margin:"12px 0px 0px 10px",opacity:"0.85"}).hide()}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>";if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"},confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:null},urlRoot:"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},tags:{get:galaxy_config.root+"tag/get_tagging_elt_async?item_id="+i+"&item_class=HistoryDatasetAssociation",set:galaxy_config.root+"tag/retag?item_id="+i+"&item_class=HistoryDatasetAssociation"},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){return this.save({deleted:true},h)},undelete:function a(h){return this.save({deleted:false},h)},hide:function b(h){return this.save({visible:false},h)},unhide:function g(h){return this.save({visible:true},h)},purge:function f(h){h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set("purged",true)});j.fail(function(o,k,n){var l=_l("Unable to purge this dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})})},searchKeys:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],search:function(h){var i=this;h=h.toLowerCase();return _.filter(this.searchKeys,function(k){var j=i.get(k);return(_.isString(j)&&j.toLowerCase().indexOf(h)!==-1)})},matches:function(h){return !!this.search(h).length},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,i){return this.filter(function(j){return j.isVisible(h,i)})},fetchAllDetails:function(){return this.fetch({data:{details:"all"}})},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return("HDACollection()")}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
+define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:null},urlRoot:"/api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){return this.save({deleted:true},h)},undelete:function a(h){return this.save({deleted:false},h)},hide:function b(h){return this.save({visible:false},h)},unhide:function g(h){return this.save({visible:true},h)},purge:function f(h){h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set("purged",true)});j.fail(function(o,k,n){var l=_l("Unable to purge this dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})})},searchKeys:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],search:function(h){var i=this;h=h.toLowerCase();return _.filter(this.searchKeys,function(k){var j=i.get(k);return(_.isString(j)&&j.toLowerCase().indexOf(h)!==-1)})},matches:function(h){return !!this.search(h).length},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,i){return this.filter(function(j){return j.isVisible(h,i)})},fetchAllDetails:function(){return this.fetch({data:{details:"all"}})},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return("HDACollection()")}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(d,b,a){var c=Backbone.View.extend(LoggableMixin).extend({HDAView:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(e){e=e||{};if(e.logger){this.logger=e.logger}this.log(this+".initialize:",e);this._setUpListeners();this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);if(this.model){this._setUpWebStorage(e.initiallyExpanded,e.show_deleted,e.show_hidden);this._setUpModelEventHandlers()}if(e.onready){e.onready.call(this)}},_setUpListeners:function(){this.on("error",function(f,i,e,h,g){this.errorHandler(f,i,e,h,g)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(e){this.log(this+"",arguments)},this)}},errorHandler:function(g,j,f,i,h){var e=this._parseErrorMessage(g,j,f,i,h);if(j&&j.status===0&&j.readyState===0){}else{if(j&&j.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",e.message,e.details)})}else{this.displayMessage("error",e.message,e.details)}}}},_parseErrorMessage:function(h,l,g,k,j){var f=Galaxy.currUser,e={message:this._bePolite(k),details:{user:(f instanceof User)?(f.toJSON()):(f+""),source:(h instanceof Backbone.Model)?(h.toJSON()):(h+""),xhr:l,options:(l)?(_.omit(g,"xhr")):(g)}};_.extend(e.details,j||{});if(l&&_.isFunction(l.getAllResponseHeaders)){var i=l.getAllResponseHeaders();i=_.compact(i.split("\n"));i=_.map(i,function(m){return m.split(": ")});e.details.xhr.responseHeaders=_.object(i)}return e},_bePolite:function(e){e=e||_l("An error occurred while getting updates from the server");return e+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(f){var e=this;return this.loadHistoryWithHDADetails("current",f).then(function(h,g){e.trigger("current-history",e)})},switchToHistory:function(h,g){var e=this,f=function(){return jQuery.post(galaxy_config.root+"api/histories/"+h+"/set_as_current")};return this.loadHistoryWithHDADetails(h,g,f).then(function(j,i){e.trigger("switched-history",e)})},createNewHistory:function(g){var e=this,f=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,g,f).then(function(i,h){e.trigger("new-history",e)})},loadHistoryWithHDADetails:function(h,g,f,j){var e=this,i=function(k){return e.getExpandedHdaIds(k.id)};return this.loadHistory(h,g,f,j,i)},loadHistory:function(h,g,f,k,i){this.trigger("loading-history",this);g=g||{};var e=this;var j=d.History.getHistoryData(h,{historyFn:f,hdaFn:k,hdaDetailIds:g.initiallyExpanded||i});return this._loadHistoryFromXHR(j,g).fail(function(n,l,m){e.trigger("error",e,n,g,_l("An error was encountered while "+l),{historyId:h,history:m||{}})}).always(function(){e.trigger("loading-done",e)})},_loadHistoryFromXHR:function(g,f){var e=this;g.then(function(h,i){e.setModel(h,i,f)});g.fail(function(i,h){e.render()});return g},setModel:function(g,e,f){f=f||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){g.user=Galaxy.currUser.toJSON()}this.model=new d.History(g,e,f);this._setUpWebStorage(f.initiallyExpanded,f.show_deleted,f.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},refreshHdas:function(f,e){if(this.model){return this.model.refresh(f,e)}return $.when()},_setUpWebStorage:function(f,e,g){this.storage=new PersistentStorage(this._getStorageKey(this.model.get("id")),{expandedHdas:{},show_deleted:false,show_hidden:false});this.log(this+" (prev) storage:",JSON.stringify(this.storage.get(),null,2));if(f){this.storage.set("exandedHdas",f)}if((e===true)||(e===false)){this.storage.set("show_deleted",e)}if((g===true)||(g===false)){this.storage.set("show_hidden",g)}this.show_deleted=this.storage.get("show_deleted");this.show_hidden=this.storage.get("show_hidden");this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},_getStorageKey:function(e){if(!e){throw new Error("_getStorageKey needs valid id: "+e)}return("history:"+e)},clearWebStorage:function(){for(var e in sessionStorage){if(e.indexOf("history:")===0){sessionStorage.removeItem(e)}}},getStoredOptions:function(f){if(!f||f==="current"){return(this.storage)?(this.storage.get()):({})}var e=sessionStorage.getItem(this._getStorageKey(f));return(e===null)?({}):(JSON.parse(e))},getExpandedHdaIds:function(e){var f=this.getStoredOptions(e).expandedHdas;return((_.isEmpty(f))?([]):(_.keys(f)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(f,h,e,g){this.errorHandler(f,h,e,g)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(e){this.model.fetch()},this);this.model.hdas.on("state:ready",function(f,g,e){if((!f.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[f.id])}},this)},addHdaView:function(h){this.log("add."+this,h);var f=this;if(!h.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function g(j){var i=f.$el.find(f.emptyMsgSelector);if(i.is(":visible")){i.fadeOut(f.fxSpeed,j)}else{j()}},function e(j){f.scrollToTop();var i=f.$el.find(f.datasetsSelector);f.createHdaView(h).$el.hide().prependTo(i).slideDown(f.fxSpeed)}])},createHdaView:function(g){var f=g.get("id"),e=this.storage.get("expandedHdas").get(f),h=new this.HDAView({model:g,expanded:e,hasUser:this.model.hasUser(),logger:this.logger});this._setUpHdaListeners(h);this.hdaViews[f]=h;return h.render()},_setUpHdaListeners:function(f){var e=this;f.on("body-expanded",function(g){e.storage.get("expandedHdas").set(g,true)});f.on("body-collapsed",function(g){e.storage.get("expandedHdas").deleteKey(g)});f.on("error",function(h,j,g,i){e.errorHandler(h,j,g,i)})},handleHdaDeletionChange:function(e){if(e.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[e.id])}},handleHdaVisibleChange:function(e){if(e.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[e.id])}},removeHdaView:function(f){if(!f){return}var e=this;f.$el.fadeOut(e.fxSpeed,function(){f.off();f.remove();delete e.hdaViews[f.model.id];if(_.isEmpty(e.hdaViews)){e.$el.find(e.emptyMsgSelector).fadeIn(e.fxSpeed,function(){e.trigger("empty-history",e)})}})},render:function(g){var e=this,f;if(this.model){f=this.renderModel()}else{f=this.renderWithoutModel()}$(e).queue("fx",[function(h){if(e.$el.is(":visible")){e.$el.fadeOut(e.fxSpeed,h)}else{h()}},function(h){e.$el.empty();if(f){e.$el.append(f.children())}e.$el.fadeIn(e.fxSpeed,h)},function(h){if(g){g.call(this)}e.trigger("rendered",this)}]);return this},renderWithoutModel:function(){var e=$("<div/>"),f=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return e.append(f)},renderModel:function(){var e=$("<div/>");if(Galaxy.currUser.isAnonymous()){e.append(c.templates.anonHistoryPanel(this.model.toJSON()))}else{e.append(c.templates.historyPanel(this.model.toJSON()));e.find(".history-secondary-actions").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:e.find(".history-controls .tags-display")}).render()}this._setUpBehaviours(e);if(!this.model.hdas.length||!this.renderHdas(e.find(this.datasetsSelector))){e.find(this.emptyMsgSelector).show()}return e},_render_tagButton:function(){return faIconButton({title:_l("Edit history tags"),classes:"history-tag-button",faIcon:"fa-tags"})},_render_annotateButton:function(){return faIconButton({title:_l("Edit history tags"),classes:"history-annotate-button",faIcon:"fa-comment"})},_setUpBehaviours:function(e){e=e||this.$el;e.find("[title]").tooltip({placement:"bottom"});if(!this.model||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){return}var f=this,g=e.find(".history-controls .annotation-display");e.find(".history-controls .history-annotate-button").click(function(){if(g.is(":hidden")){var h=f.$el.find(".history-controls .annotation");h.text(jQuery.trim(h.text()));g.slideDown(f.fxSpeed)}else{g.slideUp(f.fxSpeed)}return false});e.find(".history-name").make_text_editable({on_finish:function(h){e.find(".history-name").text(h);f.model.save({name:h}).fail(function(){e.find(".history-name").text(f.model.previous("name"))})}});e.find(".history-controls .annotation").make_text_editable({use_textarea:true,on_finish:function(h){e.find(".history-controls .annotation").text(h);f.model.save({annotation:h}).fail(function(){e.find(".history-controls .annotation").text(f.model.previous("annotation"))})}})},renderHdas:function(f){this.hdaViews={};var e=this,g=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"));_.each(g,function(h){f.prepend(e.createHdaView(h).$el)});return g.length},events:{"click .history-tag-button":"displayTags","click .message-container":"clearMessages"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(e){e.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.render();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.render();return this.storage.get("show_hidden")},displayTags:function(e){this.$el.find(".history-controls .tags-display").slideToggle(this.fxSpeed);return false},showLoadingIndicator:function(f,e,g){e=(e!==undefined)?(e):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,g)}else{this.$el.fadeOut(e);this.indicator.show(f,e,g)}},hideLoadingIndicator:function(e,f){e=(e!==undefined)?(e):(this.fxSpeed);if(this.indicator){this.indicator.hide(e,f)}},displayMessage:function(j,k,i){var g=this;this.scrollToTop();var h=this.$el.find(this.msgsSelector),e=$("<div/>").addClass(j+"message").html(k);if(!_.isEmpty(i)){var f=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(g.messageToModalOptions(j,k,i));return false});e.append(" ",f)}return h.html(e)},messageToModalOptions:function(i,k,h){var e=this,j=$("<div/>"),g={title:"Details"};function f(l){l=_.omit(l,_.functions(l));return["<table>",_.map(l,function(n,m){n=(_.isObject(n))?(f(n)):(n);return'<tr><td style="vertical-align: top; color: grey">'+m+'</td><td style="padding-left: 8px">'+n+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(h)){g.body=j.append(f(h))}else{g.body=j.html(h)}g.buttons={Ok:function(){Galaxy.modal.hide();e.clearMessages()}};return g},clearMessages:function(){var e=this.$el.find(this.msgsSelector);e.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(e){this.$el.parent().scrollTop(e)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(f,g){if(!g){this.$el.parent().parent().scrollTop(f);return this}var e=window,h=this.$el.parent().parent(),j=$(e).innerHeight(),i=(j/2)-(g/2);$(h).scrollTop(f-i);return this},scrollToId:function(f){if((!f)||(!this.hdaViews[f])){return this}var e=this.hdaViews[f].$el;this.scrollIntoView(e.offset().top,e.outerHeight());return this},scrollToHid:function(e){var f=this.model.hdas.getByHid(e);if(!f){return this}return this.scrollToId(f.id)},connectToQuotaMeter:function(e){if(!e){return this}this.listenTo(e,"quota:over",this.showQuotaMessage);this.listenTo(e,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(e&&e.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var e=this.$el.find(".quota-message");if(e.is(":hidden")){e.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var e=this.$el.find(".quota-message");if(!e.is(":hidden")){e.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(e){if(!e){return this}this.on("new-storage",function(g,f){if(e&&g){e.findItemByHtml(_l("Include Deleted Datasets")).checked=g.get("show_deleted");e.findItemByHtml(_l("Include Hidden Datasets")).checked=g.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});c.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:c}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(d,b,a){var c=Backbone.View.extend(LoggableMixin).extend({HDAView:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(e){e=e||{};if(e.logger){this.logger=e.logger}this.log(this+".initialize:",e);this._setUpListeners();this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);if(this.model){this._setUpWebStorage(e.initiallyExpanded,e.show_deleted,e.show_hidden);this._setUpModelEventHandlers()}if(e.onready){e.onready.call(this)}},_setUpListeners:function(){this.on("error",function(f,i,e,h,g){this.errorHandler(f,i,e,h,g)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(e){this.log(this+"",arguments)},this)}},errorHandler:function(g,j,f,i,h){var e=this._parseErrorMessage(g,j,f,i,h);if(j&&j.status===0&&j.readyState===0){}else{if(j&&j.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",e.message,e.details)})}else{this.displayMessage("error",e.message,e.details)}}}},_parseErrorMessage:function(h,l,g,k,j){var f=Galaxy.currUser,e={message:this._bePolite(k),details:{user:(f instanceof User)?(f.toJSON()):(f+""),source:(h instanceof Backbone.Model)?(h.toJSON()):(h+""),xhr:l,options:(l)?(_.omit(g,"xhr")):(g)}};_.extend(e.details,j||{});if(l&&_.isFunction(l.getAllResponseHeaders)){var i=l.getAllResponseHeaders();i=_.compact(i.split("\n"));i=_.map(i,function(m){return m.split(": ")});e.details.xhr.responseHeaders=_.object(i)}return e},_bePolite:function(e){e=e||_l("An error occurred while getting updates from the server");return e+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(f){var e=this;return this.loadHistoryWithHDADetails("current",f).then(function(h,g){e.trigger("current-history",e)})},switchToHistory:function(h,g){var e=this,f=function(){return jQuery.post(galaxy_config.root+"api/histories/"+h+"/set_as_current")};return this.loadHistoryWithHDADetails(h,g,f).then(function(j,i){e.trigger("switched-history",e)})},createNewHistory:function(g){var e=this,f=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,g,f).then(function(i,h){e.trigger("new-history",e)})},loadHistoryWithHDADetails:function(h,g,f,j){var e=this,i=function(k){return e.getExpandedHdaIds(k.id)};return this.loadHistory(h,g,f,j,i)},loadHistory:function(h,g,f,k,i){this.trigger("loading-history",this);g=g||{};var e=this;var j=d.History.getHistoryData(h,{historyFn:f,hdaFn:k,hdaDetailIds:g.initiallyExpanded||i});return this._loadHistoryFromXHR(j,g).fail(function(n,l,m){e.trigger("error",e,n,g,_l("An error was encountered while "+l),{historyId:h,history:m||{}})}).always(function(){e.trigger("loading-done",e)})},_loadHistoryFromXHR:function(g,f){var e=this;g.then(function(h,i){e.setModel(h,i,f)});g.fail(function(i,h){e.render()});return g},setModel:function(g,e,f){f=f||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){g.user=Galaxy.currUser.toJSON()}this.model=new d.History(g,e,f);this._setUpWebStorage(f.initiallyExpanded,f.show_deleted,f.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},refreshHdas:function(f,e){if(this.model){return this.model.refresh(f,e)}return $.when()},_setUpWebStorage:function(f,e,g){this.storage=new PersistentStorage(this._getStorageKey(this.model.get("id")),{expandedHdas:{},show_deleted:false,show_hidden:false});this.log(this+" (prev) storage:",JSON.stringify(this.storage.get(),null,2));if(f){this.storage.set("exandedHdas",f)}if((e===true)||(e===false)){this.storage.set("show_deleted",e)}if((g===true)||(g===false)){this.storage.set("show_hidden",g)}this.show_deleted=this.storage.get("show_deleted");this.show_hidden=this.storage.get("show_hidden");this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},_getStorageKey:function(e){if(!e){throw new Error("_getStorageKey needs valid id: "+e)}return("history:"+e)},clearWebStorage:function(){for(var e in sessionStorage){if(e.indexOf("history:")===0){sessionStorage.removeItem(e)}}},getStoredOptions:function(f){if(!f||f==="current"){return(this.storage)?(this.storage.get()):({})}var e=sessionStorage.getItem(this._getStorageKey(f));return(e===null)?({}):(JSON.parse(e))},getExpandedHdaIds:function(e){var f=this.getStoredOptions(e).expandedHdas;return((_.isEmpty(f))?([]):(_.keys(f)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(f,h,e,g){this.errorHandler(f,h,e,g)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(e){this.model.fetch()},this);this.model.hdas.on("state:ready",function(f,g,e){if((!f.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[f.id])}},this)},addHdaView:function(h){this.log("add."+this,h);var f=this;if(!h.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function g(j){var i=f.$el.find(f.emptyMsgSelector);if(i.is(":visible")){i.fadeOut(f.fxSpeed,j)}else{j()}},function e(j){f.scrollToTop();var i=f.$el.find(f.datasetsSelector);f.createHdaView(h).$el.hide().prependTo(i).slideDown(f.fxSpeed)}])},createHdaView:function(g){var f=g.get("id"),e=this.storage.get("expandedHdas").get(f),h=new this.HDAView({model:g,expanded:e,hasUser:this.model.hasUser(),logger:this.logger});this._setUpHdaListeners(h);this.hdaViews[f]=h;return h.render()},_setUpHdaListeners:function(f){var e=this;f.on("body-expanded",function(g){e.storage.get("expandedHdas").set(g,true)});f.on("body-collapsed",function(g){e.storage.get("expandedHdas").deleteKey(g)});f.on("error",function(h,j,g,i){e.errorHandler(h,j,g,i)})},handleHdaDeletionChange:function(e){if(e.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[e.id])}},handleHdaVisibleChange:function(e){if(e.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[e.id])}},removeHdaView:function(f){if(!f){return}var e=this;f.$el.fadeOut(e.fxSpeed,function(){f.off();f.remove();delete e.hdaViews[f.model.id];if(_.isEmpty(e.hdaViews)){e.$el.find(e.emptyMsgSelector).fadeIn(e.fxSpeed,function(){e.trigger("empty-history",e)})}})},render:function(g){var e=this,f;if(this.model){f=this.renderModel()}else{f=this.renderWithoutModel()}$(e).queue("fx",[function(h){if(e.$el.is(":visible")){e.$el.fadeOut(e.fxSpeed,h)}else{h()}},function(h){e.$el.empty();if(f){e.$el.append(f.children())}e.$el.fadeIn(e.fxSpeed,h)},function(h){if(g){g.call(this)}e.trigger("rendered",this)}]);return this},renderWithoutModel:function(){var e=$("<div/>"),f=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return e.append(f)},renderModel:function(){var e=$("<div/>");if(Galaxy.currUser.isAnonymous()){e.append(c.templates.anonHistoryPanel(this.model.toJSON()))}else{e.append(c.templates.historyPanel(this.model.toJSON()));this._renderTags(e);this._renderAnnotation(e)}this._setUpBehaviours(e);if(!this.model.hdas.length||!this.renderHdas(e.find(this.datasetsSelector))){e.find(this.emptyMsgSelector).show()}return e},_renderTags:function(e){this.tagsEditor=new TagsEditor({model:this.model,el:e.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".history-secondary-actions"))})},_renderAnnotation:function(e){this.annotationEditor=new AnnotationEditor({model:this.model,el:e.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".history-secondary-actions"))})},_setUpBehaviours:function(e){e=e||this.$el;e.find("[title]").tooltip({placement:"bottom"});if(!this.model||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){return}var f=this;e.find(".history-name").make_text_editable({on_finish:function(g){e.find(".history-name").text(g);f.model.save({name:g}).fail(function(){e.find(".history-name").text(f.model.previous("name"))})}})},renderHdas:function(f){this.hdaViews={};var e=this,g=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"));_.each(g,function(h){f.prepend(e.createHdaView(h).$el)});return g.length},events:{"click .message-container":"clearMessages"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(e){e.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.render();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.render();return this.storage.get("show_hidden")},showLoadingIndicator:function(f,e,g){e=(e!==undefined)?(e):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,g)}else{this.$el.fadeOut(e);this.indicator.show(f,e,g)}},hideLoadingIndicator:function(e,f){e=(e!==undefined)?(e):(this.fxSpeed);if(this.indicator){this.indicator.hide(e,f)}},displayMessage:function(j,k,i){var g=this;this.scrollToTop();var h=this.$el.find(this.msgsSelector),e=$("<div/>").addClass(j+"message").html(k);if(!_.isEmpty(i)){var f=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(g.messageToModalOptions(j,k,i));return false});e.append(" ",f)}return h.html(e)},messageToModalOptions:function(i,k,h){var e=this,j=$("<div/>"),g={title:"Details"};function f(l){l=_.omit(l,_.functions(l));return["<table>",_.map(l,function(n,m){n=(_.isObject(n))?(f(n)):(n);return'<tr><td style="vertical-align: top; color: grey">'+m+'</td><td style="padding-left: 8px">'+n+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(h)){g.body=j.append(f(h))}else{g.body=j.html(h)}g.buttons={Ok:function(){Galaxy.modal.hide();e.clearMessages()}};return g},clearMessages:function(){var e=this.$el.find(this.msgsSelector);e.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(e){this.$el.parent().scrollTop(e)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(f,g){if(!g){this.$el.parent().parent().scrollTop(f);return this}var e=window,h=this.$el.parent().parent(),j=$(e).innerHeight(),i=(j/2)-(g/2);$(h).scrollTop(f-i);return this},scrollToId:function(f){if((!f)||(!this.hdaViews[f])){return this}var e=this.hdaViews[f].$el;this.scrollIntoView(e.offset().top,e.outerHeight());return this},scrollToHid:function(e){var f=this.model.hdas.getByHid(e);if(!f){return this}return this.scrollToId(f.id)},connectToQuotaMeter:function(e){if(!e){return this}this.listenTo(e,"quota:over",this.showQuotaMessage);this.listenTo(e,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(e&&e.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var e=this.$el.find(".quota-message");if(e.is(":hidden")){e.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var e=this.$el.find(".quota-message");if(!e.is(":hidden")){e.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(e){if(!e){return this}this.on("new-storage",function(g,f){if(e&&g){e.findItemByHtml(_l("Include Deleted Datasets")).checked=g.get("show_deleted");e.findItemByHtml(_l("Include Hidden Datasets")).checked=g.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});c.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:c}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/mvc/tags.js
--- a/static/scripts/packed/mvc/tags.js
+++ b/static/scripts/packed/mvc/tags.js
@@ -1,1 +1,1 @@
-var TagsEditor=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"tags-display",initialize:function(a){this.listenTo(this.model,"change:tags",function(){this.render()})},render:function(){var a=this;this.$el.html(this.template());this.$el.find(".tags-input").select2({placeholder:"Add tags",width:"100%",tags:function(){return a.getTagsUsed()}});this._behaviors();return this},template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(this.model.get("tags")),'" />'].join("")},tagsToCSV:function(a){if(!_.isArray(a)||_.isEmpty(a)){return""}return a.sort().join(",")},getTagsUsed:function(){return _.map(Galaxy.currUser.get("tags_used"),function(a){return{id:a,text:a}})},_behaviors:function(){var a=this;this.$el.find(".tags-input").on("change",function(b){a.model.save({tags:b.val},{silent:true});if(b.added){a.addNewTagToTagsUsed(b.added.text)}})},addNewTagToTagsUsed:function(a){var b=Galaxy.currUser.get("tags_used");if(!_.contains(b,a)){b.push(a);b.sort();Galaxy.currUser.set("tags_used",b)}},remove:function(){this.$el.off();Backbone.View.prototype.remove.call(this)},toString:function(){return["TagSetView(",this.model+"",")"].join("")}});
\ No newline at end of file
+var TagsEditor=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(a){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return a._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var a=this.model.get("tags");if(!_.isArray(a)||_.isEmpty(a)){return""}return a.sort().join(",")},$input:function(){return this.$el.find(".tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var a=this;this.$input().on("change",function(b){a.model.save({tags:b.val},{silent:true});if(b.added){a._addNewTagToTagsUsed(b.added.text)}})},_addNewTagToTagsUsed:function(a){var b=Galaxy.currUser.get("tags_used");if(!_.contains(b,a)){b.push(a);b.sort();Galaxy.currUser.set("tags_used",b)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/templates/compiled/history-templates.js
--- a/static/scripts/packed/templates/compiled/history-templates.js
+++ b/static/scripts/packed/templates/compiled/history-templates.js
@@ -1,1 +1,1 @@
-(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(h,u,s,n,B){this.compilerInfo=[4,">= 1.0.0"];s=this.merge(s,h.helpers);B=B||{};var t="",j,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(F,E){var C="",D;C+='\n <div class="dataset-summary">\n ';if(D=s.body){D=D.call(F,{hash:{},data:E})}else{D=F.body;D=typeof D===e?D.apply(F):D}if(D||D===0){C+=D}C+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return C}function p(F,E){var C="",D;C+='\n <div class="dataset-summary">\n ';D=s["if"].call(F,F.misc_blurb,{hash:{},inverse:r.noop,fn:r.program(4,o,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.data_type,{hash:{},inverse:r.noop,fn:r.program(6,m,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.metadata_dbkey,{hash:{},inverse:r.noop,fn:r.program(9,g,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.misc_info,{hash:{},inverse:r.noop,fn:r.program(12,z,E),data:E});if(D||D===0){C+=D}C+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';D=s.unless.call(F,F.deleted,{hash:{},inverse:r.noop,fn:r.program(14,y,E),data:E});if(D||D===0){C+=D}C+="\n\n ";return C}function o(F,E){var C="",D;C+='\n <div class="dataset-blurb">\n <span class="value">';if(D=s.misc_blurb){D=D.call(F,{hash:{},data:E})}else{D=F.misc_blurb;D=typeof D===e?D.apply(F):D}C+=d(D)+"</span>\n </div>\n ";return C}function m(G,F){var C="",E,D;C+='\n <div class="dataset-datatype">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(7,l,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <span class="value">';if(E=s.data_type){E=E.call(G,{hash:{},data:F})}else{E=G.data_type;E=typeof E===e?E.apply(G):E}C+=d(E)+"</span>\n </div>\n ";return C}function l(D,C){return"format"}function g(G,F){var C="",E,D;C+='\n <div class="dataset-dbkey">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(10,A,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <span class="value">\n ';if(E=s.metadata_dbkey){E=E.call(G,{hash:{},data:F})}else{E=G.metadata_dbkey;E=typeof E===e?E.apply(G):E}C+=d(E)+"\n </span>\n </div>\n ";return C}function A(D,C){return"database"}function z(F,E){var C="",D;C+='\n <div class="dataset-info">\n <span class="value">';if(D=s.misc_info){D=D.call(F,{hash:{},data:E})}else{D=F.misc_info;D=typeof D===e?D.apply(F):D}C+=d(D)+"</span>\n </div>\n ";return C}function y(G,F){var C="",E,D;C+='\n \n <div class="tags-display"></div>\n\n \n <div class="annotation-display">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(15,x,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <div id="dataset-';if(E=s.id){E=E.call(G,{hash:{},data:F})}else{E=G.id;E=typeof E===e?E.apply(G):E}C+=d(E)+'-annotation" class="annotation editable-text"\n title="';D={hash:{},inverse:r.noop,fn:r.program(17,w,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='"></div>\n </div>\n\n <div class="dataset-display-applications">\n ';E=s.each.call(G,G.display_apps,{hash:{},inverse:r.noop,fn:r.program(19,v,F),data:F});if(E||E===0){C+=E}C+="\n\n ";E=s.each.call(G,G.display_types,{hash:{},inverse:r.noop,fn:r.program(19,v,F),data:F});if(E||E===0){C+=E}C+='\n </div>\n\n <div class="dataset-peek">\n ';E=s["if"].call(G,G.peek,{hash:{},inverse:r.noop,fn:r.program(23,f,F),data:F});if(E||E===0){C+=E}C+="\n </div>\n\n ";return C}function x(D,C){return"Annotation"}function w(D,C){return"Edit dataset annotation"}function v(F,E){var C="",D;C+='\n <div class="display-application">\n <span class="display-application-location">';if(D=s.label){D=D.call(F,{hash:{},data:E})}else{D=F.label;D=typeof D===e?D.apply(F):D}C+=d(D)+'</span>\n <span class="display-application-links">\n ';D=s.each.call(F,F.links,{hash:{},inverse:r.noop,fn:r.program(20,k,E),data:E});if(D||D===0){C+=D}C+="\n </span>\n </div>\n ";return C}function k(G,F){var C="",E,D;C+='\n <a target="';if(E=s.target){E=E.call(G,{hash:{},data:F})}else{E=G.target;E=typeof E===e?E.apply(G):E}C+=d(E)+'" href="';if(E=s.href){E=E.call(G,{hash:{},data:F})}else{E=G.href;E=typeof E===e?E.apply(G):E}C+=d(E)+'">';D={hash:{},inverse:r.noop,fn:r.program(21,i,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+="</a>\n ";return C}function i(E,D){var C;if(C=s.text){C=C.call(E,{hash:{},data:D})}else{C=E.text;C=typeof C===e?C.apply(E):C}return d(C)}function f(F,E){var C="",D;C+='\n <pre class="peek">';if(D=s.peek){D=D.call(F,{hash:{},data:E})}else{D=F.peek;D=typeof D===e?D.apply(F):D}if(D||D===0){C+=D}C+="</pre>\n ";return C}t+='<div class="dataset-body">\n ';j=s["if"].call(u,u.body,{hash:{},inverse:r.program(3,p,B),fn:r.program(1,q,B),data:B});if(j||j===0){t+=j}t+="\n</div>";return t})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(j,v,t,o,C){this.compilerInfo=[4,">= 1.0.0"];t=this.merge(t,j.helpers);C=C||{};var u="",l,e="function",d=this.escapeExpression,s=this,c=t.blockHelperMissing;function r(G,F){var D="",E;D+='\n <div class="dataset-summary">\n ';if(E=t.body){E=E.call(G,{hash:{},data:F})}else{E=G.body;E=typeof E===e?E.apply(G):E}if(E||E===0){D+=E}D+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return D}function q(G,F){var D="",E;D+='\n <div class="dataset-summary">\n ';E=t["if"].call(G,G.misc_blurb,{hash:{},inverse:s.noop,fn:s.program(4,p,F),data:F});if(E||E===0){D+=E}D+="\n\n ";E=t["if"].call(G,G.data_type,{hash:{},inverse:s.noop,fn:s.program(6,n,F),data:F});if(E||E===0){D+=E}D+="\n\n ";E=t["if"].call(G,G.metadata_dbkey,{hash:{},inverse:s.noop,fn:s.program(9,i,F),data:F});if(E||E===0){D+=E}D+="\n\n ";E=t["if"].call(G,G.misc_info,{hash:{},inverse:s.noop,fn:s.program(12,A,F),data:F});if(E||E===0){D+=E}D+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';E=t.unless.call(G,G.deleted,{hash:{},inverse:s.noop,fn:s.program(14,z,F),data:F});if(E||E===0){D+=E}D+="\n\n ";return D}function p(G,F){var D="",E;D+='\n <div class="dataset-blurb">\n <span class="value">';if(E=t.misc_blurb){E=E.call(G,{hash:{},data:F})}else{E=G.misc_blurb;E=typeof E===e?E.apply(G):E}D+=d(E)+"</span>\n </div>\n ";return D}function n(H,G){var D="",F,E;D+='\n <div class="dataset-datatype">\n <label class="prompt">';E={hash:{},inverse:s.noop,fn:s.program(7,m,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='</label>\n <span class="value">';if(F=t.data_type){F=F.call(H,{hash:{},data:G})}else{F=H.data_type;F=typeof F===e?F.apply(H):F}D+=d(F)+"</span>\n </div>\n ";return D}function m(E,D){return"format"}function i(H,G){var D="",F,E;D+='\n <div class="dataset-dbkey">\n <label class="prompt">';E={hash:{},inverse:s.noop,fn:s.program(10,B,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='</label>\n <span class="value">\n ';if(F=t.metadata_dbkey){F=F.call(H,{hash:{},data:G})}else{F=H.metadata_dbkey;F=typeof F===e?F.apply(H):F}D+=d(F)+"\n </span>\n </div>\n ";return D}function B(E,D){return"database"}function A(G,F){var D="",E;D+='\n <div class="dataset-info">\n <span class="value">';if(E=t.misc_info){E=E.call(G,{hash:{},data:F})}else{E=G.misc_info;E=typeof E===e?E.apply(G):E}D+=d(E)+"</span>\n </div>\n ";return D}function z(H,G){var D="",F,E;D+='\n \n <div class="tags-display">\n <label class="prompt">';E={hash:{},inverse:s.noop,fn:s.program(15,y,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='</label>\n <div class="tags"></div>\n </div>\n\n \n <div class="annotation-display">\n <label class="prompt">';E={hash:{},inverse:s.noop,fn:s.program(17,x,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='</label>\n <div id="dataset-';if(F=t.id){F=F.call(H,{hash:{},data:G})}else{F=H.id;F=typeof F===e?F.apply(H):F}D+=d(F)+'-annotation" class="annotation editable-text"\n title="';E={hash:{},inverse:s.noop,fn:s.program(19,w,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='"></div>\n </div>\n\n <div class="dataset-display-applications">\n ';F=t.each.call(H,H.display_apps,{hash:{},inverse:s.noop,fn:s.program(21,k,G),data:G});if(F||F===0){D+=F}D+="\n\n ";F=t.each.call(H,H.display_types,{hash:{},inverse:s.noop,fn:s.program(21,k,G),data:G});if(F||F===0){D+=F}D+='\n </div>\n\n <div class="dataset-peek">\n ';F=t["if"].call(H,H.peek,{hash:{},inverse:s.noop,fn:s.program(25,f,G),data:G});if(F||F===0){D+=F}D+="\n </div>\n\n ";return D}function y(E,D){return"Tags"}function x(E,D){return"Annotation"}function w(E,D){return"Edit dataset annotation"}function k(G,F){var D="",E;D+='\n <div class="display-application">\n <span class="display-application-location">';if(E=t.label){E=E.call(G,{hash:{},data:F})}else{E=G.label;E=typeof E===e?E.apply(G):E}D+=d(E)+'</span>\n <span class="display-application-links">\n ';E=t.each.call(G,G.links,{hash:{},inverse:s.noop,fn:s.program(22,h,F),data:F});if(E||E===0){D+=E}D+="\n </span>\n </div>\n ";return D}function h(H,G){var D="",F,E;D+='\n <a target="';if(F=t.target){F=F.call(H,{hash:{},data:G})}else{F=H.target;F=typeof F===e?F.apply(H):F}D+=d(F)+'" href="';if(F=t.href){F=F.call(H,{hash:{},data:G})}else{F=H.href;F=typeof F===e?F.apply(H):F}D+=d(F)+'">';E={hash:{},inverse:s.noop,fn:s.program(23,g,G),data:G};if(F=t.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!t.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="</a>\n ";return D}function g(F,E){var D;if(D=t.text){D=D.call(F,{hash:{},data:E})}else{D=F.text;D=typeof D===e?D.apply(F):D}return d(D)}function f(G,F){var D="",E;D+='\n <pre class="peek">';if(E=t.peek){E=E.call(G,{hash:{},data:F})}else{E=G.peek;E=typeof E===e?E.apply(G):E}if(E||E===0){D+=E}D+="</pre>\n ";return D}u+='<div class="dataset-body">\n ';l=t["if"].call(v,v.body,{hash:{},inverse:s.program(3,q,C),fn:s.program(1,r,C),data:C});if(l||l===0){u+=l}u+="\n</div>";return u})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-skeleton"]=b(function(f,r,p,k,w){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,f.helpers);w=w||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(B,A){var x="",z,y;x+='\n <div class="errormessagesmall">\n ';y={hash:{},inverse:o.noop,fn:o.program(2,m,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+=":\n ";y={hash:{},inverse:o.noop,fn:o.program(4,l,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </div>\n ";return x}function m(y,x){return"There was an error getting the data for this dataset"}function l(z,y){var x;if(x=p.error){x=x.call(z,{hash:{},data:y})}else{x=z.error;x=typeof x===e?x.apply(z):x}return d(x)}function j(A,z){var x="",y;x+="\n ";y=p["if"].call(A,A.purged,{hash:{},inverse:o.program(10,v,z),fn:o.program(7,i,z),data:z});if(y||y===0){x+=y}x+="\n ";return x}function i(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(8,g,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n\n ";return x}function g(y,x){return"This dataset has been deleted and removed from disk."}function v(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(11,u,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n \n Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it\n or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk\n </strong></div>\n ';return x}function u(y,x){return"This dataset has been deleted."}function t(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(14,s,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it\n </strong></div>\n ';return x}function s(y,x){return"This dataset has been hidden."}q+='<div class="dataset hda">\n <div class="dataset-warnings">\n ';h=p["if"].call(r,r.error,{hash:{},inverse:o.noop,fn:o.program(1,n,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p["if"].call(r,r.deleted,{hash:{},inverse:o.noop,fn:o.program(6,j,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p.unless.call(r,r.visible,{hash:{},inverse:o.noop,fn:o.program(13,t,w),data:w});if(h||h===0){q+=h}q+='\n </div>\n\n <div class="dataset-primary-actions"></div>\n <div class="dataset-title-bar clear">\n <span class="dataset-state-icon state-icon"></span>\n <div class="dataset-title">\n <span class="hda-hid">';if(h=p.hid){h=h.call(r,{hash:{},data:w})}else{h=r.hid;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n <span class="dataset-name">';if(h=p.name){h=h.call(r,{hash:{},data:w})}else{h=r.name;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n </div>\n </div>\n\n <div class="dataset-body"></div>\n</div>';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-skeleton"]=b(function(f,r,p,k,w){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,f.helpers);w=w||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(B,A){var x="",z,y;x+='\n <div class="errormessagesmall">\n ';y={hash:{},inverse:o.noop,fn:o.program(2,m,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+=":\n ";y={hash:{},inverse:o.noop,fn:o.program(4,l,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </div>\n ";return x}function m(y,x){return"There was an error getting the data for this dataset"}function l(z,y){var x;if(x=p.error){x=x.call(z,{hash:{},data:y})}else{x=z.error;x=typeof x===e?x.apply(z):x}return d(x)}function j(A,z){var x="",y;x+="\n ";y=p["if"].call(A,A.purged,{hash:{},inverse:o.program(10,v,z),fn:o.program(7,i,z),data:z});if(y||y===0){x+=y}x+="\n ";return x}function i(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(8,g,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n\n ";return x}function g(y,x){return"This dataset has been deleted and removed from disk."}function v(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(11,u,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n \n Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it\n or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk\n </strong></div>\n ';return x}function u(y,x){return"This dataset has been deleted."}function t(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(14,s,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it\n </strong></div>\n ';return x}function s(y,x){return"This dataset has been hidden."}q+='<div class="dataset hda">\n <div class="dataset-warnings">\n ';h=p["if"].call(r,r.error,{hash:{},inverse:o.noop,fn:o.program(1,n,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p["if"].call(r,r.deleted,{hash:{},inverse:o.noop,fn:o.program(6,j,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p.unless.call(r,r.visible,{hash:{},inverse:o.noop,fn:o.program(13,t,w),data:w});if(h||h===0){q+=h}q+='\n </div>\n\n <div class="dataset-primary-actions"></div>\n <div class="dataset-title-bar clear">\n <span class="dataset-state-icon state-icon"></span>\n <div class="dataset-title">\n <span class="hda-hid">';if(h=p.hid){h=h.call(r,{hash:{},data:w})}else{h=r.hid;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n <span class="dataset-name">';if(h=p.name){h=h.call(r,{hash:{},data:w})}else{h=r.name;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n </div>\n </div>\n\n <div class="dataset-body"></div>\n</div>';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel-anon"]=b(function(g,r,p,k,u){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);u=u||{};var q="",i,f,o=this,e="function",c=p.blockHelperMissing,d=this.escapeExpression;function n(z,y){var v="",x,w;v+='\n <div class="history-name" title="';w={hash:{},inverse:o.noop,fn:o.program(2,m,y),data:y};if(x=p.local){x=x.call(z,w)}else{x=z.local;x=typeof x===e?x.apply(z):x}if(!p.local){x=c.call(z,x,w)}if(x||x===0){v+=x}v+='">\n ';if(x=p.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===e?x.apply(z):x}v+=d(x)+"\n </div>\n ";return v}function m(w,v){return"You must be logged in to edit your history name"}function l(y,x){var v="",w;v+='\n <div class="history-size">';if(w=p.nice_size){w=w.call(y,{hash:{},data:x})}else{w=y.nice_size;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function j(y,x){var v="",w;v+='\n \n <div class="';if(w=p.status){w=w.call(y,{hash:{},data:x})}else{w=y.status;w=typeof w===e?w.apply(y):w}v+=d(w)+'message">';if(w=p.message){w=w.call(y,{hash:{},data:x})}else{w=y.message;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function h(w,v){return"You are over your disk quota"}function t(w,v){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function s(w,v){return"Your history is empty. Click 'Get Data' on the left pane to start"}q+='<div class="history-controls">\n\n <div class="history-title">\n \n ';i=p["if"].call(r,r.name,{hash:{},inverse:o.noop,fn:o.program(1,n,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=p["if"].call(r,r.nice_size,{hash:{},inverse:o.noop,fn:o.program(4,l,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="message-container">\n ';i=p["if"].call(r,r.message,{hash:{},inverse:o.noop,fn:o.program(6,j,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:o.noop,fn:o.program(8,h,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+=".\n ";f={hash:{},inverse:o.noop,fn:o.program(10,t,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+='.\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:o.noop,fn:o.program(12,s,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+="\n </div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,t,r,m,z){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);z=z||{};var s="",j,f,q=this,e="function",c=r.blockHelperMissing,d=this.escapeExpression;function p(E,D){var A="",C,B;A+='\n <div class="history-name" title="';B={hash:{},inverse:q.noop,fn:q.program(2,o,D),data:D};if(C=r.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!r.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='">\n ';if(C=r.name){C=C.call(E,{hash:{},data:D})}else{C=E.name;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </div>\n ";return A}function o(B,A){return"Click to rename history"}function n(D,C){var A="",B;A+='\n <div class="history-size">';if(B=r.nice_size){B=B.call(D,{hash:{},data:C})}else{B=D.nice_size;B=typeof B===e?B.apply(D):B}A+=d(B)+"</div>\n ";return A}function l(E,D){var A="",C,B;A+='\n <div class="warningmessagesmall"><strong>\n ';B={hash:{},inverse:q.noop,fn:q.program(7,k,D),data:D};if(C=r.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!r.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="\n </strong></div>\n ";return A}function k(B,A){return"You are currently viewing a deleted history!"}function g(D,C){var A="",B;A+='\n \n <div class="';if(B=r.status){B=B.call(D,{hash:{},data:C})}else{B=D.status;B=typeof B===e?B.apply(D):B}A+=d(B)+'message">';if(B=r.message){B=B.call(D,{hash:{},data:C})}else{B=D.message;B=typeof B===e?B.apply(D):B}A+=d(B)+"</div>\n ";return A}function y(B,A){return"You are over your disk quota"}function x(B,A){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function w(B,A){return"Annotation"}function v(B,A){return"Click to edit annotation"}function u(C,B){var A;if(A=r.annotation){A=A.call(C,{hash:{},data:B})}else{A=C.annotation;A=typeof A===e?A.apply(C):A}return d(A)}function i(B,A){return"Your history is empty. Click 'Get Data' on the left pane to start"}s+='<div class="history-controls">\n\n <div class="history-title">\n ';j=r["if"].call(t,t.name,{hash:{},inverse:q.noop,fn:q.program(1,p,z),data:z});if(j||j===0){s+=j}s+='\n </div>\n\n <div class="history-subtitle clear">\n ';j=r["if"].call(t,t.nice_size,{hash:{},inverse:q.noop,fn:q.program(4,n,z),data:z});if(j||j===0){s+=j}s+='\n\n <div class="history-secondary-actions">\n </div>\n </div>\n\n ';j=r["if"].call(t,t.deleted,{hash:{},inverse:q.noop,fn:q.program(6,l,z),data:z});if(j||j===0){s+=j}s+='\n\n <div class="message-container">\n ';j=r["if"].call(t,t.message,{hash:{},inverse:q.noop,fn:q.program(9,g,z),data:z});if(j||j===0){s+=j}s+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:q.noop,fn:q.program(11,y,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+=".\n ";f={hash:{},inverse:q.noop,fn:q.program(13,x,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='.\n </div>\n \n \n \n <div class="tags-display"></div>\n\n \n <div class="annotation-display">\n <label class="prompt">';f={hash:{},inverse:q.noop,fn:q.program(15,w,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='</label>\n <div class="annotation" title="';f={hash:{},inverse:q.noop,fn:q.program(17,v,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='"\n \n >';j=r["if"].call(t,t.annotation,{hash:{},inverse:q.noop,fn:q.program(19,u,z),data:z});if(j||j===0){s+=j}s+='</div>\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:q.noop,fn:q.program(21,i,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+="\n </div>";return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(k,w,u,p,C){this.compilerInfo=[4,">= 1.0.0"];u=this.merge(u,k.helpers);C=C||{};var v="",m,g,t=this,e="function",c=u.blockHelperMissing,d=this.escapeExpression;function s(H,G){var D="",F,E;D+='\n <div class="history-name" title="';E={hash:{},inverse:t.noop,fn:t.program(2,r,G),data:G};if(F=u.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!u.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+='">\n ';if(F=u.name){F=F.call(H,{hash:{},data:G})}else{F=H.name;F=typeof F===e?F.apply(H):F}D+=d(F)+"\n </div>\n ";return D}function r(E,D){return"Click to rename history"}function q(G,F){var D="",E;D+='\n <div class="history-size">';if(E=u.nice_size){E=E.call(G,{hash:{},data:F})}else{E=G.nice_size;E=typeof E===e?E.apply(G):E}D+=d(E)+"</div>\n ";return D}function o(H,G){var D="",F,E;D+='\n <div class="warningmessagesmall"><strong>\n ';E={hash:{},inverse:t.noop,fn:t.program(7,n,G),data:G};if(F=u.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!u.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="\n </strong></div>\n ";return D}function n(E,D){return"You are currently viewing a deleted history!"}function j(G,F){var D="",E;D+='\n \n <div class="';if(E=u.status){E=E.call(G,{hash:{},data:F})}else{E=G.status;E=typeof E===e?E.apply(G):E}D+=d(E)+'message">';if(E=u.message){E=E.call(G,{hash:{},data:F})}else{E=G.message;E=typeof E===e?E.apply(G):E}D+=d(E)+"</div>\n ";return D}function B(E,D){return"You are over your disk quota"}function A(E,D){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function z(E,D){return"Tags"}function y(E,D){return"Annotation"}function x(E,D){return"Click to edit annotation"}function l(G,F){var D="",E;D+="\n ";if(E=u.annotation){E=E.call(G,{hash:{},data:F})}else{E=G.annotation;E=typeof E===e?E.apply(G):E}D+=d(E)+"\n ";return D}function i(H,G){var D="",F,E;D+="\n <em>";E={hash:{},inverse:t.noop,fn:t.program(24,h,G),data:G};if(F=u.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!u.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="</em>\n ";return D}function h(E,D){return"Describe or add notes to history"}function f(E,D){return"Your history is empty. Click 'Get Data' on the left pane to start"}v+='<div class="history-controls">\n\n <div class="history-title">\n ';m=u["if"].call(w,w.name,{hash:{},inverse:t.noop,fn:t.program(1,s,C),data:C});if(m||m===0){v+=m}v+='\n </div>\n\n <div class="history-subtitle clear">\n ';m=u["if"].call(w,w.nice_size,{hash:{},inverse:t.noop,fn:t.program(4,q,C),data:C});if(m||m===0){v+=m}v+='\n\n <div class="history-secondary-actions">\n </div>\n </div>\n\n ';m=u["if"].call(w,w.deleted,{hash:{},inverse:t.noop,fn:t.program(6,o,C),data:C});if(m||m===0){v+=m}v+='\n\n <div class="message-container">\n ';m=u["if"].call(w,w.message,{hash:{},inverse:t.noop,fn:t.program(9,j,C),data:C});if(m||m===0){v+=m}v+='\n </div>\n\n <div class="quota-message errormessage">\n ';g={hash:{},inverse:t.noop,fn:t.program(11,B,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+=".\n ";g={hash:{},inverse:t.noop,fn:t.program(13,A,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+='.\n </div>\n \n \n \n <div class="tags-display">\n <label class="prompt">';g={hash:{},inverse:t.noop,fn:t.program(15,z,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+='</label>\n <div class="tags"></div>\n </div>\n\n \n <div class="annotation-display">\n <label class="prompt">';g={hash:{},inverse:t.noop,fn:t.program(17,y,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+='</label>\n <div class="annotation" title="';g={hash:{},inverse:t.noop,fn:t.program(19,x,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+='">\n ';m=u["if"].call(w,w.annotation,{hash:{},inverse:t.program(23,i,C),fn:t.program(21,l,C),data:C});if(m||m===0){v+=m}v+='\n </div>\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';g={hash:{},inverse:t.noop,fn:t.program(26,f,C),data:C};if(m=u.local){m=m.call(w,g)}else{m=w.local;m=typeof m===e?m.apply(w):m}if(!u.local){m=c.call(w,m,g)}if(m||m===0){v+=m}v+="\n </div>";return v})})();
\ No newline at end of file
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(g,r,p,k,z){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);z=z||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';if(B=p.body){B=B.call(D,{hash:{},data:C})}else{B=D.body;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return A}function m(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';B=p["if"].call(D,D.misc_blurb,{hash:{},inverse:o.noop,fn:o.program(4,l,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.data_type,{hash:{},inverse:o.noop,fn:o.program(6,j,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.metadata_dbkey,{hash:{},inverse:o.noop,fn:o.program(9,f,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.misc_info,{hash:{},inverse:o.noop,fn:o.program(12,x,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';B=p.unless.call(D,D.deleted,{hash:{},inverse:o.noop,fn:o.program(14,w,C),data:C});if(B||B===0){A+=B}A+="\n\n ";return A}function l(D,C){var A="",B;A+='\n <div class="dataset-blurb">\n <span class="value">';if(B=p.misc_blurb){B=B.call(D,{hash:{},data:C})}else{B=D.misc_blurb;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function j(E,D){var A="",C,B;A+='\n <div class="dataset-datatype">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(7,i,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">';if(C=p.data_type){C=C.call(E,{hash:{},data:D})}else{C=E.data_type;C=typeof C===e?C.apply(E):C}A+=d(C)+"</span>\n </div>\n ";return A}function i(B,A){return"format"}function f(E,D){var A="",C,B;A+='\n <div class="dataset-dbkey">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(10,y,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">\n ';if(C=p.metadata_dbkey){C=C.call(E,{hash:{},data:D})}else{C=E.metadata_dbkey;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </span>\n </div>\n ";return A}function y(B,A){return"database"}function x(D,C){var A="",B;A+='\n <div class="dataset-info">\n <span class="value">';if(B=p.misc_info){B=B.call(D,{hash:{},data:C})}else{B=D.misc_info;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function w(D,C){var A="",B;A+='\n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="dataset-display-applications">\n ';B=p.each.call(D,D.display_apps,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p.each.call(D,D.display_types,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-peek">\n ';B=p["if"].call(D,D.peek,{hash:{},inverse:o.noop,fn:o.program(19,s,C),data:C});if(B||B===0){A+=B}A+="\n </div>\n\n ";return A}function v(D,C){var A="",B;A+='\n <div class="display-application">\n <span class="display-application-location">';if(B=p.label){B=B.call(D,{hash:{},data:C})}else{B=D.label;B=typeof B===e?B.apply(D):B}A+=d(B)+'</span>\n <span class="display-application-links">\n ';B=p.each.call(D,D.links,{hash:{},inverse:o.noop,fn:o.program(16,u,C),data:C});if(B||B===0){A+=B}A+="\n </span>\n </div>\n ";return A}function u(E,D){var A="",C,B;A+='\n <a target="';if(C=p.target){C=C.call(E,{hash:{},data:D})}else{C=E.target;C=typeof C===e?C.apply(E):C}A+=d(C)+'" href="';if(C=p.href){C=C.call(E,{hash:{},data:D})}else{C=E.href;C=typeof C===e?C.apply(E):C}A+=d(C)+'">';B={hash:{},inverse:o.noop,fn:o.program(17,t,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="</a>\n ";return A}function t(C,B){var A;if(A=p.text){A=A.call(C,{hash:{},data:B})}else{A=C.text;A=typeof A===e?A.apply(C):A}return d(A)}function s(D,C){var A="",B;A+='\n <pre class="peek">';if(B=p.peek){B=B.call(D,{hash:{},data:C})}else{B=D.peek;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+="</pre>\n ";return A}q+='<div class="dataset-body">\n ';h=p["if"].call(r,r.body,{hash:{},inverse:o.program(3,m,z),fn:o.program(1,n,z),data:z});if(h||h===0){q+=h}q+="\n</div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-skeleton"]=b(function(f,r,p,k,w){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,f.helpers);w=w||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(B,A){var x="",z,y;x+='\n <div class="errormessagesmall">\n ';y={hash:{},inverse:o.noop,fn:o.program(2,m,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+=":\n ";y={hash:{},inverse:o.noop,fn:o.program(4,l,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </div>\n ";return x}function m(y,x){return"There was an error getting the data for this dataset"}function l(z,y){var x;if(x=p.error){x=x.call(z,{hash:{},data:y})}else{x=z.error;x=typeof x===e?x.apply(z):x}return d(x)}function j(A,z){var x="",y;x+="\n ";y=p["if"].call(A,A.purged,{hash:{},inverse:o.program(10,v,z),fn:o.program(7,i,z),data:z});if(y||y===0){x+=y}x+="\n ";return x}function i(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(8,g,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n\n ";return x}function g(y,x){return"This dataset has been deleted and removed from disk."}function v(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(11,u,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n \n Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it\n or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk\n </strong></div>\n ';return x}function u(y,x){return"This dataset has been deleted."}function t(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(14,s,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it\n </strong></div>\n ';return x}function s(y,x){return"This dataset has been hidden."}q+='<div class="dataset hda">\n <div class="dataset-warnings">\n ';h=p["if"].call(r,r.error,{hash:{},inverse:o.noop,fn:o.program(1,n,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p["if"].call(r,r.deleted,{hash:{},inverse:o.noop,fn:o.program(6,j,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p.unless.call(r,r.visible,{hash:{},inverse:o.noop,fn:o.program(13,t,w),data:w});if(h||h===0){q+=h}q+='\n </div>\n\n <div class="dataset-primary-actions"></div>\n <div class="dataset-title-bar clear">\n <span class="dataset-state-icon state-icon"></span>\n <div class="dataset-title">\n <span class="hda-hid">';if(h=p.hid){h=h.call(r,{hash:{},data:w})}else{h=r.hid;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n <span class="dataset-name">';if(h=p.name){h=h.call(r,{hash:{},data:w})}else{h=r.name;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n </div>\n </div>\n\n <div class="dataset-body"></div>\n</div>';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel-anon"]=b(function(g,r,p,k,u){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);u=u||{};var q="",i,f,o=this,e="function",c=p.blockHelperMissing,d=this.escapeExpression;function n(z,y){var v="",x,w;v+='\n <div class="history-name" title="';w={hash:{},inverse:o.noop,fn:o.program(2,m,y),data:y};if(x=p.local){x=x.call(z,w)}else{x=z.local;x=typeof x===e?x.apply(z):x}if(!p.local){x=c.call(z,x,w)}if(x||x===0){v+=x}v+='">\n ';if(x=p.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===e?x.apply(z):x}v+=d(x)+"\n </div>\n ";return v}function m(w,v){return"You must be logged in to edit your history name"}function l(y,x){var v="",w;v+='\n <div class="history-size">';if(w=p.nice_size){w=w.call(y,{hash:{},data:x})}else{w=y.nice_size;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function j(y,x){var v="",w;v+='\n \n <div class="';if(w=p.status){w=w.call(y,{hash:{},data:x})}else{w=y.status;w=typeof w===e?w.apply(y):w}v+=d(w)+'message">';if(w=p.message){w=w.call(y,{hash:{},data:x})}else{w=y.message;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function h(w,v){return"You are over your disk quota"}function t(w,v){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function s(w,v){return"Your history is empty. Click 'Get Data' on the left pane to start"}q+='<div class="history-controls">\n\n <div class="history-title">\n \n ';i=p["if"].call(r,r.name,{hash:{},inverse:o.noop,fn:o.program(1,n,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=p["if"].call(r,r.nice_size,{hash:{},inverse:o.noop,fn:o.program(4,l,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="message-container">\n ';i=p["if"].call(r,r.message,{hash:{},inverse:o.noop,fn:o.program(6,j,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:o.noop,fn:o.program(8,h,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+=".\n ";f={hash:{},inverse:o.noop,fn:o.program(10,t,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+='.\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:o.noop,fn:o.program(12,s,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+="\n </div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,w){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);w=w||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(B,A){var x="",z,y;x+='\n <div class="history-name" title="';y={hash:{},inverse:p.noop,fn:p.program(2,n,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='">\n ';if(z=q.name){z=z.call(B,{hash:{},data:A})}else{z=B.name;z=typeof z===e?z.apply(B):z}x+=d(z)+"\n </div>\n ";return x}function n(y,x){return"Click to rename history"}function m(A,z){var x="",y;x+='\n <div class="history-size">';if(y=q.nice_size){y=y.call(A,{hash:{},data:z})}else{y=A.nice_size;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function k(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:p.noop,fn:p.program(7,j,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n ";return x}function j(y,x){return"You are currently viewing a deleted history!"}function g(A,z){var x="",y;x+='\n \n <div class="';if(y=q.status){y=y.call(A,{hash:{},data:z})}else{y=A.status;y=typeof y===e?y.apply(A):y}x+=d(y)+'message">';if(y=q.message){y=y.call(A,{hash:{},data:z})}else{y=A.message;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function v(y,x){return"You are over your disk quota"}function u(y,x){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function t(y,x){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions">\n </div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,v,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,u,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(15,t,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})();
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/templates/compiled/template-hda-body.js
--- a/static/scripts/packed/templates/compiled/template-hda-body.js
+++ b/static/scripts/packed/templates/compiled/template-hda-body.js
@@ -1,1 +1,1 @@
-(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(h,u,s,n,B){this.compilerInfo=[4,">= 1.0.0"];s=this.merge(s,h.helpers);B=B||{};var t="",j,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(F,E){var C="",D;C+='\n <div class="dataset-summary">\n ';if(D=s.body){D=D.call(F,{hash:{},data:E})}else{D=F.body;D=typeof D===e?D.apply(F):D}if(D||D===0){C+=D}C+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return C}function p(F,E){var C="",D;C+='\n <div class="dataset-summary">\n ';D=s["if"].call(F,F.misc_blurb,{hash:{},inverse:r.noop,fn:r.program(4,o,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.data_type,{hash:{},inverse:r.noop,fn:r.program(6,m,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.metadata_dbkey,{hash:{},inverse:r.noop,fn:r.program(9,g,E),data:E});if(D||D===0){C+=D}C+="\n\n ";D=s["if"].call(F,F.misc_info,{hash:{},inverse:r.noop,fn:r.program(12,z,E),data:E});if(D||D===0){C+=D}C+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';D=s.unless.call(F,F.deleted,{hash:{},inverse:r.noop,fn:r.program(14,y,E),data:E});if(D||D===0){C+=D}C+="\n\n ";return C}function o(F,E){var C="",D;C+='\n <div class="dataset-blurb">\n <span class="value">';if(D=s.misc_blurb){D=D.call(F,{hash:{},data:E})}else{D=F.misc_blurb;D=typeof D===e?D.apply(F):D}C+=d(D)+"</span>\n </div>\n ";return C}function m(G,F){var C="",E,D;C+='\n <div class="dataset-datatype">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(7,l,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <span class="value">';if(E=s.data_type){E=E.call(G,{hash:{},data:F})}else{E=G.data_type;E=typeof E===e?E.apply(G):E}C+=d(E)+"</span>\n </div>\n ";return C}function l(D,C){return"format"}function g(G,F){var C="",E,D;C+='\n <div class="dataset-dbkey">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(10,A,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <span class="value">\n ';if(E=s.metadata_dbkey){E=E.call(G,{hash:{},data:F})}else{E=G.metadata_dbkey;E=typeof E===e?E.apply(G):E}C+=d(E)+"\n </span>\n </div>\n ";return C}function A(D,C){return"database"}function z(F,E){var C="",D;C+='\n <div class="dataset-info">\n <span class="value">';if(D=s.misc_info){D=D.call(F,{hash:{},data:E})}else{D=F.misc_info;D=typeof D===e?D.apply(F):D}C+=d(D)+"</span>\n </div>\n ";return C}function y(G,F){var C="",E,D;C+='\n \n <div class="tags-display"></div>\n\n \n <div class="annotation-display">\n <label class="prompt">';D={hash:{},inverse:r.noop,fn:r.program(15,x,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='</label>\n <div id="dataset-';if(E=s.id){E=E.call(G,{hash:{},data:F})}else{E=G.id;E=typeof E===e?E.apply(G):E}C+=d(E)+'-annotation" class="annotation editable-text"\n title="';D={hash:{},inverse:r.noop,fn:r.program(17,w,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+='"></div>\n </div>\n\n <div class="dataset-display-applications">\n ';E=s.each.call(G,G.display_apps,{hash:{},inverse:r.noop,fn:r.program(19,v,F),data:F});if(E||E===0){C+=E}C+="\n\n ";E=s.each.call(G,G.display_types,{hash:{},inverse:r.noop,fn:r.program(19,v,F),data:F});if(E||E===0){C+=E}C+='\n </div>\n\n <div class="dataset-peek">\n ';E=s["if"].call(G,G.peek,{hash:{},inverse:r.noop,fn:r.program(23,f,F),data:F});if(E||E===0){C+=E}C+="\n </div>\n\n ";return C}function x(D,C){return"Annotation"}function w(D,C){return"Edit dataset annotation"}function v(F,E){var C="",D;C+='\n <div class="display-application">\n <span class="display-application-location">';if(D=s.label){D=D.call(F,{hash:{},data:E})}else{D=F.label;D=typeof D===e?D.apply(F):D}C+=d(D)+'</span>\n <span class="display-application-links">\n ';D=s.each.call(F,F.links,{hash:{},inverse:r.noop,fn:r.program(20,k,E),data:E});if(D||D===0){C+=D}C+="\n </span>\n </div>\n ";return C}function k(G,F){var C="",E,D;C+='\n <a target="';if(E=s.target){E=E.call(G,{hash:{},data:F})}else{E=G.target;E=typeof E===e?E.apply(G):E}C+=d(E)+'" href="';if(E=s.href){E=E.call(G,{hash:{},data:F})}else{E=G.href;E=typeof E===e?E.apply(G):E}C+=d(E)+'">';D={hash:{},inverse:r.noop,fn:r.program(21,i,F),data:F};if(E=s.local){E=E.call(G,D)}else{E=G.local;E=typeof E===e?E.apply(G):E}if(!s.local){E=c.call(G,E,D)}if(E||E===0){C+=E}C+="</a>\n ";return C}function i(E,D){var C;if(C=s.text){C=C.call(E,{hash:{},data:D})}else{C=E.text;C=typeof C===e?C.apply(E):C}return d(C)}function f(F,E){var C="",D;C+='\n <pre class="peek">';if(D=s.peek){D=D.call(F,{hash:{},data:E})}else{D=F.peek;D=typeof D===e?D.apply(F):D}if(D||D===0){C+=D}C+="</pre>\n ";return C}t+='<div class="dataset-body">\n ';j=s["if"].call(u,u.body,{hash:{},inverse:r.program(3,p,B),fn:r.program(1,q,B),data:B});if(j||j===0){t+=j}t+="\n</div>";return t})})();
\ No newline at end of file
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(g,r,p,k,z){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);z=z||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';if(B=p.body){B=B.call(D,{hash:{},data:C})}else{B=D.body;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return A}function m(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';B=p["if"].call(D,D.misc_blurb,{hash:{},inverse:o.noop,fn:o.program(4,l,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.data_type,{hash:{},inverse:o.noop,fn:o.program(6,j,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.metadata_dbkey,{hash:{},inverse:o.noop,fn:o.program(9,f,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.misc_info,{hash:{},inverse:o.noop,fn:o.program(12,x,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';B=p.unless.call(D,D.deleted,{hash:{},inverse:o.noop,fn:o.program(14,w,C),data:C});if(B||B===0){A+=B}A+="\n\n ";return A}function l(D,C){var A="",B;A+='\n <div class="dataset-blurb">\n <span class="value">';if(B=p.misc_blurb){B=B.call(D,{hash:{},data:C})}else{B=D.misc_blurb;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function j(E,D){var A="",C,B;A+='\n <div class="dataset-datatype">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(7,i,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">';if(C=p.data_type){C=C.call(E,{hash:{},data:D})}else{C=E.data_type;C=typeof C===e?C.apply(E):C}A+=d(C)+"</span>\n </div>\n ";return A}function i(B,A){return"format"}function f(E,D){var A="",C,B;A+='\n <div class="dataset-dbkey">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(10,y,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">\n ';if(C=p.metadata_dbkey){C=C.call(E,{hash:{},data:D})}else{C=E.metadata_dbkey;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </span>\n </div>\n ";return A}function y(B,A){return"database"}function x(D,C){var A="",B;A+='\n <div class="dataset-info">\n <span class="value">';if(B=p.misc_info){B=B.call(D,{hash:{},data:C})}else{B=D.misc_info;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function w(D,C){var A="",B;A+='\n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="dataset-display-applications">\n ';B=p.each.call(D,D.display_apps,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p.each.call(D,D.display_types,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-peek">\n ';B=p["if"].call(D,D.peek,{hash:{},inverse:o.noop,fn:o.program(19,s,C),data:C});if(B||B===0){A+=B}A+="\n </div>\n\n ";return A}function v(D,C){var A="",B;A+='\n <div class="display-application">\n <span class="display-application-location">';if(B=p.label){B=B.call(D,{hash:{},data:C})}else{B=D.label;B=typeof B===e?B.apply(D):B}A+=d(B)+'</span>\n <span class="display-application-links">\n ';B=p.each.call(D,D.links,{hash:{},inverse:o.noop,fn:o.program(16,u,C),data:C});if(B||B===0){A+=B}A+="\n </span>\n </div>\n ";return A}function u(E,D){var A="",C,B;A+='\n <a target="';if(C=p.target){C=C.call(E,{hash:{},data:D})}else{C=E.target;C=typeof C===e?C.apply(E):C}A+=d(C)+'" href="';if(C=p.href){C=C.call(E,{hash:{},data:D})}else{C=E.href;C=typeof C===e?C.apply(E):C}A+=d(C)+'">';B={hash:{},inverse:o.noop,fn:o.program(17,t,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="</a>\n ";return A}function t(C,B){var A;if(A=p.text){A=A.call(C,{hash:{},data:B})}else{A=C.text;A=typeof A===e?A.apply(C):A}return d(A)}function s(D,C){var A="",B;A+='\n <pre class="peek">';if(B=p.peek){B=B.call(D,{hash:{},data:C})}else{B=D.peek;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+="</pre>\n ";return A}q+='<div class="dataset-body">\n ';h=p["if"].call(r,r.body,{hash:{},inverse:o.program(3,m,z),fn:o.program(1,n,z),data:z});if(h||h===0){q+=h}q+="\n</div>";return q})})();
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/packed/templates/compiled/template-history-historyPanel.js
--- a/static/scripts/packed/templates/compiled/template-history-historyPanel.js
+++ b/static/scripts/packed/templates/compiled/template-history-historyPanel.js
@@ -1,1 +1,1 @@
-(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,t,r,m,z){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);z=z||{};var s="",j,f,q=this,e="function",c=r.blockHelperMissing,d=this.escapeExpression;function p(E,D){var A="",C,B;A+='\n <div class="history-name" title="';B={hash:{},inverse:q.noop,fn:q.program(2,o,D),data:D};if(C=r.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!r.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='">\n ';if(C=r.name){C=C.call(E,{hash:{},data:D})}else{C=E.name;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </div>\n ";return A}function o(B,A){return"Click to rename history"}function n(D,C){var A="",B;A+='\n <div class="history-size">';if(B=r.nice_size){B=B.call(D,{hash:{},data:C})}else{B=D.nice_size;B=typeof B===e?B.apply(D):B}A+=d(B)+"</div>\n ";return A}function l(E,D){var A="",C,B;A+='\n <div class="warningmessagesmall"><strong>\n ';B={hash:{},inverse:q.noop,fn:q.program(7,k,D),data:D};if(C=r.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!r.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="\n </strong></div>\n ";return A}function k(B,A){return"You are currently viewing a deleted history!"}function g(D,C){var A="",B;A+='\n \n <div class="';if(B=r.status){B=B.call(D,{hash:{},data:C})}else{B=D.status;B=typeof B===e?B.apply(D):B}A+=d(B)+'message">';if(B=r.message){B=B.call(D,{hash:{},data:C})}else{B=D.message;B=typeof B===e?B.apply(D):B}A+=d(B)+"</div>\n ";return A}function y(B,A){return"You are over your disk quota"}function x(B,A){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function w(B,A){return"Annotation"}function v(B,A){return"Click to edit annotation"}function u(C,B){var A;if(A=r.annotation){A=A.call(C,{hash:{},data:B})}else{A=C.annotation;A=typeof A===e?A.apply(C):A}return d(A)}function i(B,A){return"Your history is empty. Click 'Get Data' on the left pane to start"}s+='<div class="history-controls">\n\n <div class="history-title">\n ';j=r["if"].call(t,t.name,{hash:{},inverse:q.noop,fn:q.program(1,p,z),data:z});if(j||j===0){s+=j}s+='\n </div>\n\n <div class="history-subtitle clear">\n ';j=r["if"].call(t,t.nice_size,{hash:{},inverse:q.noop,fn:q.program(4,n,z),data:z});if(j||j===0){s+=j}s+='\n\n <div class="history-secondary-actions">\n </div>\n </div>\n\n ';j=r["if"].call(t,t.deleted,{hash:{},inverse:q.noop,fn:q.program(6,l,z),data:z});if(j||j===0){s+=j}s+='\n\n <div class="message-container">\n ';j=r["if"].call(t,t.message,{hash:{},inverse:q.noop,fn:q.program(9,g,z),data:z});if(j||j===0){s+=j}s+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:q.noop,fn:q.program(11,y,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+=".\n ";f={hash:{},inverse:q.noop,fn:q.program(13,x,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='.\n </div>\n \n \n \n <div class="tags-display"></div>\n\n \n <div class="annotation-display">\n <label class="prompt">';f={hash:{},inverse:q.noop,fn:q.program(15,w,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='</label>\n <div class="annotation" title="';f={hash:{},inverse:q.noop,fn:q.program(17,v,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+='"\n \n >';j=r["if"].call(t,t.annotation,{hash:{},inverse:q.noop,fn:q.program(19,u,z),data:z});if(j||j===0){s+=j}s+='</div>\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:q.noop,fn:q.program(21,i,z),data:z};if(j=r.local){j=j.call(t,f)}else{j=t.local;j=typeof j===e?j.apply(t):j}if(!r.local){j=c.call(t,j,f)}if(j||j===0){s+=j}s+="\n </div>";return s})})();
\ No newline at end of file
+(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,w){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);w=w||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(B,A){var x="",z,y;x+='\n <div class="history-name" title="';y={hash:{},inverse:p.noop,fn:p.program(2,n,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='">\n ';if(z=q.name){z=z.call(B,{hash:{},data:A})}else{z=B.name;z=typeof z===e?z.apply(B):z}x+=d(z)+"\n </div>\n ";return x}function n(y,x){return"Click to rename history"}function m(A,z){var x="",y;x+='\n <div class="history-size">';if(y=q.nice_size){y=y.call(A,{hash:{},data:z})}else{y=A.nice_size;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function k(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:p.noop,fn:p.program(7,j,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n ";return x}function j(y,x){return"You are currently viewing a deleted history!"}function g(A,z){var x="",y;x+='\n \n <div class="';if(y=q.status){y=y.call(A,{hash:{},data:z})}else{y=A.status;y=typeof y===e?y.apply(A):y}x+=d(y)+'message">';if(y=q.message){y=y.call(A,{hash:{},data:z})}else{y=A.message;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function v(y,x){return"You are over your disk quota"}function u(y,x){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function t(y,x){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions">\n </div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,v,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,u,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(15,t,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})();
\ No newline at end of file
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/templates/compiled/history-templates.js
--- a/static/scripts/templates/compiled/history-templates.js
+++ b/static/scripts/templates/compiled/history-templates.js
@@ -106,63 +106,33 @@
function program14(depth0,data) {
- var buffer = "", stack1, options;
- buffer += "\n "
- + "\n <div class=\"tags-display\"></div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div id=\"dataset-";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "-annotation\" class=\"annotation editable-text\"\n title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\"></div>\n </div>\n\n <div class=\"dataset-display-applications\">\n ";
- stack1 = helpers.each.call(depth0, depth0.display_apps, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
+ var buffer = "", stack1;
+ buffer += "\n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n <div class=\"dataset-display-applications\">\n ";
+ stack1 = helpers.each.call(depth0, depth0.display_apps, {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n\n ";
- stack1 = helpers.each.call(depth0, depth0.display_types, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
+ stack1 = helpers.each.call(depth0, depth0.display_types, {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </div>\n\n <div class=\"dataset-peek\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.peek, {hash:{},inverse:self.noop,fn:self.program(23, program23, data),data:data});
+ stack1 = helpers['if'].call(depth0, depth0.peek, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </div>\n\n ";
return buffer;
}
function program15(depth0,data) {
-
- return "Annotation";
- }
-
-function program17(depth0,data) {
-
-
- return "Edit dataset annotation";
- }
-
-function program19(depth0,data) {
-
var buffer = "", stack1;
buffer += "\n <div class=\"display-application\">\n <span class=\"display-application-location\">";
if (stack1 = helpers.label) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.label; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</span>\n <span class=\"display-application-links\">\n ";
- stack1 = helpers.each.call(depth0, depth0.links, {hash:{},inverse:self.noop,fn:self.program(20, program20, data),data:data});
+ stack1 = helpers.each.call(depth0, depth0.links, {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </span>\n </div>\n ";
return buffer;
}
-function program20(depth0,data) {
+function program16(depth0,data) {
var buffer = "", stack1, options;
buffer += "\n <a target=\"";
@@ -174,7 +144,7 @@
else { stack1 = depth0.href; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "\">";
- options = {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data};
+ options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
@@ -182,7 +152,7 @@
buffer += "</a>\n ";
return buffer;
}
-function program21(depth0,data) {
+function program17(depth0,data) {
var stack1;
if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
@@ -190,7 +160,7 @@
return escapeExpression(stack1);
}
-function program23(depth0,data) {
+function program19(depth0,data) {
var buffer = "", stack1;
buffer += "\n <pre class=\"peek\">";
@@ -209,352 +179,6 @@
});
})();(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['template-hda-body'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
-
-function program1(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"dataset-summary\">\n ";
- if (stack1 = helpers.body) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.body; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n <div class=\"dataset-actions clear\">\n <div class=\"left\"></div>\n <div class=\"right\"></div>\n </div>\n\n ";
- return buffer;
- }
-
-function program3(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"dataset-summary\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.misc_blurb, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers['if'].call(depth0, depth0.data_type, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers['if'].call(depth0, depth0.metadata_dbkey, {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers['if'].call(depth0, depth0.misc_info, {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>"
- + "\n\n <div class=\"dataset-actions clear\">\n <div class=\"left\"></div>\n <div class=\"right\"></div>\n </div>\n\n ";
- stack1 = helpers.unless.call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- return buffer;
- }
-function program4(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"dataset-blurb\">\n <span class=\"value\">";
- if (stack1 = helpers.misc_blurb) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.misc_blurb; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n </div>\n ";
- return buffer;
- }
-
-function program6(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"dataset-datatype\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <span class=\"value\">";
- if (stack1 = helpers.data_type) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.data_type; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n </div>\n ";
- return buffer;
- }
-function program7(depth0,data) {
-
-
- return "format";
- }
-
-function program9(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"dataset-dbkey\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(10, program10, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <span class=\"value\">\n ";
- if (stack1 = helpers.metadata_dbkey) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.metadata_dbkey; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\n </span>\n </div>\n ";
- return buffer;
- }
-function program10(depth0,data) {
-
-
- return "database";
- }
-
-function program12(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"dataset-info\">\n <span class=\"value\">";
- if (stack1 = helpers.misc_info) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.misc_info; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n </div>\n ";
- return buffer;
- }
-
-function program14(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n "
- + "\n <div class=\"tags-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div class=\"tags\"></div>\n </div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div id=\"dataset-";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "-annotation\" class=\"annotation editable-text\"\n title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\"></div>\n </div>\n\n <div class=\"dataset-display-applications\">\n ";
- stack1 = helpers.each.call(depth0, depth0.display_apps, {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers.each.call(depth0, depth0.display_types, {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n\n <div class=\"dataset-peek\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.peek, {hash:{},inverse:self.noop,fn:self.program(25, program25, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n\n ";
- return buffer;
- }
-function program15(depth0,data) {
-
-
- return "Tags";
- }
-
-function program17(depth0,data) {
-
-
- return "Annotation";
- }
-
-function program19(depth0,data) {
-
-
- return "Edit dataset annotation";
- }
-
-function program21(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"display-application\">\n <span class=\"display-application-location\">";
- if (stack1 = helpers.label) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.label; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n <span class=\"display-application-links\">\n ";
- stack1 = helpers.each.call(depth0, depth0.links, {hash:{},inverse:self.noop,fn:self.program(22, program22, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </span>\n </div>\n ";
- return buffer;
- }
-function program22(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <a target=\"";
- if (stack1 = helpers.target) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.target; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\" href=\"";
- if (stack1 = helpers.href) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.href; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\">";
- options = {hash:{},inverse:self.noop,fn:self.program(23, program23, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</a>\n ";
- return buffer;
- }
-function program23(depth0,data) {
-
- var stack1;
- if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.text; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- return escapeExpression(stack1);
- }
-
-function program25(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <pre class=\"peek\">";
- if (stack1 = helpers.peek) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.peek; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</pre>\n ";
- return buffer;
- }
-
- buffer += "<div class=\"dataset-body\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.body, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n</div>";
- return buffer;
- });
-})();(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['template-hda-skeleton'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
-
-function program1(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"errormessagesmall\">\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += ":\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n ";
- return buffer;
- }
-function program2(depth0,data) {
-
-
- return "There was an error getting the data for this dataset";
- }
-
-function program4(depth0,data) {
-
- var stack1;
- if (stack1 = helpers.error) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.error; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- return escapeExpression(stack1);
- }
-
-function program6(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n ";
- stack1 = helpers['if'].call(depth0, depth0.purged, {hash:{},inverse:self.program(10, program10, data),fn:self.program(7, program7, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n ";
- return buffer;
- }
-function program7(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"warningmessagesmall\"><strong>\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </strong></div>\n\n ";
- return buffer;
- }
-function program8(depth0,data) {
-
-
- return "This dataset has been deleted and removed from disk.";
- }
-
-function program10(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"warningmessagesmall\"><strong>\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n "
- + "\n "
- + "\n Click <a href=\"javascript:void(0);\" class=\"dataset-undelete\">here</a> to undelete it\n or <a href=\"javascript:void(0);\" class=\"dataset-purge\">here</a> to immediately remove it from disk\n </strong></div>\n ";
- return buffer;
- }
-function program11(depth0,data) {
-
-
- return "This dataset has been deleted.";
- }
-
-function program13(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"warningmessagesmall\"><strong>\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n "
- + "\n Click <a href=\"javascript:void(0);\" class=\"dataset-unhide\">here</a> to unhide it\n </strong></div>\n ";
- return buffer;
- }
-function program14(depth0,data) {
-
-
- return "This dataset has been hidden.";
- }
-
- buffer += "<div class=\"dataset hda\">\n <div class=\"dataset-warnings\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.error, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n ";
- stack1 = helpers.unless.call(depth0, depth0.visible, {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n\n <div class=\"dataset-primary-actions\"></div>\n <div class=\"dataset-title-bar clear\">\n <span class=\"dataset-state-icon state-icon\"></span>\n <div class=\"dataset-title\">\n <span class=\"hda-hid\">";
- if (stack1 = helpers.hid) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.hid; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n <span class=\"dataset-name\">";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span>\n </div>\n </div>\n\n <div class=\"dataset-body\"></div>\n</div>";
- return buffer;
- });
-})();(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['template-hda-skeleton'] = template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
@@ -874,26 +498,6 @@
function program15(depth0,data) {
- return "Annotation";
- }
-
-function program17(depth0,data) {
-
-
- return "Click to edit annotation";
- }
-
-function program19(depth0,data) {
-
- var stack1;
- if (stack1 = helpers.annotation) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.annotation; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- return escapeExpression(stack1);
- }
-
-function program21(depth0,data) {
-
-
return "Your history is empty. Click 'Get Data' on the left pane to start";
}
@@ -921,231 +525,14 @@
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += ".\n </div>\n \n "
- + "\n "
- + "\n <div class=\"tags-display\"></div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div class=\"annotation\" title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\"\n "
- + "\n >";
- stack1 = helpers['if'].call(depth0, depth0.annotation, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</div>\n </div>\n\n </div>"
+ buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n </div>"
+ "\n\n "
+ "\n <div class=\"datasets-list\"></div>\n\n <div class=\"empty-history-message infomessagesmall\">\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>";
- return buffer;
- });
-})();(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['template-history-historyPanel'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, options, self=this, functionType="function", blockHelperMissing=helpers.blockHelperMissing, escapeExpression=this.escapeExpression;
-
-function program1(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"history-name\" title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\">\n ";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\n </div>\n ";
- return buffer;
- }
-function program2(depth0,data) {
-
-
- return "Click to rename history";
- }
-
-function program4(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"history-size\">";
- if (stack1 = helpers.nice_size) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.nice_size; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</div>\n ";
- return buffer;
- }
-
-function program6(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <div class=\"warningmessagesmall\"><strong>\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </strong></div>\n ";
- return buffer;
- }
-function program7(depth0,data) {
-
-
- return "You are currently viewing a deleted history!";
- }
-
-function program9(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n "
- + "\n <div class=\"";
- if (stack1 = helpers.status) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.status; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "message\">";
- if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</div>\n ";
- return buffer;
- }
-
-function program11(depth0,data) {
-
-
- return "You are over your disk quota";
- }
-
-function program13(depth0,data) {
-
-
- return "Tool execution is on hold until your disk usage drops below your allocated quota";
- }
-
-function program15(depth0,data) {
-
-
- return "Tags";
- }
-
-function program17(depth0,data) {
-
-
- return "Annotation";
- }
-
-function program19(depth0,data) {
-
-
- return "Click to edit annotation";
- }
-
-function program21(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n ";
- if (stack1 = helpers.annotation) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.annotation; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\n ";
- return buffer;
- }
-
-function program23(depth0,data) {
-
- var buffer = "", stack1, options;
- buffer += "\n <em>";
- options = {hash:{},inverse:self.noop,fn:self.program(24, program24, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</em>\n ";
- return buffer;
- }
-function program24(depth0,data) {
-
-
- return "Describe or add notes to history";
- }
-
-function program26(depth0,data) {
-
-
- return "Your history is empty. Click 'Get Data' on the left pane to start";
- }
-
- buffer += "<div class=\"history-controls\">\n\n <div class=\"history-title\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.name, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n\n <div class=\"history-subtitle clear\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.nice_size, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n <div class=\"history-secondary-actions\">\n </div>\n </div>\n\n ";
- stack1 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n\n <div class=\"message-container\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.message, {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n\n <div class=\"quota-message errormessage\">\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += ".\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += ".\n </div>\n \n "
- + "\n "
- + "\n <div class=\"tags-display\">\n <label class=\"prompt\">";
options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div class=\"tags\"></div>\n </div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div class=\"annotation\" title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.annotation, {hash:{},inverse:self.program(23, program23, data),fn:self.program(21, program21, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n </div>\n\n </div>"
- + "\n\n "
- + "\n <div class=\"datasets-list\"></div>\n\n <div class=\"empty-history-message infomessagesmall\">\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </div>";
return buffer;
});
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/templates/compiled/template-hda-body.js
--- a/static/scripts/templates/compiled/template-hda-body.js
+++ b/static/scripts/templates/compiled/template-hda-body.js
@@ -106,63 +106,33 @@
function program14(depth0,data) {
- var buffer = "", stack1, options;
- buffer += "\n "
- + "\n <div class=\"tags-display\"></div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div id=\"dataset-";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "-annotation\" class=\"annotation editable-text\"\n title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\"></div>\n </div>\n\n <div class=\"dataset-display-applications\">\n ";
- stack1 = helpers.each.call(depth0, depth0.display_apps, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
+ var buffer = "", stack1;
+ buffer += "\n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n <div class=\"dataset-display-applications\">\n ";
+ stack1 = helpers.each.call(depth0, depth0.display_apps, {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n\n ";
- stack1 = helpers.each.call(depth0, depth0.display_types, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
+ stack1 = helpers.each.call(depth0, depth0.display_types, {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </div>\n\n <div class=\"dataset-peek\">\n ";
- stack1 = helpers['if'].call(depth0, depth0.peek, {hash:{},inverse:self.noop,fn:self.program(23, program23, data),data:data});
+ stack1 = helpers['if'].call(depth0, depth0.peek, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </div>\n\n ";
return buffer;
}
function program15(depth0,data) {
-
- return "Annotation";
- }
-
-function program17(depth0,data) {
-
-
- return "Edit dataset annotation";
- }
-
-function program19(depth0,data) {
-
var buffer = "", stack1;
buffer += "\n <div class=\"display-application\">\n <span class=\"display-application-location\">";
if (stack1 = helpers.label) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.label; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</span>\n <span class=\"display-application-links\">\n ";
- stack1 = helpers.each.call(depth0, depth0.links, {hash:{},inverse:self.noop,fn:self.program(20, program20, data),data:data});
+ stack1 = helpers.each.call(depth0, depth0.links, {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </span>\n </div>\n ";
return buffer;
}
-function program20(depth0,data) {
+function program16(depth0,data) {
var buffer = "", stack1, options;
buffer += "\n <a target=\"";
@@ -174,7 +144,7 @@
else { stack1 = depth0.href; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "\">";
- options = {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data};
+ options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
@@ -182,7 +152,7 @@
buffer += "</a>\n ";
return buffer;
}
-function program21(depth0,data) {
+function program17(depth0,data) {
var stack1;
if (stack1 = helpers.text) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
@@ -190,7 +160,7 @@
return escapeExpression(stack1);
}
-function program23(depth0,data) {
+function program19(depth0,data) {
var buffer = "", stack1;
buffer += "\n <pre class=\"peek\">";
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/templates/compiled/template-history-historyPanel.js
--- a/static/scripts/templates/compiled/template-history-historyPanel.js
+++ b/static/scripts/templates/compiled/template-history-historyPanel.js
@@ -87,26 +87,6 @@
function program15(depth0,data) {
- return "Annotation";
- }
-
-function program17(depth0,data) {
-
-
- return "Click to edit annotation";
- }
-
-function program19(depth0,data) {
-
- var stack1;
- if (stack1 = helpers.annotation) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.annotation; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- return escapeExpression(stack1);
- }
-
-function program21(depth0,data) {
-
-
return "Your history is empty. Click 'Get Data' on the left pane to start";
}
@@ -134,29 +114,10 @@
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += ".\n </div>\n \n "
- + "\n "
- + "\n <div class=\"tags-display\"></div>\n\n "
- + "\n <div class=\"annotation-display\">\n <label class=\"prompt\">";
- options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</label>\n <div class=\"annotation\" title=\"";
- options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data};
- if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
- else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\"\n "
- + "\n >";
- stack1 = helpers['if'].call(depth0, depth0.annotation, {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</div>\n </div>\n\n </div>"
+ buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n </div>"
+ "\n\n "
+ "\n <div class=\"datasets-list\"></div>\n\n <div class=\"empty-history-message infomessagesmall\">\n ";
- options = {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data};
+ options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data};
if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/templates/hda-templates.html
--- a/static/scripts/templates/hda-templates.html
+++ b/static/scripts/templates/hda-templates.html
@@ -97,15 +97,8 @@
</div>
{{#unless deleted }}
- {{! TODO: move to mvc/tag.js }}
<div class="tags-display"></div>
-
- {{! TODO: move to mvc/annotations.js }}
- <div class="annotation-display">
- <label class="prompt">{{#local}}Annotation{{/local}}</label>
- <div id="dataset-{{ id }}-annotation" class="annotation editable-text"
- title="{{#local}}Edit dataset annotation{{/local}}"></div>
- </div>
+ <div class="annotation-display"></div><div class="dataset-display-applications">
{{#each display_apps}}
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/scripts/templates/history-templates.html
--- a/static/scripts/templates/history-templates.html
+++ b/static/scripts/templates/history-templates.html
@@ -38,17 +38,8 @@
{{#local}}Tool execution is on hold until your disk usage drops below your allocated quota{{/local}}.
</div>
- {{! tags and annotations }}
- {{! TODO: move to mvc/tag.js }}
<div class="tags-display"></div>
-
- {{! TODO: move to mvc/annotations.js }}
- <div class="annotation-display">
- <label class="prompt">{{#local}}Annotation{{/local}}</label>
- <div class="annotation" title="{{#local}}Click to edit annotation{{/local}}"
- {{! need to elimate the whitespace in this }}
- >{{#if annotation}}{{annotation}}{{/if}}</div>
- </div>
+ <div class="annotation-display"></div></div>{{! end history-controls }}
diff -r 9493825685ee557c4a33b37614b22c4c21463219 -r 59970693121175aacf9d9ca75f012104d7e5db08 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1517,7 +1517,7 @@
.history-panel .message-container [class$=message]{margin:0px}
.history-panel .history-controls{margin:10px;padding:0px}.history-panel .history-controls .history-title{margin-bottom:4px}
.history-panel .history-controls .history-name{word-wrap:break-word;font-weight:bold}
-.history-panel .history-controls .history-title input{font-weight:bold;margin:-2px 0 -2px -4px}
+.history-panel .history-controls .history-title input{font-weight:bold;width:100%;margin:-2px 0 -2px -4px}
.history-panel .history-controls .history-subtitle{margin-bottom:8px}
.history-panel .history-controls .history-size{float:left}
.history-panel .history-controls .history-secondary-actions{float:right}.history-panel .history-controls .history-secondary-actions .icon-btn{margin-left:2px}
@@ -1526,7 +1526,9 @@
.history-panel .history-controls .tags-display label:after,.history-panel .history-controls .annotation-display label:after{content:':'}
.history-panel .history-controls .tags-display .select2-container{min-width:0px}.history-panel .history-controls .tags-display .select2-container .select2-choices{border-radius:3px}
.history-panel .history-controls .tags-display input{border-radius:3px}
-.history-panel .history-controls .annotation-display .annotation{border-radius:3px;border:1px solid fadout(#999, 50%);padding:4px;white-space:pre-line}
+.history-panel .history-controls .annotation-display .annotation{border-radius:3px;border:1px solid rgba(153,153,153,0.5);padding:4px;white-space:pre-line}
+.history-panel .history-controls .annotation-display .annotation:empty{height:20px}
+.history-panel .history-controls .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'}
.history-panel .history-controls .annotation-display textarea{margin:0px 0px 2px 0px;display:block;border-radius:3px;width:100%}
.history-panel .dataset{border-width:1px 0px 0px 0px}
.history-panel .dataset:last-child{border-width:1px 0px 1px 0px}
@@ -1536,6 +1538,7 @@
.dataset .info-section{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}
.dataset .dataset-padding{padding:6px 10px 6px 8px}
.dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%}
+.dataset .help-text{font-weight:normal;font-style:italic;font-size:90%;color:#555}
.dataset .dataset-title-bar{cursor:pointer;padding:6px 10px 6px 8px}
.dataset .dataset-title-bar .dataset-title{display:inline;font-weight:bold;text-decoration:underline;word-break:normal;line-height:16px}
.dataset .dataset-primary-actions{float:right;margin:6px 10px 0}.dataset .dataset-primary-actions .icon-btn{margin-left:2px}
@@ -1545,15 +1548,18 @@
.dataset .dataset-body .prompt:after{content:':'}
.dataset .dataset-body .dataset-summary{margin-bottom:8px}.dataset .dataset-body .dataset-summary .dataset-blurb{margin-bottom:2px}
.dataset .dataset-body .dataset-summary .dataset-datatype,.dataset .dataset-body .dataset-summary .dataset-dbkey{display:inline}.dataset .dataset-body .dataset-summary .dataset-datatype .value,.dataset .dataset-body .dataset-summary .dataset-dbkey .value{font-weight:bold}
-.dataset .dataset-body .dataset-summary .dataset-datatype .value:after{content:','}
+.dataset .dataset-body .dataset-summary .dataset-datatype .value:after{content:',';font-weight:normal;font-style:italic;font-size:90%;color:#555}
.dataset .dataset-body .dataset-summary .dataset-dbkey:after{content:' ';display:block;margin-bottom:8px}
.dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}.dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
+.dataset .dataset-body .dataset-summary .job-error-text{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto;white-space:pre}
.dataset .dataset-body .dataset-actions .left{float:left}.dataset .dataset-body .dataset-actions .left .icon-btn{margin-right:2px}
.dataset .dataset-body .dataset-actions .left .icon-btn-group{margin-right:2px}.dataset .dataset-body .dataset-actions .left .icon-btn-group .icon-btn{margin-right:0}
.dataset .dataset-body .dataset-actions .left:not(:empty){margin-bottom:8px}
.dataset .dataset-body .dataset-actions .right{float:right}.dataset .dataset-body .dataset-actions .right .icon-btn{margin-left:2px}
.dataset .dataset-body .tags-display{display:none;margin-bottom:8px}.dataset .dataset-body .tags-display .select2-container{min-width:0px}.dataset .dataset-body .tags-display .select2-container .select2-choices{border-radius:3px}
.dataset .dataset-body .annotation-display{display:none;margin-bottom:8px}.dataset .dataset-body .annotation-display .annotation{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;white-space:pre-line}
+.dataset .dataset-body .annotation-display .annotation:empty{height:20px}
+.dataset .dataset-body .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'}
.dataset .dataset-body .annotation-display textarea{margin:0px 0px 2px 0px;display:block;border-radius:3px;width:100%}
.dataset .dataset-body .dataset-display-applications .display-application:last-child{margin-bottom:8px}
.dataset .dataset-body .dataset-peek{margin-bottom:8px}.dataset .dataset-body .dataset-peek pre.peek{width:100%;margin:0px;border-radius:3px;background:white;color:black;font-size:10px;overflow:auto}.dataset .dataset-body .dataset-peek pre.peek th{color:white;background:#5f6990}
This diff is so big that we needed to truncate the remainder.
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
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8b65e618f2e8/
Changeset: 8b65e618f2e8
User: jmchilton
Date: 2013-11-05 20:16:00
Summary: Bug fix for tool functional tests with repeat elements.
Affected #: 1 file
diff -r 1cf293a66f0f3b9677e6f777898a89c2ce0e8db6 -r 8b65e618f2e875ece55ac323222abf57bd2744e6 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1320,9 +1320,12 @@
self.visit_url( "%s/tool_runner/index?tool_id=%s" % (self.url, tool_id) )
if repeat_name is not None:
repeat_button = '%s_add' % repeat_name
+ # Must click somewhere in tool_form, to disambiguate what form
+ # is being targetted.
+ tc.browser.clicked( tc.browser.get_form( 'tool_form' ), None )
# Submit the "repeat" form button to add an input)
tc.submit( repeat_button )
- print "button '%s' clicked" % repeat_button
+ #print "button '%s' clicked" % repeat_button
tc.find( 'runtool_btn' )
self.submit_form( **kwd )
https://bitbucket.org/galaxy/galaxy-central/commits/de332b3e02d3/
Changeset: de332b3e02d3
User: jmchilton
Date: 2013-11-05 20:46:06
Summary: Enhance GATK tools to utilize GALAXY_SLOTS configuration when available.
Affected #: 6 files
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/count_covariates.xml
--- a/tools/gatk/count_covariates.xml
+++ b/tools/gatk/count_covariates.xml
@@ -17,7 +17,7 @@
-p 'java
-jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
-T "CountCovariates"
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
-et "NO_ET" ##ET no phone home
##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
#if $reference_source.reference_source_selector != "history":
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/realigner_target_creator.xml
--- a/tools/gatk/realigner_target_creator.xml
+++ b/tools/gatk/realigner_target_creator.xml
@@ -19,7 +19,7 @@
-T "RealignerTargetCreator"
-o "${output_interval}"
-et "NO_ET" ##ET no phone home
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
#if $reference_source.reference_source_selector != "history":
-R "${reference_source.ref_file.fields.path}"
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/unified_genotyper.xml
--- a/tools/gatk/unified_genotyper.xml
+++ b/tools/gatk/unified_genotyper.xml
@@ -19,7 +19,7 @@
-p 'java
-jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
-T "UnifiedGenotyper"
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
--out "${output_vcf}"
--metrics_file "${output_metrics}"
-et "NO_ET" ##ET no phone home
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/variant_eval.xml
--- a/tools/gatk/variant_eval.xml
+++ b/tools/gatk/variant_eval.xml
@@ -17,7 +17,7 @@
-jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
-T "VariantEval"
--out "${output_report}"
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
-et "NO_ET" ##ET no phone home
##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
#if $reference_source.reference_source_selector != "history":
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/variant_recalibrator.xml
--- a/tools/gatk/variant_recalibrator.xml
+++ b/tools/gatk/variant_recalibrator.xml
@@ -15,7 +15,7 @@
-p 'java
-jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
-T "VariantRecalibrator"
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
-et "NO_ET" ##ET no phone home
##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
#if $reference_source.reference_source_selector != "history":
diff -r 8b65e618f2e875ece55ac323222abf57bd2744e6 -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 tools/gatk/variant_select.xml
--- a/tools/gatk/variant_select.xml
+++ b/tools/gatk/variant_select.xml
@@ -14,7 +14,7 @@
-p 'java
-jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
-T "SelectVariants"
- --num_threads 4 ##hard coded, for now
+ --num_threads \${GALAXY_SLOTS:-4}
-et "NO_ET" ##ET no phone home
-o "${output_vcf}"
https://bitbucket.org/galaxy/galaxy-central/commits/1e63531be31a/
Changeset: 1e63531be31a
User: jmchilton
Date: 2013-11-05 20:46:06
Summary: Enhance megablast to utilize GALAXY_SLOTS configuration when available.
Affected #: 1 file
diff -r de332b3e02d31e60b706671d4c44e12b1d6f3b09 -r 1e63531be31a4b3ac8eac83242f2a6ca92ccaa91 tools/metag_tools/megablast_wrapper.py
--- a/tools/metag_tools/megablast_wrapper.py
+++ b/tools/metag_tools/megablast_wrapper.py
@@ -59,9 +59,13 @@
if not os.path.exists( os.path.split( options.db_build )[0] ):
stop_err( 'Cannot locate the target database directory. Please check your location file.' )
+ try:
+ threads = int( os.environ['GALAXY_SLOTS'])
+ except Exception:
+ threads = 8
# arguments for megablast
- megablast_command = "blastn -task megablast -db %s -query %s -out %s -outfmt '6 qseqid sgi slen ppos length mismatch gaps qstart qend sstart send evalue bitscore' -num_threads 8 -word_size %s -perc_identity %s -evalue %s -dust %s > /dev/null" \
- % ( options.db_build, query_filename, mega_temp_output, mega_word_size, mega_iden_cutoff, mega_evalue_cutoff, options.filter_query )
+ megablast_command = "blastn -task megablast -db %s -query %s -out %s -outfmt '6 qseqid sgi slen ppos length mismatch gaps qstart qend sstart send evalue bitscore' -num_threads %d -word_size %s -perc_identity %s -evalue %s -dust %s > /dev/null" \
+ % ( options.db_build, query_filename, mega_temp_output, threads, mega_word_size, mega_iden_cutoff, mega_evalue_cutoff, options.filter_query )
print megablast_command
https://bitbucket.org/galaxy/galaxy-central/commits/99d8158df290/
Changeset: 99d8158df290
User: jmchilton
Date: 2013-11-05 20:46:06
Summary: Enhance tophats to utilize GALAXY_SLOTS configuration when available.
Affected #: 3 files
diff -r 1e63531be31a4b3ac8eac83242f2a6ca92ccaa91 -r 99d8158df2906fc3e431533db8fc4b35e296c89b tools/ngs_rna/tophat2_wrapper.xml
--- a/tools/ngs_rna/tophat2_wrapper.xml
+++ b/tools/ngs_rna/tophat2_wrapper.xml
@@ -28,7 +28,7 @@
tophat2
## Change this to accommodate the number of threads you have available.
- --num-threads 4
+ --num-threads \${GALAXY_SLOTS:-4}
## Set params.
#if $params.settingsType == "full":
diff -r 1e63531be31a4b3ac8eac83242f2a6ca92ccaa91 -r 99d8158df2906fc3e431533db8fc4b35e296c89b tools/ngs_rna/tophat_color_wrapper.xml
--- a/tools/ngs_rna/tophat_color_wrapper.xml
+++ b/tools/ngs_rna/tophat_color_wrapper.xml
@@ -6,7 +6,7 @@
<command interpreter="python">
tophat_wrapper.py
## Change this to accommodate the number of threads you have available.
- --num-threads="4"
+ --num-threads="\${GALAXY_SLOTS:-4}"
## base- or color-space
--color-space
diff -r 1e63531be31a4b3ac8eac83242f2a6ca92ccaa91 -r 99d8158df2906fc3e431533db8fc4b35e296c89b tools/ngs_rna/tophat_wrapper.xml
--- a/tools/ngs_rna/tophat_wrapper.xml
+++ b/tools/ngs_rna/tophat_wrapper.xml
@@ -10,8 +10,7 @@
<command interpreter="python">
tophat_wrapper.py
## Change this to accommodate the number of threads you have available.
- --num-threads="4"
-
+ --num-threads="\${GALAXY_SLOTS:-4}"
## Provide outputs.
--junctions-output=$junctions
--hits-output=$accepted_hits
https://bitbucket.org/galaxy/galaxy-central/commits/9493825685ee/
Changeset: 9493825685ee
User: jmchilton
Date: 2013-11-05 20:46:06
Summary: Enhance bfast to utilize GALAXY_SLOTS configuration when available.
Affected #: 1 file
diff -r 99d8158df2906fc3e431533db8fc4b35e296c89b -r 9493825685ee557c4a33b37614b22c4c21463219 tools/sr_mapping/bfast_wrapper.xml
--- a/tools/sr_mapping/bfast_wrapper.xml
+++ b/tools/sr_mapping/bfast_wrapper.xml
@@ -1,7 +1,7 @@
<tool id="bfast_wrapper" name="Map with BFAST" version="0.1.3"><description></description><command interpreter="python">bfast_wrapper.py
- --numThreads="4" ##HACK: hardcode numThreads for now, should come from a location file
+ --numThreads="\${GALAXY_SLOTS:-4}"
--fastq="$input1"
#if $input1.extension.startswith( "fastqcs" ):
##if extention starts with fastqcs, then we have a color space 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
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1cf293a66f0f/
Changeset: 1cf293a66f0f
User: carlfeberhard
Date: 2013-11-05 20:29:41
Summary: Merge stable
Affected #: 3 files
diff -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 -r 1cf293a66f0f3b9677e6f777898a89c2ce0e8db6 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -4,3 +4,4 @@
2cc8d10988e03257dc7b97f8bb332c7df745d1dd security_2013.04.08
524f246ca85395082719ae7a6ff72260d7ad5612 release_2013.06.03
1ae95b3aa98d1ccf15b243ac3ce6a895eb7efc53 release_2013.08.12
+26f58e05aa1068761660681583821e21e6cbf7ab release_2013.11.04
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: UI: Rename galaxy.master.js to galaxy.masthead.js
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/91c9b4fb1c06/
Changeset: 91c9b4fb1c06
User: guerler
Date: 2013-11-05 19:52:35
Summary: UI: Rename galaxy.master.js to galaxy.masthead.js
Affected #: 11 files
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+define(["galaxy.masthead", "libs/backbone/backbone-relational"], function(mod_masthead) {
// frame manager
var GalaxyFrame = Backbone.View.extend(
@@ -79,11 +79,11 @@
// initialize
initialize : function(options)
{
- // add to master menu
+ // add to masthead menu
var self = this;
// add activate icon
- this.button_active = new mod_master.GalaxyMasterIcon (
+ this.button_active = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
@@ -94,11 +94,11 @@
}
});
- // add to master
- Galaxy.master.append(this.button_active);
+ // add to masthead
+ Galaxy.masthead.append(this.button_active);
// add load icon
- this.button_load = new mod_master.GalaxyMasterIcon (
+ this.button_load = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
@@ -106,8 +106,8 @@
with_number : true
});
- // add to master
- Galaxy.master.append(this.button_load);
+ // add to masthead
+ Galaxy.masthead.append(this.button_load);
// read in defaults
if (options)
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.master.js
--- a/static/scripts/galaxy.master.js
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- galaxy master
-*/
-
-// dependencies
-define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
-
-// master
-var GalaxyMaster = Backbone.View.extend(
-{
- // base element
- el_master: '#everything',
-
- // options
- options : null,
-
- // item list
- list : {},
-
- // keeps track of the last element
- itemLast: null,
-
- // counter
- itemCounter: 0,
-
- // background
- $background: null,
-
- // flag indicating visibility of background
- backgroundVisible: false,
-
- // initialize
- initialize : function(options)
- {
- // update options
- this.options = options;
-
- // HACK: due to body events defined in galaxy.panels.js
- $("body").off();
-
- // define this element
- this.setElement($(this._template(options)));
-
- // append to master
- $(this.el_master).append($(this.el));
-
- // assign background
- this.$background = $(this.el).find('#master-background');
-
- // loop through item specific unload functions
- // and collect all there warning messages, regarding
- // the user's attempt to unload the page
- var self = this;
- window.onbeforeunload = function()
- {
- var text = "";
- for (key in self.list)
- if (self.list[key].options.on_unload)
- {
- var q = self.list[key].options.on_unload();
- if (q) text += q + " ";
- }
- if (text != "")
- return text;
- };
- },
-
- // configure events
- events:
- {
- 'click' : '_eventRefresh',
- 'mousedown' : function(e) { e.preventDefault() }
- },
-
- // adds a new item to the master
- append : function(item)
- {
- return this._add(item, true);
- },
-
- // adds a new item to the master
- prepend : function(item)
- {
- return this._add(item, false);
- },
-
- // adds a new item to the master
- _add : function(item, append)
- {
- var $loc = $(this.el).find('#' + item.masterLocation);
- if ($loc)
- {
- // create frame for new item
- var itemId = 'master-item-' + this.itemCounter++;
- var $itemNew = $(item.el);
-
- // configure id and class in order to mark new items
- $itemNew.attr('id', itemId);
- $itemNew.addClass('master-item');
-
- // append to master
- if (append) {
- $loc.append($itemNew);
- } else {
- $loc.prepend($itemNew);
- }
-
- // add to list
- this.list[itemId] = item;
-
- // return item id
- return itemId;
- }
-
- // location not found
- return null;
- },
-
- // handle click event
- _eventRefresh: function(e)
- {
- // identify current item
- var itemCurrent = $(e.target).closest('.master-item');
-
- // get identifier
- if (itemCurrent.length)
- itemCurrent = itemCurrent.attr('id');
-
- // check last item
- if (this.itemLast && this.itemLast != itemCurrent)
- {
- var it = this.list[this.itemLast];
- if (it) {
- if (it.masterReset) {
- it.masterReset();
- }
- }
- }
-
- // check if current item is in active state
- var useBackground = false;
- if (itemCurrent)
- {
- var it = this.list[itemCurrent];
- if (it) {
- if (it.masterReset) {
- if (this.itemLast == itemCurrent) {
- useBackground = this.backgroundVisible ? false : true;
- } else {
- useBackground = true;
- }
- }
- }
- }
-
- // decide wether to show/hide background
- if (useBackground) {
- this.$background.show();
- } else {
- this.$background.hide();
- }
-
- // backup
- this.backgroundVisible = useBackground;
- this.itemLast = itemCurrent;
- },
-
- /*
- HTML TEMPLATES
- */
-
- // template item
- _templateItem: function(id)
- {
- return '<div id="' + id + '" class="master-item"></div>';
- },
-
- // fill template
- _template: function(options)
- {
- return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
- '<div style="position: relative; right: -50%; float: left;">' +
- '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
- '</div>' +
- '<div class="navbar-brand">' +
- '<a href="' + options.logo_url + '">' +
- '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
- '<span id="brand"> Galaxy ' + options.brand + '</span>' +
- '</a>' +
- '</div>' +
- '<div class="quota-meter-container"></div>' +
- '<div id="iconbar" class="iconbar"></div>' +
- '</div>' +
- '<div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
- '</div>';
- }
-});
-
-// icon
-var GalaxyMasterIcon = Backbone.View.extend(
-{
- // icon options
- options:
- {
- id : "galaxy-icon",
- icon : "fa-cog",
- tooltip : "galaxy-icon",
- with_number : false,
- on_click : function() { alert ('clicked') },
- on_unload : null,
- visible : true
- },
-
- // location identifier for master class
- masterLocation: 'iconbar',
-
- // initialize
- initialize: function (options)
- {
- // read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
- // add template for icon
- this.setElement($(this._template(this.options)));
-
- // configure icon
- var self = this;
- $(this.el).find('.icon').tooltip({title: this.options.tooltip})
- .on('mouseup', self.options.on_click);
-
- // visiblity
- if (!this.options.visible)
- this.hide();
- },
-
- // show
- show: function()
- {
- $(this.el).css({visibility : 'visible'});
- },
-
- // show
- hide: function()
- {
- $(this.el).css({visibility : 'hidden'});
- },
-
- // switch icon
- icon: function (new_icon)
- {
- // update icon class
- $(this.el).find('.icon').removeClass(this.options.icon)
- .addClass(new_icon);
-
- // update icon
- this.options.icon = new_icon;
- },
-
- // toggle
- toggle: function()
- {
- $(this.el).addClass('toggle');
- },
-
- // untoggle
- untoggle: function()
- {
- $(this.el).removeClass('toggle');
- },
-
- // set/get number
- number: function(new_number)
- {
- $(this.el).find('.number').text(new_number);
- },
-
- // fill template icon
- _template: function (options)
- {
- var tmpl = '<div id=' + options.id + ' class="symbol">' +
- '<div class="icon fa fa-2x ' + options.icon + '"></div>';
- if (options.with_number)
- tmpl+= '<div class="number"></div>';
- tmpl += '</div>';
-
- // return template
- return tmpl;
- }
-});
-
-// tab
-var GalaxyMasterTab = Backbone.View.extend(
-{
- // main options
- options:
- {
- id : '',
- title : 'Title',
- target : '_parent',
- content : '',
- type : 'url',
- scratchbook : false,
- on_unload : null,
- visible : true
- },
-
- // location
- masterLocation: 'navbar',
-
- // optional sub menu
- $menu: null,
-
- // flag if menu is visible
- menuVisible: false,
-
- // events
- events:
- {
- 'click .head' : '_eventClickHead'
- },
-
- // initialize
- initialize: function (options)
- {
- // read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
- // update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
- this.options.content = galaxy_config.root + this.options.content;
-
- // add template for tab
- this.setElement($(this._template(this.options)));
-
- // visiblity
- if (!this.options.visible)
- this.hide();
- },
-
- // show
- show: function()
- {
- $(this.el).css({visibility : 'visible'});
- },
-
- // show
- hide: function()
- {
- $(this.el).css({visibility : 'hidden'});
- },
-
- // add menu item
- addMenu: function (options)
- {
- // menu option defaults
- var menuOptions = {
- title : 'Title',
- content : '',
- type : 'url',
- target : '_parent',
- scratchbook : false,
- divider : false
- }
-
- // read in defaults
- if (options)
- menuOptions = _.defaults(options, menuOptions);
-
- // update url
- if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
- menuOptions.content = galaxy_config.root + menuOptions.content;
-
- // check if submenu element is available
- if (!this.$menu)
- {
- // insert submenu element into root
- $(this.el).find('.root').append(this._templateMenu());
-
- // show caret
- $(this.el).find('.symbol').addClass('caret');
-
- // update element link
- this.$menu = $(this.el).find('.menu');
- }
-
- // create
- var $item = $(this._templateMenuItem(menuOptions));
-
- // append menu
- this.$menu.append($item);
-
- // add events
- var self = this;
- $item.on('click', function(e)
- {
- // prevent default
- e.preventDefault();
-
- // check for menu options
- self._hideMenu();
-
- // no modifications if new tab is requested
- if (self.options.target === '_blank')
- return true;
-
- // load into frame
- Galaxy.frame.add(options);
- });
-
- // append divider
- if (menuOptions.divider)
- this.$menu.append($(this._templateDivider()));
- },
-
- // add reset function called by master
- masterReset: function()
- {
- this._hideMenu();
- },
-
- // hide menu
- _hideMenu: function()
- {
- if (this.$menu && this.menuVisible)
- {
- this.$menu.hide();
- this.menuVisible = false;
- }
- },
-
- // show menu on header click
- _eventClickHead: function(e)
- {
- // prevent default
- e.preventDefault();
-
- // check for menu options
- if (this.$menu)
- {
- // show/hide menu
- if (!this.menuVisible)
- {
- this.$menu.show();
- this.menuVisible = true;
- } else {
- this.$menu.hide();
- this.menuVisible = false;
- }
- } else {
- // open new frame
- Galaxy.frame.add(this.options);
- }
- },
-
- // fill template header
- _templateMenuItem: function (options)
- {
- return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
- },
-
- // fill template header
- _templateMenu: function ()
- {
- return '<ul class="menu dropdown-menu"></ul>';
- },
-
- _templateDivider: function()
- {
- return '<li class="divider"></li>';
- },
-
- // fill template
- _template: function (options)
- {
- // start template
- var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
- '<li class="root dropdown" style="">' +
- '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
- options.title + '<b class="symbol"></b>' +
- '</a>' +
- '</li>' +
- '</ul>';
-
- // return template
- return tmpl;
- }
-});
-
-// return
-return {
- GalaxyMaster: GalaxyMaster,
- GalaxyMasterTab: GalaxyMasterTab,
- GalaxyMasterIcon: GalaxyMasterIcon
-};
-
-});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.masthead.js
--- /dev/null
+++ b/static/scripts/galaxy.masthead.js
@@ -0,0 +1,498 @@
+/*
+ galaxy masthead
+*/
+
+// dependencies
+define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
+
+// masthead
+var GalaxyMasthead = Backbone.View.extend(
+{
+ // base element
+ el_masthead: '#everything',
+
+ // options
+ options : null,
+
+ // item list
+ list : {},
+
+ // keeps track of the last element
+ itemLast: null,
+
+ // counter
+ itemCounter: 0,
+
+ // background
+ $background: null,
+
+ // flag indicating visibility of background
+ backgroundVisible: false,
+
+ // initialize
+ initialize : function(options)
+ {
+ // update options
+ this.options = options;
+
+ // HACK: due to body events defined in galaxy.panels.js
+ $("body").off();
+
+ // define this element
+ this.setElement($(this._template(options)));
+
+ // append to masthead
+ $(this.el_masthead).append($(this.el));
+
+ // assign background
+ this.$background = $(this.el).find('#masthead-background');
+
+ // loop through item specific unload functions
+ // and collect all there warning messages, regarding
+ // the user's attempt to unload the page
+ var self = this;
+ window.onbeforeunload = function()
+ {
+ var text = "";
+ for (key in self.list)
+ if (self.list[key].options.on_unload)
+ {
+ var q = self.list[key].options.on_unload();
+ if (q) text += q + " ";
+ }
+ if (text != "")
+ return text;
+ };
+ },
+
+ // configure events
+ events:
+ {
+ 'click' : '_eventRefresh',
+ 'mousedown' : function(e) { e.preventDefault() }
+ },
+
+ // adds a new item to the masthead
+ append : function(item)
+ {
+ return this._add(item, true);
+ },
+
+ // adds a new item to the masthead
+ prepend : function(item)
+ {
+ return this._add(item, false);
+ },
+
+ // adds a new item to the masthead
+ _add : function(item, append)
+ {
+ var $loc = $(this.el).find('#' + item.mastheadLocation);
+ if ($loc)
+ {
+ // create frame for new item
+ var itemId = 'masthead-item-' + this.itemCounter++;
+ var $itemNew = $(item.el);
+
+ // configure id and class in order to mark new items
+ $itemNew.attr('id', itemId);
+ $itemNew.addClass('masthead-item');
+
+ // append to masthead
+ if (append) {
+ $loc.append($itemNew);
+ } else {
+ $loc.prepend($itemNew);
+ }
+
+ // add to list
+ this.list[itemId] = item;
+
+ // return item id
+ return itemId;
+ }
+
+ // location not found
+ return null;
+ },
+
+ // handle click event
+ _eventRefresh: function(e)
+ {
+ // identify current item
+ var itemCurrent = $(e.target).closest('.masthead-item');
+
+ // get identifier
+ if (itemCurrent.length)
+ itemCurrent = itemCurrent.attr('id');
+
+ // check last item
+ if (this.itemLast && this.itemLast != itemCurrent)
+ {
+ var it = this.list[this.itemLast];
+ if (it) {
+ if (it.mastheadReset) {
+ it.mastheadReset();
+ }
+ }
+ }
+
+ // check if current item is in active state
+ var useBackground = false;
+ if (itemCurrent)
+ {
+ var it = this.list[itemCurrent];
+ if (it) {
+ if (it.mastheadReset) {
+ if (this.itemLast == itemCurrent) {
+ useBackground = this.backgroundVisible ? false : true;
+ } else {
+ useBackground = true;
+ }
+ }
+ }
+ }
+
+ // decide wether to show/hide background
+ if (useBackground) {
+ this.$background.show();
+ } else {
+ this.$background.hide();
+ }
+
+ // backup
+ this.backgroundVisible = useBackground;
+ this.itemLast = itemCurrent;
+ },
+
+ /*
+ HTML TEMPLATES
+ */
+
+ // template item
+ _templateItem: function(id)
+ {
+ return '<div id="' + id + '" class="masthead-item"></div>';
+ },
+
+ // fill template
+ _template: function(options)
+ {
+ return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
+ '<div style="position: relative; right: -50%; float: left;">' +
+ '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
+ '</div>' +
+ '<div class="navbar-brand">' +
+ '<a href="' + options.logo_url + '">' +
+ '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
+ '<span id="brand"> Galaxy ' + options.brand + '</span>' +
+ '</a>' +
+ '</div>' +
+ '<div class="quota-meter-container"></div>' +
+ '<div id="iconbar" class="iconbar"></div>' +
+ '</div>' +
+ '<div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
+ '</div>';
+ }
+});
+
+// icon
+var GalaxyMastheadIcon = Backbone.View.extend(
+{
+ // icon options
+ options:
+ {
+ id : "galaxy-icon",
+ icon : "fa-cog",
+ tooltip : "galaxy-icon",
+ with_number : false,
+ on_click : function() { alert ('clicked') },
+ on_unload : null,
+ visible : true
+ },
+
+ // location identifier for masthead class
+ mastheadLocation: 'iconbar',
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // add template for icon
+ this.setElement($(this._template(this.options)));
+
+ // configure icon
+ var self = this;
+ $(this.el).find('.icon').tooltip({title: this.options.tooltip})
+ .on('mouseup', self.options.on_click);
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // switch icon
+ icon: function (new_icon)
+ {
+ // update icon class
+ $(this.el).find('.icon').removeClass(this.options.icon)
+ .addClass(new_icon);
+
+ // update icon
+ this.options.icon = new_icon;
+ },
+
+ // toggle
+ toggle: function()
+ {
+ $(this.el).addClass('toggle');
+ },
+
+ // untoggle
+ untoggle: function()
+ {
+ $(this.el).removeClass('toggle');
+ },
+
+ // set/get number
+ number: function(new_number)
+ {
+ $(this.el).find('.number').text(new_number);
+ },
+
+ // fill template icon
+ _template: function (options)
+ {
+ var tmpl = '<div id=' + options.id + ' class="symbol">' +
+ '<div class="icon fa fa-2x ' + options.icon + '"></div>';
+ if (options.with_number)
+ tmpl+= '<div class="number"></div>';
+ tmpl += '</div>';
+
+ // return template
+ return tmpl;
+ }
+});
+
+// tab
+var GalaxyMastheadTab = Backbone.View.extend(
+{
+ // main options
+ options:
+ {
+ id : '',
+ title : 'Title',
+ target : '_parent',
+ content : '',
+ type : 'url',
+ scratchbook : false,
+ on_unload : null,
+ visible : true
+ },
+
+ // location
+ mastheadLocation: 'navbar',
+
+ // optional sub menu
+ $menu: null,
+
+ // flag if menu is visible
+ menuVisible: false,
+
+ // events
+ events:
+ {
+ 'click .head' : '_eventClickHead'
+ },
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // update url
+ if (this.options.content && this.options.content.indexOf('//') === -1)
+ this.options.content = galaxy_config.root + this.options.content;
+
+ // add template for tab
+ this.setElement($(this._template(this.options)));
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // add menu item
+ addMenu: function (options)
+ {
+ // menu option defaults
+ var menuOptions = {
+ title : 'Title',
+ content : '',
+ type : 'url',
+ target : '_parent',
+ scratchbook : false,
+ divider : false
+ }
+
+ // read in defaults
+ if (options)
+ menuOptions = _.defaults(options, menuOptions);
+
+ // update url
+ if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
+ menuOptions.content = galaxy_config.root + menuOptions.content;
+
+ // check if submenu element is available
+ if (!this.$menu)
+ {
+ // insert submenu element into root
+ $(this.el).find('.root').append(this._templateMenu());
+
+ // show caret
+ $(this.el).find('.symbol').addClass('caret');
+
+ // update element link
+ this.$menu = $(this.el).find('.menu');
+ }
+
+ // create
+ var $item = $(this._templateMenuItem(menuOptions));
+
+ // append menu
+ this.$menu.append($item);
+
+ // add events
+ var self = this;
+ $item.on('click', function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ self._hideMenu();
+
+ // no modifications if new tab is requested
+ if (self.options.target === '_blank')
+ return true;
+
+ // load into frame
+ Galaxy.frame.add(options);
+ });
+
+ // append divider
+ if (menuOptions.divider)
+ this.$menu.append($(this._templateDivider()));
+ },
+
+ // add reset function called by masthead
+ mastheadReset: function()
+ {
+ this._hideMenu();
+ },
+
+ // hide menu
+ _hideMenu: function()
+ {
+ if (this.$menu && this.menuVisible)
+ {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ },
+
+ // show menu on header click
+ _eventClickHead: function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ if (this.$menu)
+ {
+ // show/hide menu
+ if (!this.menuVisible)
+ {
+ this.$menu.show();
+ this.menuVisible = true;
+ } else {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ } else {
+ // open new frame
+ Galaxy.frame.add(this.options);
+ }
+ },
+
+ // fill template header
+ _templateMenuItem: function (options)
+ {
+ return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
+ },
+
+ // fill template header
+ _templateMenu: function ()
+ {
+ return '<ul class="menu dropdown-menu"></ul>';
+ },
+
+ _templateDivider: function()
+ {
+ return '<li class="divider"></li>';
+ },
+
+ // fill template
+ _template: function (options)
+ {
+ // start template
+ var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
+ '<li class="root dropdown" style="">' +
+ '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
+ options.title + '<b class="symbol"></b>' +
+ '</a>' +
+ '</li>' +
+ '</ul>';
+
+ // return template
+ return tmpl;
+ }
+});
+
+// return
+return {
+ GalaxyMasthead: GalaxyMasthead,
+ GalaxyMastheadTab: GalaxyMastheadTab,
+ GalaxyMastheadIcon: GalaxyMastheadIcon
+};
+
+});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+define(["galaxy.masthead", "libs/backbone/backbone-relational"], function(mod_masthead) {
// frame manager
var GalaxyMenu = Backbone.Model.extend(
@@ -11,14 +11,14 @@
// options
options: null,
- // link master class
- master: null,
+ // link masthead class
+ masthead: null,
// initialize
initialize: function(options)
{
this.options = options.config;
- this.master = options.master;
+ this.masthead = options.masthead;
this.create();
},
@@ -28,26 +28,26 @@
//
// Analyze data tab.
//
- var tab_analysis = new mod_master.GalaxyMasterTab({
+ var tab_analysis = new mod_masthead.GalaxyMastheadTab({
title : "Analyze Data",
content : "root/index"
});
- this.master.append(tab_analysis);
+ this.masthead.append(tab_analysis);
//
// Workflow tab.
//
- var tab_workflow = new mod_master.GalaxyMasterTab({
+ var tab_workflow = new mod_masthead.GalaxyMastheadTab({
title : "Workflow",
content : "workflow"
});
- this.master.append(tab_workflow);
+ this.masthead.append(tab_workflow);
//
// 'Shared Items' or Libraries tab.
//
- var tab_shared = new mod_master.GalaxyMasterTab({
+ var tab_shared = new mod_masthead.GalaxyMastheadTab({
title : "Shared Data",
content : "library/index"
});
@@ -79,14 +79,14 @@
content : "page/list_published"
});
- this.master.append(tab_shared);
+ this.masthead.append(tab_shared);
//
// Lab menu.
//
if (this.options.user.requests)
{
- var tab_lab = new mod_master.GalaxyMasterTab({
+ var tab_lab = new mod_masthead.GalaxyMastheadTab({
title : "Lab"
});
tab_lab.addMenu({
@@ -101,13 +101,13 @@
title : "Help",
content : this.options.lims_doc_url
});
- this.master.append(tab_lab);
+ this.masthead.append(tab_lab);
}
//
// Visualization tab.
//
- var tab_visualization = new mod_master.GalaxyMasterTab({
+ var tab_visualization = new mod_masthead.GalaxyMastheadTab({
title : "Visualization",
content : "visualization/list"
@@ -122,14 +122,14 @@
content : "visualization/list",
target : "_frame"
});
- this.master.append(tab_visualization);
+ this.masthead.append(tab_visualization);
//
// Cloud menu.
//
if (this.options.enable_cloud_launch)
{
- var tab_cloud = new mod_master.GalaxyMasterTab({
+ var tab_cloud = new mod_masthead.GalaxyMastheadTab({
title : "Cloud",
content : "cloudlaunch/index"
});
@@ -137,7 +137,7 @@
title : "New Cloud Cluster",
content : "cloudlaunch/index"
});
- this.master.append(tab_cloud);
+ this.masthead.append(tab_cloud);
}
//
@@ -145,18 +145,18 @@
//
if (this.options.is_admin_user)
{
- var tab_admin = new mod_master.GalaxyMasterTab({
+ var tab_admin = new mod_masthead.GalaxyMastheadTab({
title : "Admin",
content : "admin/index",
extra_class : "admin-only"
});
- this.master.append(tab_admin);
+ this.masthead.append(tab_admin);
}
//
// Help tab.
//
- var tab_help = new mod_master.GalaxyMasterTab({
+ var tab_help = new mod_masthead.GalaxyMastheadTab({
title : "Help"
});
if (this.options.biostar_url)
@@ -210,14 +210,14 @@
target : "_blank"
});
}
- this.master.append(tab_help);
+ this.masthead.append(tab_help);
//
// User tab.
//
if (!this.options.user.valid)
{
- var tab_user = new mod_master.GalaxyMasterTab({
+ var tab_user = new mod_masthead.GalaxyMastheadTab({
title : "User",
extra_class : "loggedout-only"
});
@@ -242,10 +242,10 @@
});
}
- // add to master
- this.master.append(tab_user);
+ // add to masthead
+ this.masthead.append(tab_user);
} else {
- var tab_user = new mod_master.GalaxyMasterTab({
+ var tab_user = new mod_masthead.GalaxyMastheadTab({
title : "User",
extra_class : "loggedin-only"
});
@@ -316,8 +316,8 @@
});
}
- // add to master
- this.master.append(tab_user);
+ // add to masthead
+ this.masthead.append(tab_user);
}
}
});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.upload.js
--- a/static/scripts/galaxy.upload.js
+++ b/static/scripts/galaxy.upload.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.modal", "galaxy.master", "utils/galaxy.utils", "utils/galaxy.uploadbox", "libs/backbone/backbone-relational"], function(mod_modal, mod_master, mod_utils) {
+define(["galaxy.modal", "galaxy.masthead", "utils/galaxy.utils", "utils/galaxy.uploadbox", "libs/backbone/backbone-relational"], function(mod_modal, mod_masthead, mod_utils) {
// galaxy upload
var GalaxyUpload = Backbone.View.extend(
@@ -64,7 +64,7 @@
// add activate icon
var self = this;
- this.button_show = new mod_master.GalaxyMasterIcon (
+ this.button_show = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-arrow-circle-o-up',
tooltip : 'Upload Files',
@@ -76,8 +76,8 @@
with_number : true
});
- // add to master
- Galaxy.master.prepend(this.button_show);
+ // add to masthead
+ Galaxy.masthead.prepend(this.button_show);
// load extension
var self = this;
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},add:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrame:a}});
\ No newline at end of file
+define(["galaxy.masthead","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMastheadIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.masthead.append(this.button_active);this.button_load=new b.GalaxyMastheadIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.masthead.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},add:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrame:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.master.js
--- a/static/scripts/packed/galaxy.master.js
+++ /dev/null
@@ -1,1 +0,0 @@
-define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_master:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_master).append($(this.el));this.$background=$(this.el).find("#master-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.masterLocation);if(e){var h="master-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("master-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".master-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.masterReset){g.masterReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.masterReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="master-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var d=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},masterLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var b=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},masterLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame.add(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},masterReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame.add(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMaster:a,GalaxyMasterTab:b,GalaxyMasterIcon:d}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.masthead.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -0,0 +1,1 @@
+define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_masthead:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.mastheadLocation);if(e){var h="masthead-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("masthead-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".masthead-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.mastheadReset){g.mastheadReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.mastheadReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="masthead-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},mastheadLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var d=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},mastheadLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame.add(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},mastheadReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame.add(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMasthead:a,GalaxyMastheadTab:d,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.menu.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.menu.js
@@ -0,0 +1,1 @@
+define(["galaxy.masthead","libs/backbone/backbone-relational"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var d=new b.GalaxyMastheadTab({title:"Analyze Data",content:"root/index"});this.masthead.append(d);var c=new b.GalaxyMastheadTab({title:"Workflow",content:"workflow"});this.masthead.append(c);var g=new b.GalaxyMastheadTab({title:"Shared Data",content:"library/index"});g.addMenu({title:"Data Libraries",content:"library/index",divider:true});g.addMenu({title:"Published Histories",content:"history/list_published"});g.addMenu({title:"Published Workflows",content:"workflow/list_published"});g.addMenu({title:"Published Visualizations",content:"visualization/list_published"});g.addMenu({title:"Published Pages",content:"page/list_published"});this.masthead.append(g);if(this.options.user.requests){var h=new b.GalaxyMastheadTab({title:"Lab"});h.addMenu({title:"Sequencing Requests",content:"requests/index"});h.addMenu({title:"Find Samples",content:"requests/find_samples_index"});h.addMenu({title:"Help",content:this.options.lims_doc_url});this.masthead.append(h)}var k=new b.GalaxyMastheadTab({title:"Visualization",content:"visualization/list"});k.addMenu({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});k.addMenu({title:"Saved Visualizations",content:"visualization/list",target:"_frame"});this.masthead.append(k);if(this.options.enable_cloud_launch){var e=new b.GalaxyMastheadTab({title:"Cloud",content:"cloudlaunch/index"});e.addMenu({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(e)}if(this.options.is_admin_user){var f=new b.GalaxyMastheadTab({title:"Admin",content:"admin/index",extra_class:"admin-only"});this.masthead.append(f)}var j=new b.GalaxyMastheadTab({title:"Help"});if(this.options.biostar_url){j.addMenu({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});j.addMenu({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}j.addMenu({title:"Support",content:this.options.support_url,target:"_blank"});j.addMenu({title:"Search",content:this.options.search_url,target:"_blank"});j.addMenu({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});j.addMenu({title:"Videos",content:this.options.screencasts_url,target:"_blank"});j.addMenu({title:"Wiki",content:this.options.wiki_url,target:"_blank"});j.addMenu({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(!this.options.terms_url){j.addMenu({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(j);if(!this.options.user.valid){var i=new b.GalaxyMastheadTab({title:"User",extra_class:"loggedout-only"});if(this.options.allow_user_creation){i.addMenu({title:"Login",content:"user/login",target:"galaxy_main"})}if(this.options.allow_user_creation){i.addMenu({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(i)}else{var i=new b.GalaxyMastheadTab({title:"User",extra_class:"loggedin-only"});i.addMenu({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){i.addMenu({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{i.addMenu({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});i.addMenu({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});i.addMenu({title:"Logout",content:"user/logout",target:"_top",divider:true})}i.addMenu({title:"Saved Histories",content:"history/list",target:"galaxy_main"});i.addMenu({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});i.addMenu({title:"Saved Pages",content:"page/list",target:"_top"});i.addMenu({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){i.addMenu({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(i)}}});return{GalaxyMenu:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.upload.js
--- a/static/scripts/packed/galaxy.upload.js
+++ b/static/scripts/packed/galaxy.upload.js
@@ -1,1 +1,1 @@
-define(["galaxy.modal","galaxy.master","utils/galaxy.utils","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,d,c){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],state:{init:"fa fa-trash-o",queued:"fa fa-spinner fa-spin",running:"__running__",success:"fa fa-check",error:"fa fa-exclamation-triangle"},counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(){if(!Galaxy.currHistoryPanel){var e=this;window.setTimeout(function(){e.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}var e=this;this.button_show=new d.GalaxyMasterIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(f){e.event_show(f)},on_unload:function(){if(e.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.master.prepend(this.button_show);var e=this;c.jsonFromUrl(galaxy_config.root+"api/datatypes",function(f){for(key in f){e.select_extension.push([f[key],f[key]])}});c.jsonFromUrl(galaxy_config.root+"api/genomes",function(f){var g=e.select_genome[0];e.select_genome=[];for(key in f){if(f[key].length>1){if(f[key][1]!==g[1]){e.select_genome.push(f[key])}}}e.select_genome.sort(function(i,h){return i[0]>h[0]?1:i[0]<h[0]?-1:0});e.select_genome.unshift(g)})},event_dragover:function(f){},event_dragleave:function(f){},event_announce:function(i,g,n){var f="#upload-"+i;$(this.el).find("tbody:last").append(this.template_row(f));var h=this.get_upload_item(i);h.fadeIn();h.find("#title").html(g.name);h.find("#size").html(this.size_to_string(g.size));var m=this;h.find("#symbol").on("click",function(){m.event_remove(i)});h.find("#text-content").on("keyup",function(){var o=h.find("#text-content").val().length;h.find("#size").html(m.size_to_string(o))});this.event_progress(i,g,0);this.counter.announce++;this.update_screen();if(g.size==-1){var l=h.find("#text");var j=8;var e=h.width()-2*j;var k=h.height()-j;l.css("width",e+"px");l.css("top",k+"px");h.height(k+l.height()+2*j);l.show()}},event_initialize:function(i,e,n){this.button_show.number(this.counter.announce);var g=this.get_upload_item(i);var k=g.find("#symbol");k.addClass(this.state.running);var j=Galaxy.currHistoryPanel.model.get("id");var f=g.find("#extension").val();var m=g.find("#genome").val();var l=g.find("#text-content").val();var h=g.find("#space_to_tabs").is(":checked");if(!l&&!(e.size>0)){return null}this.uploadbox.configure({url:galaxy_config.root+"api/tools",paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=f;tool_input["files_0|NAME"]=e.name;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=h;data={};data.history_id=j;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},event_progress:function(f,g,i){var h=this.get_upload_item(f);var e=parseInt(i);h.find(".progress-bar").css({width:e+"%"});if(e!=100){h.find("#percentage").html(e+"%")}else{h.find("#percentage").html("Adding to history...")}},event_success:function(e,f,h){this.event_progress(e,f,100);this.button_show.number("");this.counter.announce--;this.counter.success++;this.update_screen();var g=this.get_upload_item(e);g.addClass("success");g.find("#percentage").html("100%");var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.success);Galaxy.currHistoryPanel.refreshHdas()},event_error:function(e,f,h){this.event_progress(e,f,0);this.button_show.number("");this.counter.announce--;this.counter.error++;this.update_screen();var g=this.get_upload_item(e);g.addClass("danger");g.find(".progress").remove();g.find("#info").html("<strong>Failed: </strong>"+h).show();var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.error)},event_start:function(){if(this.counter.announce==0||this.counter.running>0){return}var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.init)){g.removeClass(e.state.init);g.addClass(e.state.queued);$(this).find("#text-content").attr("disabled",true);$(this).find("#genome").attr("disabled",true);$(this).find("#extension").attr("disabled",true);$(this).find("#space_to_tabs").attr("disabled",true)}});this.counter.running=this.counter.announce;this.update_screen();this.uploadbox.start()},event_stop:function(){if(this.counter.running==0){return}this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},event_complete:function(){this.counter.running=0;this.update_screen();var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.queued)&&!g.hasClass(e.state.running)){g.removeClass(e.state.queued);g.addClass(e.state.init);$(this).find("#text-content").attr("disabled",false);$(this).find("#genome").attr("disabled",false);$(this).find("#extension").attr("disabled",false);$(this).find("#space_to_tabs").attr("disabled",false)}})},event_reset:function(){if(this.counter.running==0){var e=$(this.el).find(".upload-item");$(this.el).find("table").fadeOut({complete:function(){e.remove()}});this.counter.reset();this.update_screen();this.uploadbox.reset()}},event_remove:function(e){var f=this.get_upload_item(e);var g=f.find("#symbol");if(g.hasClass(this.state.init)||g.hasClass(this.state.success)||g.hasClass(this.state.error)){if(f.hasClass("success")){this.counter.success--}else{if(f.hasClass("danger")){this.counter.error--}else{this.counter.announce--}}this.update_screen();this.uploadbox.remove(e);f.remove()}},event_create:function(){this.uploadbox.add([{name:"New File",size:-1}])},event_show:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f.event_create()},Upload:function(){f.event_start()},Pause:function(){f.event_stop()},Reset:function(){f.event_reset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({dragover:function(){f.event_dragover()},dragleave:function(){f.event_dragleave()},announce:function(e,h,i){f.event_announce(e,h,i)},initialize:function(e,h,i){return f.event_initialize(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},complete:function(){f.event_complete()},});this.update_screen()}this.modal.show()},get_upload_item:function(e){return $(this.el).find("#upload-"+e)},size_to_string:function(e){var f="";if(e>=100000000000){e=e/100000000000;f="TB"}else{if(e>=100000000){e=e/100000000;f="GB"}else{if(e>=100000){e=e/100000;f="MB"}else{if(e>=100){e=e/100;f="KB"}else{if(e>0){e=e*10;f="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(e)/10)+"</strong> "+f},update_screen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},template:function(f,e){return'<div id="'+f+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+e+'" class="upload-info"></h6>'},template_row:function(f){var e='<tr id="'+f.substr(1)+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';e+='<td><select id="extension" class="extension">';for(key in this.select_extension){e+='<option value="'+this.select_extension[key][1]+'">'+this.select_extension[key][0]+"</option>"}e+="</select></td>";e+='<td><select id="genome" class="genome">';for(key in this.select_genome){e+='<option value="'+this.select_genome[key][1]+'">'+this.select_genome[key][0]+"</option>"}e+="</select></td>";e+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="symbol '+this.state.init+'"></div></td></tr>';return e}});return{GalaxyUpload:a}});
\ No newline at end of file
+define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,c,d){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],state:{init:"fa fa-trash-o",queued:"fa fa-spinner fa-spin",running:"__running__",success:"fa fa-check",error:"fa fa-exclamation-triangle"},counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(){if(!Galaxy.currHistoryPanel){var e=this;window.setTimeout(function(){e.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}var e=this;this.button_show=new c.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(f){e.event_show(f)},on_unload:function(){if(e.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var e=this;d.jsonFromUrl(galaxy_config.root+"api/datatypes",function(f){for(key in f){e.select_extension.push([f[key],f[key]])}});d.jsonFromUrl(galaxy_config.root+"api/genomes",function(f){var g=e.select_genome[0];e.select_genome=[];for(key in f){if(f[key].length>1){if(f[key][1]!==g[1]){e.select_genome.push(f[key])}}}e.select_genome.sort(function(i,h){return i[0]>h[0]?1:i[0]<h[0]?-1:0});e.select_genome.unshift(g)})},event_dragover:function(f){},event_dragleave:function(f){},event_announce:function(i,g,n){var f="#upload-"+i;$(this.el).find("tbody:last").append(this.template_row(f));var h=this.get_upload_item(i);h.fadeIn();h.find("#title").html(g.name);h.find("#size").html(this.size_to_string(g.size));var m=this;h.find("#symbol").on("click",function(){m.event_remove(i)});h.find("#text-content").on("keyup",function(){var o=h.find("#text-content").val().length;h.find("#size").html(m.size_to_string(o))});this.event_progress(i,g,0);this.counter.announce++;this.update_screen();if(g.size==-1){var l=h.find("#text");var j=8;var e=h.width()-2*j;var k=h.height()-j;l.css("width",e+"px");l.css("top",k+"px");h.height(k+l.height()+2*j);l.show()}},event_initialize:function(i,e,n){this.button_show.number(this.counter.announce);var g=this.get_upload_item(i);var k=g.find("#symbol");k.addClass(this.state.running);var j=Galaxy.currHistoryPanel.model.get("id");var f=g.find("#extension").val();var m=g.find("#genome").val();var l=g.find("#text-content").val();var h=g.find("#space_to_tabs").is(":checked");if(!l&&!(e.size>0)){return null}this.uploadbox.configure({url:galaxy_config.root+"api/tools",paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=f;tool_input["files_0|NAME"]=e.name;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=h;data={};data.history_id=j;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},event_progress:function(f,g,i){var h=this.get_upload_item(f);var e=parseInt(i);h.find(".progress-bar").css({width:e+"%"});if(e!=100){h.find("#percentage").html(e+"%")}else{h.find("#percentage").html("Adding to history...")}},event_success:function(e,f,h){this.event_progress(e,f,100);this.button_show.number("");this.counter.announce--;this.counter.success++;this.update_screen();var g=this.get_upload_item(e);g.addClass("success");g.find("#percentage").html("100%");var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.success);Galaxy.currHistoryPanel.refreshHdas()},event_error:function(e,f,h){this.event_progress(e,f,0);this.button_show.number("");this.counter.announce--;this.counter.error++;this.update_screen();var g=this.get_upload_item(e);g.addClass("danger");g.find(".progress").remove();g.find("#info").html("<strong>Failed: </strong>"+h).show();var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.error)},event_start:function(){if(this.counter.announce==0||this.counter.running>0){return}var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.init)){g.removeClass(e.state.init);g.addClass(e.state.queued);$(this).find("#text-content").attr("disabled",true);$(this).find("#genome").attr("disabled",true);$(this).find("#extension").attr("disabled",true);$(this).find("#space_to_tabs").attr("disabled",true)}});this.counter.running=this.counter.announce;this.update_screen();this.uploadbox.start()},event_stop:function(){if(this.counter.running==0){return}this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},event_complete:function(){this.counter.running=0;this.update_screen();var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.queued)&&!g.hasClass(e.state.running)){g.removeClass(e.state.queued);g.addClass(e.state.init);$(this).find("#text-content").attr("disabled",false);$(this).find("#genome").attr("disabled",false);$(this).find("#extension").attr("disabled",false);$(this).find("#space_to_tabs").attr("disabled",false)}})},event_reset:function(){if(this.counter.running==0){var e=$(this.el).find(".upload-item");$(this.el).find("table").fadeOut({complete:function(){e.remove()}});this.counter.reset();this.update_screen();this.uploadbox.reset()}},event_remove:function(e){var f=this.get_upload_item(e);var g=f.find("#symbol");if(g.hasClass(this.state.init)||g.hasClass(this.state.success)||g.hasClass(this.state.error)){if(f.hasClass("success")){this.counter.success--}else{if(f.hasClass("danger")){this.counter.error--}else{this.counter.announce--}}this.update_screen();this.uploadbox.remove(e);f.remove()}},event_create:function(){this.uploadbox.add([{name:"New File",size:-1}])},event_show:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f.event_create()},Upload:function(){f.event_start()},Pause:function(){f.event_stop()},Reset:function(){f.event_reset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({dragover:function(){f.event_dragover()},dragleave:function(){f.event_dragleave()},announce:function(e,h,i){f.event_announce(e,h,i)},initialize:function(e,h,i){return f.event_initialize(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},complete:function(){f.event_complete()},});this.update_screen()}this.modal.show()},get_upload_item:function(e){return $(this.el).find("#upload-"+e)},size_to_string:function(e){var f="";if(e>=100000000000){e=e/100000000000;f="TB"}else{if(e>=100000000){e=e/100000000;f="GB"}else{if(e>=100000){e=e/100000;f="MB"}else{if(e>=100){e=e/100;f="KB"}else{if(e>0){e=e*10;f="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(e)/10)+"</strong> "+f},update_screen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},template:function(f,e){return'<div id="'+f+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+e+'" class="upload-info"></h6>'},template_row:function(f){var e='<tr id="'+f.substr(1)+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';e+='<td><select id="extension" class="extension">';for(key in this.select_extension){e+='<option value="'+this.select_extension[key][1]+'">'+this.select_extension[key][0]+"</option>"}e+="</select></td>";e+='<td><select id="genome" class="genome">';for(key in this.select_genome){e+='<option value="'+this.select_genome[key][1]+'">'+this.select_genome[key][0]+"</option>"}e+="</select></td>";e+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="symbol '+this.state.init+'"></div></td></tr>';return e}});return{GalaxyUpload:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -25,11 +25,11 @@
%></%def>
-## master head generator
+## masthead head generator
<%def name="load()"><%
## get configuration
- master_config = {
+ masthead_config = {
## inject configuration
'brand' : app.config.get("brand", ""),
'use_remote_user' : app.config.use_remote_user,
@@ -70,37 +70,37 @@
$('<link href="' + galaxy_config.root + 'static/style/galaxy.frame.masthead.css" rel="stylesheet">').appendTo('head');
## load galaxy js-modules
- require(['galaxy.master', 'galaxy.menu', 'galaxy.modal', 'galaxy.frame', 'galaxy.upload'],
- function(mod_master, mod_menu, mod_modal, mod_frame, mod_upload)
+ require(['galaxy.masthead', 'galaxy.menu', 'galaxy.modal', 'galaxy.frame', 'galaxy.upload'],
+ function(mod_masthead, mod_menu, mod_modal, mod_frame, mod_upload)
{
- ## check if master is available
- if (Galaxy.master)
+ ## check if masthead is available
+ if (Galaxy.masthead)
return;
## get configuration
- var master_config = ${ h.to_json_string( master_config ) };
+ var masthead_config = ${ h.to_json_string( masthead_config ) };
## set up the quota meter (And fetch the current user data from trans)
- Galaxy.currUser = new User(master_config.user.json);
+ Galaxy.currUser = new User(masthead_config.user.json);
## load global galaxy objects
- Galaxy.master = new mod_master.GalaxyMaster(master_config);
+ Galaxy.masthead = new mod_masthead.GalaxyMasthead(masthead_config);
Galaxy.modal = new mod_modal.GalaxyModal();
Galaxy.frame = new mod_frame.GalaxyFrame();
## construct default menu options
Galaxy.menu = new mod_menu.GalaxyMenu({
- master: Galaxy.master,
- config: master_config
+ masthead: Galaxy.masthead,
+ config: masthead_config
});
## add upload plugin
##Galaxy.upload = new mod_upload.GalaxyUpload();
- ## add quota meter to master
+ ## add quota meter to masthead
Galaxy.quotaMeter = new UserQuotaMeter({
model : Galaxy.currUser,
- el : $(Galaxy.master.el).find('.quota-meter-container')
+ el : $(Galaxy.masthead.el).find('.quota-meter-container')
}).render();
});
</script>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: UI: Translate masthead mako code into js
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5828950834e3/
Changeset: 5828950834e3
User: guerler
Date: 2013-11-05 18:34:42
Summary: UI: Translate masthead mako code into js
Affected #: 14 files
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -1,5 +1,5 @@
/*
- galaxy frames v2.0
+ galaxy frames
*/
// dependencies
@@ -9,7 +9,7 @@
var GalaxyFrameManager = Backbone.View.extend(
{
// base element
- el_main: '#everything',
+ el_main: 'body',
// defaults inputs
options:
@@ -46,7 +46,7 @@
// scroll/element top
top: 0,
- // maximum viewport
+ // viewport scrolling state
top_max: 0,
// frame z-index
@@ -87,7 +87,7 @@
{
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
- on_click : function(e) { self.event_panel_active(e) },
+ on_click : function(e) { self._event_panel_active(e) },
on_unload : function() {
if (self.frame_counter > 0)
return "You opened " + self.frame_counter + " frame(s) which will be lost.";
@@ -102,7 +102,7 @@
{
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
- on_click : function(e) { self.event_panel_load(e) },
+ on_click : function(e) { self._event_panel_load(e) },
with_number : true
});
@@ -117,13 +117,13 @@
this.top = this.top_max = this.options.top_min;
// create
- this.setElement(this.template());
+ this.setElement(this._template());
// load background
- $(this.el).append(this.template_background());
+ $(this.el).append(this._template_background());
// load menu buttons
- $(this.el).append(this.template_menu());
+ $(this.el).append(this._template_menu());
// load to main frame
$(this.el_main).append($(this.el));
@@ -134,7 +134,7 @@
var id_shadow = '#frame-shadow';
// add shadow template
- $(this.el).append(this.template_shadow(id_shadow.substring(1)));
+ $(this.el).append(this._template_shadow(id_shadow.substring(1)));
// initialize frame
this.frame_shadow = {
@@ -146,23 +146,142 @@
};
// initialize size
- this.frame_resize(this.frame_shadow, {width: 0, height: 0});
+ this._frame_resize(this.frame_shadow, {width: 0, height: 0});
// add shadow to frame list
this.frame_list[id_shadow] = this.frame_shadow;
// initialize panel
- this.panel_refresh();
+ this._panel_refresh();
// catch window resize event
var self = this;
$(window).resize(function ()
{
if (self.visible)
- self.panel_refresh();
+ self._panel_refresh();
});
},
+ // adds and displays a new frame/window
+ frame_new: function(options)
+ {
+ // frame default options
+ var frameOptions =
+ {
+ title: '',
+ content: null,
+ target: '',
+ type: null,
+ scratchbook: false
+ }
+
+ // read in defaults
+ if (options)
+ options = _.defaults(options, frameOptions);
+ else
+ options = frameOptions;
+
+ // check for content
+ if(!options.content)
+ return;
+
+ // open new tab
+ if (options.target == '_blank')
+ {
+ window.open(options.content);
+ return;
+ }
+
+ // reload entire window
+ if (options.target == '_top' || options.target == '_parent' || options.target == '_self')
+ {
+ window.location = options.content;
+ return;
+ }
+
+ // validate
+ if (!this.active)
+ {
+ // fix url if main frame is unavailable
+ var $galaxy_main = $(window.parent.document).find('#galaxy_main');
+ if (options.target == 'galaxy_main' || options.target == 'center')
+ {
+ if ($galaxy_main.length == 0)
+ {
+ var href = options.content;
+ if (href.indexOf('?') == -1)
+ href += '?';
+ else
+ href += '&';
+ href += 'use_panels=True';
+ window.location = href;
+ } else {
+ $galaxy_main.attr('src', options.content);
+ }
+ } else
+ window.location = options.content;
+
+ // stop
+ return;
+ }
+
+ // check for number of frames
+ if (this.frame_counter >= this.options.frame_max)
+ {
+ alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
+ return;
+ }
+
+ // generate frame identifier
+ var frame_id = '#frame-' + (this.frame_counter_id++);
+
+ // check if frame exists
+ if ($(frame_id).length !== 0)
+ {
+ alert("This frame already exists. This page might contain multiple frame managers.");
+ return;
+ }
+
+ // reset top
+ this.top = this.options.top_min;
+
+ // append
+ $(this.el).append(this._template_frame(frame_id.substring(1), options.title, options.type, options.content));
+
+ // construct a new frame
+ var frame = {
+ id : frame_id,
+ screen_location : {},
+ grid_location : {},
+ grid_rank : null,
+ grid_lock : false
+ };
+
+ // set dimensions
+ options.width = this._to_pixel_coord('width', this.options.frame.cols);
+ options.height = this._to_pixel_coord('height', this.options.frame.rows);
+
+ // default z-index
+ this.frame_z = parseInt($(frame.id).css('z-index'));
+
+ // add to frame list
+ this.frame_list[frame_id] = frame;
+
+ // increase frame counter
+ this.frame_counter++;
+
+ // resize
+ this._frame_resize(frame, {width: options.width, height: options.height});
+
+ // place frame
+ this._frame_insert(frame, {top: 0, left: 0}, true);
+
+ // show frames if hidden
+ if (!this.visible)
+ this._panel_show_hide();
+ },
+
/*
EVENT HANDLING
*/
@@ -179,23 +298,23 @@
events:
{
// global frame events
- 'mousemove' : 'event_frame_mouse_move',
- 'mouseup' : 'event_frame_mouse_up',
- 'mouseleave' : 'event_frame_mouse_up',
- 'mousewheel' : 'event_panel_scroll',
- 'DOMMouseScroll' : 'event_panel_scroll',
+ 'mousemove' : '_event_frame_mouse_move',
+ 'mouseup' : '_event_frame_mouse_up',
+ 'mouseleave' : '_event_frame_mouse_up',
+ 'mousewheel' : '_event_panel_scroll',
+ 'DOMMouseScroll' : '_event_panel_scroll',
// events fixed to elements
- 'mousedown .frame' : 'event_frame_mouse_down',
- 'mousedown .frame-background' : 'event_panel_load',
- 'mousedown .frame-scroll-up' : 'event_panel_scroll_up',
- 'mousedown .frame-scroll-down' : 'event_panel_scroll_down',
- 'mousedown .f-close' : 'event_frame_close',
- 'mousedown .f-pin' : 'event_frame_lock'
+ 'mousedown .frame' : '_event_frame_mouse_down',
+ 'mousedown .frame-background' : '_event_panel_load',
+ 'mousedown .frame-scroll-up' : '_event_panel_scroll_up',
+ 'mousedown .frame-scroll-down' : '_event_panel_scroll_down',
+ 'mousedown .f-close' : '_event_frame_close',
+ 'mousedown .f-pin' : '_event_frame_lock'
},
// drag start
- event_frame_mouse_down: function (e)
+ _event_frame_mouse_down: function (e)
{
// skip if event is already active
if (this.event.type !== null)
@@ -218,7 +337,7 @@
e.preventDefault();
// identify frame
- this.event.target = this.event_get_frame(e.target);
+ this.event.target = this._frame_identify(e.target);
// check if frame is locked
if (this.event.target.grid_lock)
@@ -231,11 +350,11 @@
this.event.xy = {x: e.originalEvent.pageX, y: e.originalEvent.pageY};
// prepare drag/resize
- this.frame_drag_start(this.event.target);
+ this._frame_drag_start(this.event.target);
},
// mouse move event
- event_frame_mouse_move: function (e)
+ _event_frame_mouse_move: function (e)
{
// check
if (this.event.type != 'drag' && this.event.type != 'resize')
@@ -255,7 +374,7 @@
this.event.xy = event_xy_new;
// object position / size
- var p = this.frame_screen (this.event.target);
+ var p = this._frame_screen (this.event.target);
// resize event
if (this.event.type == 'resize')
@@ -270,23 +389,23 @@
p.height = Math.max(p.height, min_dim);
// apply resize to frame
- this.frame_resize(this.event.target, p);
+ this._frame_resize(this.event.target, p);
// break down to grid coordinates
- p.width = this.to_grid_coord('width', p.width) + 1;
- p.height = this.to_grid_coord('height', p.height) + 1;
+ p.width = this._to_grid_coord('width', p.width) + 1;
+ p.height = this._to_grid_coord('height', p.height) + 1;
// transfer back to pixels
- p.width = this.to_pixel_coord('width', p.width);
- p.height = this.to_pixel_coord('height', p.height);
+ p.width = this._to_pixel_coord('width', p.width);
+ p.height = this._to_pixel_coord('height', p.height);
// apply
- this.frame_resize(this.frame_shadow, p);
+ this._frame_resize(this.frame_shadow, p);
// fix position
- this.frame_insert(this.frame_shadow, {
- top : this.to_grid_coord('top', p.top),
- left : this.to_grid_coord('left', p.left)
+ this._frame_insert(this.frame_shadow, {
+ top : this._to_grid_coord('top', p.top),
+ left : this._to_grid_coord('left', p.left)
});
}
@@ -298,12 +417,12 @@
p.top += event_xy_delta.y;
// apply
- this.frame_offset(this.event.target, p);
+ this._frame_offset(this.event.target, p);
// get location of shadow
var l = {
- top : this.to_grid_coord('top', p.top),
- left : this.to_grid_coord('left', p.left)
+ top : this._to_grid_coord('top', p.top),
+ left : this._to_grid_coord('left', p.left)
};
// increase priority of current frame
@@ -311,26 +430,26 @@
l.left++;
// fix position
- this.frame_insert(this.frame_shadow, l);
+ this._frame_insert(this.frame_shadow, l);
}
},
// mouse up
- event_frame_mouse_up: function (e)
+ _event_frame_mouse_up: function (e)
{
// check
if (this.event.type != 'drag' && this.event.type != 'resize')
return;
// stop
- this.frame_drag_stop(this.event.target);
+ this._frame_drag_stop(this.event.target);
// reset event
this.event.type = null;
},
// drag start
- event_frame_close: function (e)
+ _event_frame_close: function (e)
{
// check
if (this.event.type !== null)
@@ -340,7 +459,7 @@
e.preventDefault();
// get frame
- var frame = this.event_get_frame(e.target);
+ var frame = this._frame_identify(e.target);
var self = this;
// fade out
@@ -356,19 +475,19 @@
self.frame_counter--;
// reload
- self.panel_refresh(true);
+ self._panel_refresh(true);
// refresh scroll state once all animations completed
- self.panel_animation_complete();
+ self._panel_animation_complete();
// hide if no frames left
if (self.visible && self.frame_counter == 0)
- self.panel_show_hide();
+ self._panel_show_hide();
});
},
// drag start
- event_frame_lock: function (e)
+ _event_frame_lock: function (e)
{
// check
if (this.event.type !== null)
@@ -378,7 +497,7 @@
e.preventDefault();
// get frame
- var frame = this.event_get_frame(e.target);
+ var frame = this._frame_identify(e.target);
// check
if (frame.grid_lock)
@@ -406,29 +525,29 @@
},
// show/hide panel
- event_panel_load: function (e)
+ _event_panel_load: function (e)
{
// check
if (this.event.type !== null)
return;
// load panel
- this.panel_show_hide();
+ this._panel_show_hide();
},
// activate/disable panel
- event_panel_active: function (e)
+ _event_panel_active: function (e)
{
// check
if (this.event.type !== null)
return;
// load panel
- this.panel_active_disable();
+ this._panel_active_disable();
},
// scroll
- event_panel_scroll: function(e)
+ _event_panel_scroll: function(e)
{
// check
if (this.event.type !== null || !this.visible)
@@ -441,11 +560,11 @@
var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3;
// refresh panel
- this.panel_scroll(delta);
+ this._panel_scroll(delta);
},
// scroll up
- event_panel_scroll_up: function(e)
+ _event_panel_scroll_up: function(e)
{
// check
if (this.event.type !== null)
@@ -455,11 +574,11 @@
e.preventDefault();
// scroll up
- this.panel_scroll(-this.options.scroll);
+ this._panel_scroll(-this.options.scroll);
},
// scroll down
- event_panel_scroll_down: function(e)
+ _event_panel_scroll_down: function(e)
{
// check
if (this.event.type !== null)
@@ -469,31 +588,31 @@
e.preventDefault();
// scroll down
- this.panel_scroll(this.options.scroll);
+ this._panel_scroll(this.options.scroll);
},
+ /*
+ FRAME EVENTS SUPPORT
+ */
+
// identify
- event_get_frame: function(target)
+ _frame_identify: function(target)
{
return this.frame_list['#' + $(target).closest('.frame').attr('id')];
},
-
- /*
- FRAME EVENTS START/STOP
- */
-
+
// drag start
- frame_drag_start : function (frame)
+ _frame_drag_start : function (frame)
{
// set focus
- this.frame_focus(frame, true);
+ this._frame_focus(frame, true);
// get current dimensions
- var p = this.frame_screen (frame);
+ var p = this._frame_screen (frame);
// initialize shadow
- this.frame_resize(this.frame_shadow, p);
- this.frame_grid(this.frame_shadow, frame.grid_location);
+ this._frame_resize(this.frame_shadow, p);
+ this._frame_grid(this.frame_shadow, frame.grid_location);
// reset location
frame.grid_location = null;
@@ -506,17 +625,17 @@
},
// drag stop
- frame_drag_stop : function (frame)
+ _frame_drag_stop : function (frame)
{
// remove focus
- this.frame_focus(frame, false);
+ this._frame_focus(frame, false);
// get new dimensions
- var p = this.frame_screen(this.frame_shadow);
+ var p = this._frame_screen(this.frame_shadow);
// update frame
- this.frame_resize(frame, p);
- this.frame_grid(frame, this.frame_shadow.grid_location, true);
+ this._frame_resize(frame, p);
+ this._frame_grid(frame, this.frame_shadow.grid_location, true);
// reset location of shadow
this.frame_shadow.grid_location = null;
@@ -528,7 +647,7 @@
$('.f-cover').hide();
// refresh scroll state once all animations completed
- this.panel_animation_complete();
+ this._panel_animation_complete();
},
/*
@@ -536,7 +655,7 @@
*/
// converts a pixel coordinate to grids
- to_grid_coord: function (type, px)
+ _to_grid_coord: function (type, px)
{
// determine sign
var sign = (type == 'width' || type == 'height') ? 1 : -1;
@@ -548,7 +667,7 @@
},
// converts a grid coordinate to pixels
- to_pixel_coord: function (type, g)
+ _to_pixel_coord: function (type, g)
{
// determine sign
var sign = (type == 'width' || type == 'height') ? 1 : -1;
@@ -562,25 +681,25 @@
},
// get grid coordinates
- to_grid: function (px)
+ _to_grid: function (px)
{
// full set
return {
- top : this.to_grid_coord('top', px.top),
- left : this.to_grid_coord('left', px.left),
- width : this.to_grid_coord('width', px.width),
- height : this.to_grid_coord('height', px.height)
+ top : this._to_grid_coord('top', px.top),
+ left : this._to_grid_coord('left', px.left),
+ width : this._to_grid_coord('width', px.width),
+ height : this._to_grid_coord('height', px.height)
};
},
// get pixel coordinates
- to_pixel: function(g)
+ _to_pixel: function(g)
{
return {
- top : this.to_pixel_coord('top', g.top),
- left : this.to_pixel_coord('left', g.left),
- width : this.to_pixel_coord('width', g.width),
- height : this.to_pixel_coord('height', g.height)
+ top : this._to_pixel_coord('top', g.top),
+ left : this._to_pixel_coord('left', g.left),
+ width : this._to_pixel_coord('width', g.width),
+ height : this._to_pixel_coord('height', g.height)
};
},
@@ -589,7 +708,7 @@
*/
// check collision
- is_collision: function(g)
+ _is_collision: function(g)
{
// is collision pair
function is_collision_pair (a, b)
@@ -618,7 +737,7 @@
},
// location/grid rank
- location_rank: function(loc)
+ _location_rank: function(loc)
{
return (loc.top * this.cols) + loc.left;
},
@@ -628,7 +747,7 @@
*/
// update frame counter
- menu_refresh: function()
+ _menu_refresh: function()
{
// update on screen counter
this.button_load.number(this.frame_counter);
@@ -657,24 +776,24 @@
*/
// panel on animation complete / frames not moving
- panel_animation_complete: function()
+ _panel_animation_complete: function()
{
var self = this;
- $(".frame").promise().done(function() {self.panel_scroll(0, true)});
+ $(".frame").promise().done(function() {self._panel_scroll(0, true)});
},
// refresh panel
- panel_refresh: function(animate)
+ _panel_refresh: function(animate)
{
// get current size
this.cols = parseInt($(window).width() / this.options.cell, 10) + 1;
// recalculate frame positions
- this.frame_insert(null, null, animate);
+ this._frame_insert(null, null, animate);
},
// update scroll
- panel_scroll: function(delta, animate)
+ _panel_scroll: function(delta, animate)
{
// new top value
var top_new = this.top - this.options.scroll * delta;
@@ -699,7 +818,7 @@
top : frame.screen_location.top - (this.top - top_new),
left : frame.screen_location.left
}
- this.frame_offset(frame, screen_location, animate);
+ this._frame_offset(frame, screen_location, animate);
}
}
@@ -708,11 +827,11 @@
}
// refresh
- this.menu_refresh();
+ this._menu_refresh();
},
// show or hide panel
- panel_show_hide: function()
+ _panel_show_hide: function()
{
// check
if (this.visible)
@@ -750,12 +869,12 @@
$(".frame-background").show();
// show panel
- this.panel_refresh();
+ this._panel_refresh();
}
},
// show or hide panel
- panel_active_disable: function()
+ _panel_active_disable: function()
{
// check
if (this.active)
@@ -768,7 +887,7 @@
// hide panel
if (this.visible)
- this.panel_show_hide();
+ this._panel_show_hide();
} else {
// activate
this.active = true;
@@ -781,82 +900,9 @@
/*
FRAME FUNCTIONS
*/
- // adds and displays a new frame/window
- frame_new: function(options)
- {
- // validate
- if (!this.active)
- {
- // load frame in main window
- if (options.location == 'center')
- {
- var galaxy_main = $( window.parent.document ).find( 'iframe#galaxy_main' );
- galaxy_main.attr( 'src', options.content );
- } else
- window.location = options.content;
-
- // stop
- return;
- }
-
- // check for number of frames
- if (this.frame_counter >= this.options.frame_max)
- {
- alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
- return;
- }
-
- // generate frame identifier
- var frame_id = '#frame-' + (this.frame_counter_id++);
-
- // check if frame exists
- if ($(frame_id).length !== 0)
- {
- alert("This frame already exists. This page might contain multiple frame managers.");
- return;
- }
-
- // reset top
- this.top = this.options.top_min;
-
- // append
- $(this.el).append(this.template_frame(frame_id.substring(1), options.title, options.type, options.content));
-
- // construct a new frame
- var frame = {
- id : frame_id,
- screen_location : {},
- grid_location : {},
- grid_rank : null,
- grid_lock : false
- };
-
- // set dimensions
- options.width = this.to_pixel_coord('width', this.options.frame.cols);
- options.height = this.to_pixel_coord('height', this.options.frame.rows);
-
- // default z-index
- this.frame_z = parseInt($(frame.id).css('z-index'));
-
- // add to frame list
- this.frame_list[frame_id] = frame;
-
- // increase frame counter
- this.frame_counter++;
-
- // resize
- this.frame_resize(frame, {width: options.width, height: options.height});
-
- // place frame
- this.frame_insert(frame, {top: 0, left: 0}, true);
-
- // show frames if hidden
- if (!this.visible)
- this.panel_show_hide();
- },
// frame insert at given location
- frame_insert: function(frame, new_loc, animate)
+ _frame_insert: function(frame, new_loc, animate)
{
// define
var place_list = [];
@@ -868,7 +914,7 @@
frame.grid_location = null;
// set first one to be placed
- place_list.push([frame, this.location_rank(new_loc)]);
+ place_list.push([frame, this._location_rank(new_loc)]);
}
// search
@@ -899,7 +945,7 @@
// place
for (i = 0; i < place_list.length; i++)
- this.frame_place(place_list[i][0], animate);
+ this._frame_place(place_list[i][0], animate);
// identify maximum viewport size
this.top_max = 0;
@@ -920,17 +966,17 @@
this.top_max = Math.min(this.top_max, this.options.top_min);
// panel menu
- this.menu_refresh();
+ this._menu_refresh();
},
// naive frame place
- frame_place: function(frame, animate)
+ _frame_place: function(frame, animate)
{
// reset grid location
frame.grid_location = null;
// grid coordinates of new frame
- var g = this.to_grid(this.frame_screen(frame));
+ var g = this._to_grid(this._frame_screen(frame));
// try grid coordinates
var done = false;
@@ -944,7 +990,7 @@
g.left = j;
// no collision
- if (!this.is_collision(g))
+ if (!this._is_collision(g))
{
done = true;
break;
@@ -958,13 +1004,13 @@
// check if valid spot was found
if (done)
- this.frame_grid(frame, g, animate);
+ this._frame_grid(frame, g, animate);
else
console.log("Grid dimensions exceeded.");
},
// focus
- frame_focus: function(frame, has_focus)
+ _frame_focus: function(frame, has_focus)
{
// get new z-value
var z = this.frame_z + (has_focus ? 1 : 0);
@@ -974,7 +1020,7 @@
},
// new left/top position frame
- frame_offset: function(frame, p, animate)
+ _frame_offset: function(frame, p, animate)
{
// update screen location
frame.screen_location.left = p.left;
@@ -984,7 +1030,7 @@
if (animate)
{
// set focus on animated
- this.frame_focus(frame, true);
+ this._frame_focus(frame, true);
// prepare for callback
var self = this;
@@ -993,7 +1039,7 @@
$(frame.id).animate({top: p.top, left: p.left}, 'fast', function()
{
// remove focus
- self.frame_focus(frame, false);
+ self._frame_focus(frame, false);
});
} else
// update css
@@ -1001,7 +1047,7 @@
},
// resize frame
- frame_resize: function(frame, p)
+ _frame_resize: function(frame, p)
{
// update css
$(frame.id).css({width: p.width, height: p.height});
@@ -1012,20 +1058,20 @@
},
// new grid location
- frame_grid: function (frame, l, animate)
+ _frame_grid: function (frame, l, animate)
{
// update grid location
frame.grid_location = l;
// place frame
- this.frame_offset(frame, this.to_pixel(l), animate);
+ this._frame_offset(frame, this._to_pixel(l), animate);
// update grid rank
- frame.grid_rank = this.location_rank(l);
+ frame.grid_rank = this._location_rank(l);
},
// get frame dimensions
- frame_screen: function(frame)
+ _frame_screen: function(frame)
{
var p = frame.screen_location;
return {top: p.top, left: p.left, width: p.width, height: p.height};
@@ -1036,13 +1082,13 @@
*/
// main element
- template: function()
+ _template: function()
{
- return '<div class="galaxy-frame"></div>';
+ return '<div class="galaxy-frame"></div>';
},
// fill regular frame template
- template_frame: function(id, title, type, content)
+ _template_frame: function(id, title, type, content)
{
// check title
if (!title)
@@ -1067,19 +1113,19 @@
},
// fill shadow template
- template_shadow: function(id)
+ _template_shadow: function(id)
{
return '<div id="' + id + '" class="frame-shadow corner"></div>';
},
// fill background template in order to cover underlying iframes
- template_background: function()
+ _template_background: function()
{
return '<div class="frame-background"></div>';
},
// fill menu button template
- template_menu: function()
+ _template_menu: function()
{
return '<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div>' +
'<div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>';
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.master.js
--- a/static/scripts/galaxy.master.js
+++ b/static/scripts/galaxy.master.js
@@ -3,27 +3,53 @@
*/
// dependencies
-define(["libs/backbone/backbone-relational"], function() {
+define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
// master
var GalaxyMaster = Backbone.View.extend(
{
// base element
- el_master: '#masthead',
+ el_master: '#everything',
+
+ // options
+ options : null,
// item list
- list : [],
+ list : {},
+
+ // keeps track of the last element
+ itemLast: null,
+
+ // counter
+ itemCounter: 0,
+
+ // background
+ $background: null,
+
+ // flag indicating visibility of background
+ backgroundVisible: false,
// initialize
initialize : function(options)
{
+ // update options
+ this.options = options;
+
+ // HACK: due to body events defined in galaxy.panels.js
+ $("body").off();
+
// define this element
- this.setElement($(this.template()));
+ this.setElement($(this._template(options)));
// append to master
$(this.el_master).append($(this.el));
+ // assign background
+ this.$background = $(this.el).find('#master-background');
+
// loop through item specific unload functions
+ // and collect all there warning messages, regarding
+ // the user's attempt to unload the page
var self = this;
window.onbeforeunload = function()
{
@@ -39,38 +65,133 @@
};
},
- // prevent default
+ // configure events
events:
{
- 'mousedown' : function(e) {e.preventDefault()}
+ 'click' : '_eventRefresh',
+ 'mousedown' : function(e) { e.preventDefault() }
},
// adds a new item to the master
append : function(item)
{
- $(this.el).append($(item.el));
- this.list.push(item);
+ return this._add(item, true);
},
// adds a new item to the master
prepend : function(item)
{
- $(this.el).prepend($(item.el));
- this.list.push(item);
+ return this._add(item, false);
+ },
+
+ // adds a new item to the master
+ _add : function(item, append)
+ {
+ var $loc = $(this.el).find('#' + item.masterLocation);
+ if ($loc)
+ {
+ // create frame for new item
+ var itemId = 'master-item-' + this.itemCounter++;
+ var $itemNew = $(item.el);
+
+ // configure id and class in order to mark new items
+ $itemNew.attr('id', itemId);
+ $itemNew.addClass('master-item');
+
+ // append to master
+ if (append)
+ $loc.append($itemNew);
+ else
+ $loc.prepend($itemNew);
+
+ // add to list
+ this.list[itemId] = item;
+
+ // return item id
+ return itemId;
+ }
+
+ // location not found
+ return null;
+ },
+
+ // handle click event
+ _eventRefresh: function(e)
+ {
+ // identify current item
+ var itemCurrent = $(e.target).closest('.master-item');
+
+ // get identifier
+ if (itemCurrent.length)
+ itemCurrent = itemCurrent.attr('id');
+
+ // check last item
+ if (this.itemLast && this.itemLast != itemCurrent)
+ {
+ var it = this.list[this.itemLast];
+ if (it)
+ if (it.masterReset)
+ it.masterReset();
+ }
+
+ // check if current item is in active state
+ var useBackground = false;
+ if (itemCurrent)
+ {
+ var it = this.list[itemCurrent];
+ if (it)
+ if (it.masterReset)
+ {
+ if (this.itemLast == itemCurrent)
+ useBackground = this.backgroundVisible ? false : true;
+ else
+ useBackground = true;
+ }
+ }
+
+ // decide wether to show/hide background
+ if (useBackground)
+ this.$background.show();
+ else
+ this.$background.hide();
+
+ // backup
+ this.backgroundVisible = useBackground;
+ this.itemLast = itemCurrent;
},
/*
HTML TEMPLATES
*/
+
+ // template item
+ _templateItem: function(id)
+ {
+ return '<div id="' + id + '" class="master-item"></div>';
+ },
- // fill regular modal template
- template: function()
+ // fill template
+ _template: function(options)
{
- return '<div class="iconbar"></div>';
+ return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
+ '<div style="position: relative; right: -50%; float: left;">' +
+ '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
+ '</div>' +
+ '<div class="navbar-brand">' +
+ '<a href="' + options.logo_url + '">' +
+ '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
+ '<span id="brand"> Galaxy ' + options.brand + '</span>' +
+ '</a>' +
+ '</div>' +
+ '<div class="quota-meter-container"></div>' +
+ '<div id="iconbar" class="iconbar"></div>' +
+ '</div>' +
+ '<div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
+ '</div>';
}
});
-// frame manager
+// icon
var GalaxyMasterIcon = Backbone.View.extend(
{
// icon options
@@ -85,6 +206,9 @@
visible : true
},
+ // location identifier for master class
+ masterLocation: 'iconbar',
+
// initialize
initialize: function (options)
{
@@ -93,12 +217,12 @@
this.options = _.defaults(options, this.options);
// add template for icon
- this.setElement($(this.template(this.options)));
+ this.setElement($(this._template(this.options)));
// configure icon
var self = this;
$(this.el).find('.icon').tooltip({title: this.options.tooltip})
- .on('click', self.options.on_click);
+ .on('mouseup', self.options.on_click);
// visiblity
if (!this.options.visible)
@@ -147,7 +271,7 @@
},
// fill template icon
- template: function (options)
+ _template: function (options)
{
var tmpl = '<div id=' + options.id + ' class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
@@ -160,10 +284,210 @@
}
});
+// tab
+var GalaxyMasterTab = Backbone.View.extend(
+{
+ // main options
+ options:
+ {
+ id : '',
+ title : 'Title',
+ target : '_parent',
+ content : '',
+ type : 'url',
+ scratchbook : false,
+ on_unload : null,
+ visible : true
+ },
+
+ // location
+ masterLocation: 'navbar',
+
+ // optional sub menu
+ $menu: null,
+
+ // flag if menu is visible
+ menuVisible: false,
+
+ // events
+ events:
+ {
+ 'click .head' : '_eventClickHead'
+ },
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // update url
+ if (this.options.content && this.options.content.indexOf('//') === -1)
+ this.options.content = galaxy_config.root + this.options.content;
+
+ // add template for tab
+ this.setElement($(this._template(this.options)));
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // add menu item
+ addMenu: function (options)
+ {
+ // menu option defaults
+ var menuOptions = {
+ title : 'Title',
+ content : '',
+ type : 'url',
+ target : '_parent',
+ scratchbook : false,
+ divider : false
+ }
+
+ // read in defaults
+ if (options)
+ menuOptions = _.defaults(options, menuOptions);
+
+ // update url
+ if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
+ menuOptions.content = galaxy_config.root + menuOptions.content;
+
+ // check if submenu element is available
+ if (!this.$menu)
+ {
+ // insert submenu element into root
+ $(this.el).find('.root').append(this._templateMenu());
+
+ // show caret
+ $(this.el).find('.symbol').addClass('caret');
+
+ // update element link
+ this.$menu = $(this.el).find('.menu');
+ }
+
+ // create
+ var $item = $(this._templateMenuItem(menuOptions));
+
+ // append menu
+ this.$menu.append($item);
+
+ // add events
+ var self = this;
+ $item.on('click', function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ self._hideMenu();
+
+ // no modifications if new tab is requested
+ if (self.options.target === '_blank')
+ return true;
+
+ // load into frame
+ Galaxy.frame_manager.frame_new(options);
+ });
+
+ // append divider
+ if (menuOptions.divider)
+ this.$menu.append($(this._templateDivider()));
+ },
+
+ // add reset function called by master
+ masterReset: function()
+ {
+ this._hideMenu();
+ },
+
+ // hide menu
+ _hideMenu: function()
+ {
+ if (this.$menu && this.menuVisible)
+ {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ },
+
+ // show menu on header click
+ _eventClickHead: function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ if (this.$menu)
+ {
+ // show/hide menu
+ if (!this.menuVisible)
+ {
+ this.$menu.show();
+ this.menuVisible = true;
+ } else {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ } else {
+ // open new frame
+ Galaxy.frame_manager.frame_new(this.options);
+ }
+ },
+
+ // fill template header
+ _templateMenuItem: function (options)
+ {
+ return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
+ },
+
+ // fill template header
+ _templateMenu: function ()
+ {
+ return '<ul class="menu dropdown-menu"></ul>';
+ },
+
+ _templateDivider: function()
+ {
+ return '<li class="divider"></li>';
+ },
+
+ // fill template
+ _template: function (options)
+ {
+ // start template
+ var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
+ '<li class="root dropdown" style="">' +
+ '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
+ options.title + '<b class="symbol"></b>' +
+ '</a>' +
+ '</li>' +
+ '</ul>';
+
+ // return template
+ return tmpl;
+ }
+});
+
// return
return {
GalaxyMaster: GalaxyMaster,
- GalaxyMasterIcon : GalaxyMasterIcon
+ GalaxyMasterTab: GalaxyMasterTab,
+ GalaxyMasterIcon: GalaxyMasterIcon
};
});
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.menu.js
--- /dev/null
+++ b/static/scripts/galaxy.menu.js
@@ -0,0 +1,330 @@
+/*
+ galaxy menu
+*/
+
+// dependencies
+define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+
+// frame manager
+var GalaxyMenu = Backbone.Model.extend(
+{
+ // options
+ options: null,
+
+ // link master class
+ master: null,
+
+ // initialize
+ initialize: function(options)
+ {
+ this.options = options.config;
+ this.master = options.master;
+ this.create();
+ },
+
+ // default menu
+ create: function()
+ {
+ //
+ // Analyze data tab.
+ //
+ var tab_analysis = new mod_master.GalaxyMasterTab({
+ title : "Analyze Data",
+ content : "root/index"
+ });
+ this.master.append(tab_analysis);
+
+ //
+ // Workflow tab.
+ //
+ var tab_workflow = new mod_master.GalaxyMasterTab({
+ title : "Workflow",
+ content : "workflow"
+
+ });
+ this.master.append(tab_workflow);
+
+ //
+ // 'Shared Items' or Libraries tab.
+ //
+ var tab_shared = new mod_master.GalaxyMasterTab({
+ title : "Shared Data",
+ content : "library/index"
+ });
+
+ tab_shared.addMenu({
+ title : "Data Libraries",
+ content : "library/index",
+ divider : true
+ });
+
+ tab_shared.addMenu({
+ title : "Published Histories",
+ content : "history/list_published"
+ });
+
+ tab_shared.addMenu({
+ title : "Published Workflows",
+ content : "workflow/list_published"
+
+ });
+
+ tab_shared.addMenu({
+ title : "Published Visualizations",
+ content : "visualization/list_published"
+ });
+
+ tab_shared.addMenu({
+ title : "Published Pages",
+ content : "page/list_published"
+ });
+
+ this.master.append(tab_shared);
+
+ //
+ // Lab menu.
+ //
+ if (this.options.user.requests)
+ {
+ var tab_lab = new mod_master.GalaxyMasterTab({
+ title : "Lab"
+ });
+ tab_lab.addMenu({
+ title : "Sequencing Requests",
+ content : "requests/index"
+ });
+ tab_lab.addMenu({
+ title : "Find Samples",
+ content : "requests/find_samples_index"
+ });
+ tab_lab.addMenu({
+ title : "Help",
+ content : this.options.lims_doc_url
+ });
+ this.master.append(tab_lab);
+ }
+
+ //
+ // Visualization tab.
+ //
+ var tab_visualization = new mod_master.GalaxyMasterTab({
+
+ title : "Visualization",
+ content : "visualization/list"
+ });
+ tab_visualization.addMenu({
+ title : "New Track Browser",
+ content : "visualization/trackster",
+ target : "_frame"
+ });
+ tab_visualization.addMenu({
+ title : "Saved Visualizations",
+ content : "visualization/list",
+ target : "_frame"
+ });
+ this.master.append(tab_visualization);
+
+ //
+ // Cloud menu.
+ //
+ if (this.options.enable_cloud_launch)
+ {
+ var tab_cloud = new mod_master.GalaxyMasterTab({
+ title : "Cloud",
+ content : "cloudlaunch/index"
+ });
+ tab_cloud.addMenu({
+ title : "New Cloud Cluster",
+ content : "cloudlaunch/index"
+ });
+ this.master.append(tab_cloud);
+ }
+
+ //
+ // Admin.
+ //
+ if (this.options.is_admin_user)
+ {
+ var tab_admin = new mod_master.GalaxyMasterTab({
+ title : "Admin",
+ content : "admin/index",
+ extra_class : "admin-only"
+ });
+ this.master.append(tab_admin);
+ }
+
+ //
+ // Help tab.
+ //
+ var tab_help = new mod_master.GalaxyMasterTab({
+ title : "Help"
+ });
+ if (this.options.biostar_url)
+ {
+ tab_help.addMenu({
+ title : "Galaxy Q&A Site",
+ content : this.options.biostar_url_redirect,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Ask a question",
+ content : "biostar/biostar_question_redirect",
+ target : "_blank"
+ });
+ }
+ tab_help.addMenu({
+ title : "Support",
+ content : this.options.support_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Search",
+ content : this.options.search_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Mailing Lists",
+ content : this.options.mailing_lists,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Videos",
+ content : this.options.screencasts_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Wiki",
+ content : this.options.wiki_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "How to Cite Galaxy",
+ content : this.options.citation_url,
+ target : "_blank"
+ });
+ if (!this.options.terms_url)
+ {
+ tab_help.addMenu({
+ title : "Terms and Conditions",
+ content : this.options.terms_url,
+ target : "_blank"
+ });
+ }
+ this.master.append(tab_help);
+
+ //
+ // User tab.
+ //
+ if (!this.options.user.valid)
+ {
+ var tab_user = new mod_master.GalaxyMasterTab({
+ title : "User",
+ extra_class : "loggedout-only"
+ });
+
+ // login
+ if (this.options.allow_user_creation)
+ {
+ tab_user.addMenu({
+ title : "Login",
+ content : "user/login",
+ target : "galaxy_main"
+ });
+ }
+
+ // register
+ if (this.options.allow_user_creation)
+ {
+ tab_user.addMenu({
+ title : "Register",
+ content : "user/create",
+ target : "galaxy_main"
+ });
+ }
+
+ // add to master
+ this.master.append(tab_user);
+ } else {
+ var tab_user = new mod_master.GalaxyMasterTab({
+ title : "User",
+ extra_class : "loggedin-only"
+ });
+
+ // show user logged in info
+ tab_user.addMenu({
+ title : "Logged in as " + this.options.user.email
+ });
+
+ // remote user
+ if (this.options.use_remote_user && this.options.remote_user_logout_href)
+ {
+ tab_user.addMenu({
+ title : "Logout",
+ content : this.options.remote_user_logout_href,
+ target : "_top"
+ });
+ } else {
+ tab_user.addMenu({
+ title : "Preferences",
+ content : "user?cntrller=user",
+ target : "galaxy_main"
+ });
+
+ tab_user.addMenu({
+ title : "Custom Builds",
+ content : "user/dbkeys",
+ target : "galaxy_main"
+ });
+
+ tab_user.addMenu({
+ title : "Logout",
+ content : "user/logout",
+ target : "_top",
+ divider : true
+ });
+ }
+
+ // default tabs
+ tab_user.addMenu({
+ title : "Saved Histories",
+ content : "history/list",
+ target : "galaxy_main"
+ });
+ tab_user.addMenu({
+ title : "Saved Datasets",
+ content : "dataset/list",
+ target : "galaxy_main"
+ });
+ tab_user.addMenu({
+ title : "Saved Pages",
+ content : "page/list",
+ target : "_top"
+ });
+
+ tab_user.addMenu({
+ title : "API Keys",
+ content : "user/api_keys?cntrller=user",
+ target : "galaxy_main"
+ });
+
+ if (this.options.use_remote_user)
+ {
+ tab_user.addMenu({
+ title : "Public Name",
+ content : "user/edit_username?cntrller=user",
+ target : "galaxy_main"
+ });
+ }
+
+ // add to master
+ this.master.append(tab_user);
+ }
+ }
+});
+
+// return
+return {
+ GalaxyMenu: GalaxyMenu
+};
+
+});
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -173,10 +173,10 @@
var self = this;
displayBtnData.onclick = function(){
Galaxy.frame_manager.frame_new({
- title : "Data Viewer: " + self.model.get('name'),
- type : "url",
- location: "center",
- content : self.urls.display
+ title : "Data Viewer: " + self.model.get('name'),
+ type : "url",
+ target : "galaxy_main",
+ content : self.urls.display
});
};
}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -232,9 +232,9 @@
return function(){// add widget
Galaxy.frame_manager.frame_new(
{
- title : "Visualization",
- type : "url",
- content : visualization_url + '/' + visualization + '?' + $.param( params )
+ title : "Visualization",
+ type : "url",
+ content : visualization_url + '/' + visualization + '?' + $.param( params )
});
};
}
@@ -491,10 +491,11 @@
// add widget
Galaxy.frame_manager.frame_new(
{
- title : "Scatterplot",
- type : "url",
- content : url + '/scatterplot?' + $.param(params),
- location : 'center'
+ title : "Scatterplot",
+ type : "url",
+ content : url + '/scatterplot?' + $.param(params),
+ target : 'galaxy_main',
+ scratchbook : true
});
//TODO: this needs to go away
@@ -553,9 +554,10 @@
// add widget
parent.Galaxy.frame_manager.frame_new({
- title : "Trackster",
- type : "url",
- content : vis_url + "/trackster?" + $.param(dataset_params)
+ title : "Trackster",
+ type : "url",
+ content : vis_url + "/trackster?" + $.param(dataset_params),
+ scratchbook : true
});
});
}
@@ -570,9 +572,10 @@
// add widget
parent.Galaxy.frame_manager.frame_new({
- title : "Trackster",
- type : "url",
- content : url
+ title : "Trackster",
+ type : "url",
+ content : url,
+ scratchbook : true
});
}
}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"#everything",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c.event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c.event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this.template());$(this.el).append(this.template_background());$(this.el).append(this.template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this.template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this.panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c.panel_refresh()}})},event:{type:null,target:null,xy:null},events:{mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .frame":"event_frame_mouse_down","mousedown .frame-background":"event_panel_load","mousedown .frame-scroll-up":"event_panel_scroll_up","mousedown .frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.frame_shadow,h);this.frame_insert(this.frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.frame_shadow,c);this.frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this.panel_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this.panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},frame_new:function(d){if(!this.active){if(d.location=="center"){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this.template_frame(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(f.id).css("z-index"));this.frame_list[e]=f;this.frame_counter++;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},template:function(){return'<div class="galaxy-frame"></div>'},template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},template_background:function(){return'<div class="frame-background"></div>'},template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
+define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},frame_new:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/galaxy.master.js
--- a/static/scripts/packed/galaxy.master.js
+++ b/static/scripts/packed/galaxy.master.js
@@ -1,1 +1,1 @@
-define(["libs/backbone/backbone-relational"],function(){var a=Backbone.View.extend({el_master:"#masthead",list:[],initialize:function(d){this.setElement($(this.template()));$(this.el_master).append($(this.el));var c=this;window.onbeforeunload=function(){var f="";for(key in c.list){if(c.list[key].options.on_unload){var e=c.list[key].options.on_unload();if(e){f+=e+" "}}}if(f!=""){return f}}},events:{mousedown:function(c){c.preventDefault()}},append:function(c){$(this.el).append($(c.el));this.list.push(c)},prepend:function(c){$(this.el).prepend($(c.el));this.list.push(c)},template:function(){return'<div class="iconbar"></div>'}});var b=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}this.setElement($(this.template(this.options)));var c=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("click",c.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(c){$(this.el).find(".icon").removeClass(this.options.icon).addClass(c);this.options.icon=c},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(c){$(this.el).find(".number").text(c)},template:function(d){var c="<div id="+d.id+' class="symbol"><div class="icon fa fa-2x '+d.icon+'"></div>';if(d.with_number){c+='<div class="number"></div>'}c+="</div>";return c}});return{GalaxyMaster:a,GalaxyMasterIcon:b}});
\ No newline at end of file
+define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_master:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_master).append($(this.el));this.$background=$(this.el).find("#master-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.masterLocation);if(e){var h="master-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("master-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".master-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.masterReset){g.masterReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.masterReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="master-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var d=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},masterLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var b=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},masterLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame_manager.frame_new(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},masterReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame_manager.frame_new(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMaster:a,GalaxyMasterTab:b,GalaxyMasterIcon:d}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer: "+c.model.get("name"),type:"url",location:"center",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>";if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>";if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1312,7 +1312,7 @@
#masthead .navbar-brand{position:absolute;left:0;top:0;font-family:verdana;font-weight:bold;font-size:20px;line-height:1;color:white;padding:5px 20px 12px;margin-left:-15px;z-index:2000}#masthead .navbar-brand img{display:inline;width:26px;vertical-align:top}
#masthead .navbar-brand a{color:white;text-decoration:none}
#masthead .iconbar{position:absolute;top:5px;right:110px;cursor:pointer;color:#999;overflow:hidden}#masthead .iconbar .symbol{float:left;margin:0px 10px}
-#masthead .iconbar .symbol .number{font-weight:bold;font-size:10px;font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif;position:relative;left:23px;top:-16px}
+#masthead .iconbar .symbol .number{font-weight:bold;font-size:10px;font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif;position:relative;left:23px;top:-12px}
#masthead .iconbar .toggle{color:#BCC800}
.quota-meter-container{position:absolute;top:0;right:0;height:32px}
.quota-meter{position:absolute;top:8px;right:8px;height:16px;width:100px;background-color:#f5f5f5}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/style/src/less/base.less
--- a/static/style/src/less/base.less
+++ b/static/style/src/less/base.less
@@ -440,7 +440,7 @@
font-family : @font-family-sans-serif;
position : relative;
left : 23px;
- top : -16px;
+ top : -12px;
}
.toggle
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -93,15 +93,6 @@
"libs/backbone/backbone-relational": ["libs/backbone/backbone"]
}
});
-
- ## load galaxy js-modules
- require(['galaxy.master', 'galaxy.frame', 'galaxy.modal', 'galaxy.upload'], function(master, frame, modal, upload)
- {
- Galaxy.master = new master.GalaxyMaster();
- Galaxy.frame_manager = new frame.GalaxyFrameManager();
- Galaxy.modal = new modal.GalaxyModal();
- ##Galaxy.upload = new upload.GalaxyUpload();
- });
</script></%def>
This diff is so big that we needed to truncate the remainder.
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: History panel: fix naming bug in purge async error handling
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/151b7d3b2f1b/
Changeset: 151b7d3b2f1b
Branch: stable
User: carlfeberhard
Date: 2013-11-05 17:33:06
Summary: History panel: fix naming bug in purge async error handling
Affected #: 2 files
diff -r 5c789ab4144ac9db6c91b5646032894cae016309 -r 151b7d3b2f1b8cf4ba6050214693eee776410574 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -58,7 +58,7 @@
xhr.error( function( error, status, message ){
//TODO: Exception messages are hidden within error page
//!NOTE: that includes the 'Removal of datasets by users is not allowed in this Galaxy instance.'
- view.trigger( 'error',
+ hdaView.trigger( 'error',
hdaView, xhr, { url: purge_url }, _l( "Unable to purge this dataset" ) );
});
});
diff -r 5c789ab4144ac9db6c91b5646032894cae016309 -r 151b7d3b2f1b8cf4ba6050214693eee776410574 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){view.trigger("error",a,f,{url:b},_l("Unable to purge this dataset"))})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_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_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.trigger("error",a,null,null,{url:b},_l("deletion failed"));a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:f+"/"+h+"?"+$.param(g)})}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",a,g,{url:a.urls.tags.get},_l("Tagging failed"))},success:function(e){b.html(e);b.find("[title]").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(c){this.log(this+".loadAndDisplayAnnotation",c);var a=this,e=this.$el.find(".annotation-area"),d=e.find(".annotation-elt"),b=this.urls.annotation.set;if(e.is(":hidden")){if(!jQuery.trim(d.html())){$.ajax({url:this.urls.annotation.get,error:function(h,f,g){a.log("Annotation failed",h,f,g);a.trigger("error",a,h,{url:a.urls.annotation.get},_l("Annotation failed"))},success:function(f){if(f===""){f="<em>"+_l("Describe or add notes to dataset")+"</em>"}d.html(f);e.find("[title]").tooltip();async_save_text(d.attr("id"),d.attr("id"),b,"new_annotation",18,true,4);e.slideDown("fast")}})}else{e.slideDown("fast")}}else{e.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:a+"/scatterplot?"+$.param(b),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){f.Galaxy.modal.hide()},"View in saved visualization":function(){f.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:e,buttons:{Cancel:function(){f.Galaxy.modal.hide()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){f.Galaxy.modal.hide();var g=$(this).val();c.id=g;f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})})}}})},"View in new visualization":function(){f.Galaxy.modal.hide();var g=a+"/trackster?"+$.param(c);f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g})}}})}});return false}};
\ No newline at end of file
+var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){a.trigger("error",a,f,{url:b},_l("Unable to purge this dataset"))})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_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_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.trigger("error",a,null,null,{url:b},_l("deletion failed"));a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:f+"/"+h+"?"+$.param(g)})}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",a,g,{url:a.urls.tags.get},_l("Tagging failed"))},success:function(e){b.html(e);b.find("[title]").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(c){this.log(this+".loadAndDisplayAnnotation",c);var a=this,e=this.$el.find(".annotation-area"),d=e.find(".annotation-elt"),b=this.urls.annotation.set;if(e.is(":hidden")){if(!jQuery.trim(d.html())){$.ajax({url:this.urls.annotation.get,error:function(h,f,g){a.log("Annotation failed",h,f,g);a.trigger("error",a,h,{url:a.urls.annotation.get},_l("Annotation failed"))},success:function(f){if(f===""){f="<em>"+_l("Describe or add notes to dataset")+"</em>"}d.html(f);e.find("[title]").tooltip();async_save_text(d.attr("id"),d.attr("id"),b,"new_annotation",18,true,4);e.slideDown("fast")}})}else{e.slideDown("fast")}}else{e.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:a+"/scatterplot?"+$.param(b),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){f.Galaxy.modal.hide()},"View in saved visualization":function(){f.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:e,buttons:{Cancel:function(){f.Galaxy.modal.hide()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){f.Galaxy.modal.hide();var g=$(this).val();c.id=g;f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})})}}})},"View in new visualization":function(){f.Galaxy.modal.hide();var g=a+"/trackster?"+$.param(c);f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g})}}})}});return false}};
\ 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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b8eb9c6131fe/
Changeset: b8eb9c6131fe
Branch: mapped_str_update_in_filter1
User: BjoernGruening
Date: 2013-10-25 10:34:28
Summary: add [ and ] to mapped strings and advanced filters
Affected #: 1 file
diff -r d57971b60b8d907c33bf4dfc1bba2432baaf96e9 -r b8eb9c6131feca3b270cad3cceb2335f5c6f4244 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -48,6 +48,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
https://bitbucket.org/galaxy/galaxy-central/commits/a6452bf916e3/
Changeset: a6452bf916e3
User: jmchilton
Date: 2013-11-05 06:42:06
Summary: Merge Pull Request #244.
Affected #: 1 file
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r a6452bf916e388d7ae49bc3a6cc4565332e74724 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -174,6 +174,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
https://bitbucket.org/galaxy/galaxy-central/commits/5986d0a2628f/
Changeset: 5986d0a2628f
Branch: mapped_str_update_in_filter1
User: jmchilton
Date: 2013-11-05 06:43:22
Summary: Close branch mapped_str_update_in_filter1
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/c67b9518c1e0/
Changeset: c67b9518c1e0
User: jmchilton
Date: 2013-11-05 06:48:18
Summary: Merge.
Affected #: 1 file
diff -r 815129b821b624f3ef4c61e13546d0d3e17e7f93 -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -174,6 +174,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bcd8ece8aebe/
Changeset: bcd8ece8aebe
Branch: r_environment_enhancement
User: BjoernGruening
Date: 2013-10-31 10:45:09
Summary: allow more actions after setup_r_environment
Affected #: 1 file
diff -r d57971b60b8d907c33bf4dfc1bba2432baaf96e9 -r bcd8ece8aebe27ed06468d7cf3eb6dfa9dda6293 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -347,6 +347,7 @@
# <!-- allow installing an R packages -->
# <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGe…</package>
# </action>
+ filtered_actions = actions[ 1: ]
if action_dict.get( 'env_shell_file_paths', False ):
install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] )
https://bitbucket.org/galaxy/galaxy-central/commits/815129b821b6/
Changeset: 815129b821b6
User: jmchilton
Date: 2013-11-05 06:47:04
Summary: Merged in BjoernGruening/galaxy-central-bgruening/r_environment_enhancement (pull request #249)
allow more actions after setup_r_environment
Affected #: 1 file
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r 815129b821b624f3ef4c61e13546d0d3e17e7f93 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -347,6 +347,7 @@
# <!-- allow installing an R packages -->
# <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGe…</package>
# </action>
+ filtered_actions = actions[ 1: ]
if action_dict.get( 'env_shell_file_paths', False ):
install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e094c73fed4d/
Changeset: e094c73fed4d
Branch: stable
User: jmchilton
Date: 2013-11-04 20:55:00
Summary: White-list expressions executed by filtering and dna_filtering tools.
Affected #: 2 files
diff -r 1f0e7ae9e324fcc1e12105651269016f2edb925f -r e094c73fed4dc66b589932edb83412cb8b827cd3 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 1f0e7ae9e324fcc1e12105651269016f2edb925f -r e094c73fed4dc66b589932edb83412cb8b827cd3 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/f79149dd3d35/
Changeset: f79149dd3d35
Branch: next-stable
User: natefoo
Date: 2013-11-04 20:56:17
Summary: Merge security fix for filtering tools from stable.
Affected #: 2 files
diff -r 2be3aed79643555879b1b5154449872bcd6447da -r f79149dd3d35909bf3d6332750b62823fe146034 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 2be3aed79643555879b1b5154449872bcd6447da -r f79149dd3d35909bf3d6332750b62823fe146034 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/c458a0fe1ba8/
Changeset: c458a0fe1ba8
User: natefoo
Date: 2013-11-04 20:56:57
Summary: Merge security fix for filtering tools from stable/next-stable.
Affected #: 2 files
diff -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 -r c458a0fe1ba816098fed03370f425f346bb1df68 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 -r c458a0fe1ba816098fed03370f425f346bb1df68 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/740e7adcbaa4/
Changeset: 740e7adcbaa4
Branch: next-stable
User: natefoo
Date: 2013-11-04 20:57:29
Summary: Close next-stable branch.
Affected #: 0 files
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: History panel: remove refs to urls.tags
by commits-noreply@bitbucket.org 02 Nov '13
by commits-noreply@bitbucket.org 02 Nov '13
02 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6d633418ecfa/
Changeset: 6d633418ecfa
User: carlfeberhard
Date: 2013-11-02 17:41:18
Summary: History panel: remove refs to urls.tags
Affected #: 2 files
diff -r 68c80bac0d4d71854526f6e56156f09b46059205 -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -298,7 +298,7 @@
* @returns {jQuery} rendered DOM
*/
_render_tagButton : function(){
- if( !this.hasUser || !this.urls.tags.get ){
+ if( !this.hasUser ){
return null;
}
@@ -320,7 +320,7 @@
* @returns {jQuery} rendered DOM
*/
_render_annotateButton : function(){
- if( !this.hasUser || !this.urls.annotation.get ){
+ if( !this.hasUser ){
return null;
}
diff -r 68c80bac0d4d71854526f6e56156f09b46059205 -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser||!this.urls.tags.get){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser||!this.urls.annotation.get){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ 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