mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
History & collections: client-side file and class renaming: - li: readonly list item view, - li-edit: editable list item view, - primary identity first (eg. hda-*), - moved hda/hdca into history directory; Fix bug for dataset URLs
This commit is contained in:
+7
-13
@@ -1,8 +1,7 @@
|
||||
define([
|
||||
"mvc/dataset/states",
|
||||
"mvc/collection/dataset-collection-base",
|
||||
"mvc/collection/collection-li",
|
||||
"utils/localization"
|
||||
], function( STATES, DC_BASE_VIEW, _l ){
|
||||
], function( DC_LI, _l ){
|
||||
//==============================================================================
|
||||
/*
|
||||
|
||||
@@ -11,29 +10,24 @@ NOTE: not much going on here. Until we find out what operations a user will need
|
||||
|
||||
*/
|
||||
//==============================================================================
|
||||
var _super = DC_BASE_VIEW.DCBaseView;
|
||||
/** @class Editing view for DatasetCollection.
|
||||
* @name DatasetCollectionEditView
|
||||
*
|
||||
* @augments DCBaseView
|
||||
* @constructs
|
||||
var _super = DC_LI.DCListItemView;
|
||||
/** @class Editing view for DatasetCollectionElement.
|
||||
*/
|
||||
var DCEditView = _super.extend({
|
||||
var DCEListItemEdit = _super.extend({
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
//logger : console,
|
||||
|
||||
// ......................................................................... misc
|
||||
/** string rep */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'DCEditView(' + modelString + ')';
|
||||
return 'DCEListItemEdit(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
DCEditView : DCEditView
|
||||
DCEListItemEdit : DCEListItemEdit
|
||||
};
|
||||
});
|
||||
+25
-24
@@ -1,5 +1,5 @@
|
||||
define([
|
||||
"mvc/dataset/dataset-list-element",
|
||||
"mvc/dataset/dataset-li",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DATASET_LI, BASE_MVC, _l ){
|
||||
@@ -8,7 +8,7 @@ define([
|
||||
var ListItemView = BASE_MVC.ListItemView;
|
||||
/** @class Read only view for DatasetCollection.
|
||||
*/
|
||||
var DCBaseView = ListItemView.extend({
|
||||
var DCListItemView = ListItemView.extend({
|
||||
//TODO: may not be needed
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
@@ -22,7 +22,7 @@ var DCBaseView = ListItemView.extend({
|
||||
/** set up */
|
||||
initialize : function( attributes ){
|
||||
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
|
||||
this.log( 'DCBaseView.initialize:', attributes );
|
||||
this.log( this + '(DCListItemView).initialize:', attributes );
|
||||
ListItemView.prototype.initialize.call( this, attributes );
|
||||
},
|
||||
|
||||
@@ -60,13 +60,13 @@ var DCBaseView = ListItemView.extend({
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'DCBaseView(' + modelString + ')';
|
||||
return 'DCListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
DCBaseView.prototype.templates = (function(){
|
||||
DCListItemView.prototype.templates = (function(){
|
||||
|
||||
// use element identifier
|
||||
var titleBarTemplate = BASE_MVC.wrapTemplate([
|
||||
@@ -87,8 +87,8 @@ DCBaseView.prototype.templates = (function(){
|
||||
//==============================================================================
|
||||
/** @class Read only view for DatasetCollectionElement.
|
||||
*/
|
||||
var DCEBaseView = ListItemView.extend({
|
||||
//TODO: this might be expendable - compacted with HDADCEBaseView
|
||||
var DCEListItemView = ListItemView.extend({
|
||||
//TODO: this might be expendable - compacted with HDAListItemView
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
@@ -102,7 +102,7 @@ var DCEBaseView = ListItemView.extend({
|
||||
/** */
|
||||
initialize : function( attributes ){
|
||||
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
|
||||
this.log( 'DCEBaseView.initialize:', attributes );
|
||||
this.log( 'DCEListItemView.initialize:', attributes );
|
||||
ListItemView.prototype.initialize.call( this, attributes );
|
||||
},
|
||||
|
||||
@@ -110,13 +110,13 @@ var DCEBaseView = ListItemView.extend({
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'DCEBaseView(' + modelString + ')';
|
||||
return 'DCEListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
DCEBaseView.prototype.templates = (function(){
|
||||
DCEListItemView.prototype.templates = (function(){
|
||||
|
||||
// use the element identifier here - since that will persist and the user will need it
|
||||
var titleBarTemplate = BASE_MVC.wrapTemplate([
|
||||
@@ -135,20 +135,20 @@ DCEBaseView.prototype.templates = (function(){
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/** @class Read only view for a DatasetCollectionElement that is also an HDA.
|
||||
/** @class Read only view for a DatasetCollectionElement that is also an DatasetAssociation
|
||||
* (a dataset contained in a dataset collection).
|
||||
*/
|
||||
var DatasetDCEBaseView = DATASET_LI.DatasetListItemView.extend({
|
||||
var DatasetDCEListItemView = DATASET_LI.DatasetListItemView.extend({
|
||||
|
||||
className : DATASET_LI.DatasetListItemView.prototype.className + " dataset-collection-element",
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
//logger : console,
|
||||
|
||||
/** */
|
||||
initialize : function( attributes ){
|
||||
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
|
||||
this.log( 'DatasetDCEBaseView.initialize:', attributes );
|
||||
this.log( 'DatasetDCEListItemView.initialize:', attributes );
|
||||
DATASET_LI.DatasetListItemView.prototype.initialize.call( this, attributes );
|
||||
},
|
||||
|
||||
@@ -156,13 +156,13 @@ var DatasetDCEBaseView = DATASET_LI.DatasetListItemView.extend({
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'DatasetDCEBaseView(' + modelString + ')';
|
||||
return 'DatasetDCEListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
DatasetDCEBaseView.prototype.templates = (function(){
|
||||
DatasetDCEListItemView.prototype.templates = (function(){
|
||||
|
||||
// use the element identifier here and not the dataset name
|
||||
//TODO:?? can we steal the DCE titlebar?
|
||||
@@ -180,13 +180,14 @@ DatasetDCEBaseView.prototype.templates = (function(){
|
||||
});
|
||||
}());
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/** @class Read only view for a DatasetCollectionElement that is also a DatasetCollection
|
||||
* (a nested DC).
|
||||
*/
|
||||
var NestedDCDCEBaseView = DCBaseView.extend({
|
||||
var NestedDCDCEListItemView = DCListItemView.extend({
|
||||
|
||||
className : DCBaseView.prototype.className + " dataset-collection-element",
|
||||
className : DCListItemView.prototype.className + " dataset-collection-element",
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
@@ -194,7 +195,7 @@ var NestedDCDCEBaseView = DCBaseView.extend({
|
||||
|
||||
/** In this override, add the state as a class for use with state-based CSS */
|
||||
_swapNewRender : function( $newRender ){
|
||||
DATASET_LI.DatasetListItemView.prototype._swapNewRender.call( this, $newRender );
|
||||
DCListItemView.prototype._swapNewRender.call( this, $newRender );
|
||||
//TODO: model currently has no state
|
||||
var state = this.model.get( 'state' ) || 'ok';
|
||||
//if( this.model.has( 'state' ) ){
|
||||
@@ -207,16 +208,16 @@ var NestedDCDCEBaseView = DCBaseView.extend({
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'NestedDCDCEBaseView(' + modelString + ')';
|
||||
return 'NestedDCDCEListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
DCBaseView : DCBaseView,
|
||||
DCEBaseView : DCEBaseView,
|
||||
DatasetDCEBaseView : DatasetDCEBaseView,
|
||||
NestedDCDCEBaseView : NestedDCDCEBaseView
|
||||
DCListItemView : DCListItemView,
|
||||
DCEListItemView : DCEListItemView,
|
||||
DatasetDCEListItemView : DatasetDCEListItemView,
|
||||
NestedDCDCEListItemView : NestedDCDCEListItemView
|
||||
};
|
||||
});
|
||||
@@ -2,7 +2,7 @@ define([
|
||||
"mvc/dataset/dataset-model",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DATASET, BASE_MVC, _l ){
|
||||
], function( DATASET_MODEL, BASE_MVC, _l ){
|
||||
//==============================================================================
|
||||
/*
|
||||
Notes:
|
||||
@@ -118,13 +118,13 @@ var DCECollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
//==============================================================================
|
||||
/** @class Backbone model for a dataset collection element that is a dataset (HDA).
|
||||
*/
|
||||
var DatasetDCE = DATASET.DatasetAssociation.extend( BASE_MVC.mixin( DatasetCollectionElementMixin,
|
||||
var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( BASE_MVC.mixin( DatasetCollectionElementMixin,
|
||||
/** @lends DatasetDCE.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
|
||||
defaults : _.extend( {}, DATASET.DatasetAssociation.prototype.defaults, DatasetCollectionElementMixin.defaults ),
|
||||
defaults : _.extend( {}, DATASET_MODEL.DatasetAssociation.prototype.defaults, DatasetCollectionElementMixin.defaults ),
|
||||
|
||||
// because all objects have constructors (as this hashmap would even if this next line wasn't present)
|
||||
// the constructor in hcontentMixin won't be attached by BASE_MVC.mixin to this model
|
||||
@@ -132,7 +132,7 @@ var DatasetDCE = DATASET.DatasetAssociation.extend( BASE_MVC.mixin( DatasetColle
|
||||
/** call the mixin constructor */
|
||||
constructor : function( attributes, options ){
|
||||
this.debug( '\t DatasetDCE.constructor:', attributes, options );
|
||||
//DATASET.DatasetAssociation.prototype.constructor.call( this, attributes, options );
|
||||
//DATASET_MODEL.DatasetAssociation.prototype.constructor.call( this, attributes, options );
|
||||
DatasetCollectionElementMixin.constructor.call( this, attributes, options );
|
||||
},
|
||||
|
||||
@@ -140,7 +140,7 @@ var DatasetDCE = DATASET.DatasetAssociation.extend( BASE_MVC.mixin( DatasetColle
|
||||
/** set up */
|
||||
initialize : function( attributes, options ){
|
||||
this.debug( this + '(DatasetDCE).initialize:', attributes, options );
|
||||
DATASET.DatasetAssociation.prototype.initialize.call( this, attributes, options );
|
||||
DATASET_MODEL.DatasetAssociation.prototype.initialize.call( this, attributes, options );
|
||||
},
|
||||
|
||||
/** String representation. */
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
define([
|
||||
"mvc/collection/dataset-collection-base",
|
||||
"mvc/collection/collection-model",
|
||||
"mvc/collection/collection-li",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DC_BASE, BASE_MVC, _l ){
|
||||
], function( DC_MODEL, DC_LI, BASE_MVC, _l ){
|
||||
/* =============================================================================
|
||||
TODO:
|
||||
|
||||
============================================================================= */
|
||||
// =============================================================================
|
||||
/** @class non-editable, read-only View/Controller for a dataset collection.
|
||||
* @name CollectionPanel
|
||||
*
|
||||
* @augments Backbone.View
|
||||
* @borrows LoggableMixin#logger as #logger
|
||||
* @borrows LoggableMixin#log as #log
|
||||
* @constructs
|
||||
*/
|
||||
var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
/** @lends CollectionPanel.prototype */{
|
||||
@@ -29,8 +24,8 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
/** (in ms) that jquery effects will use */
|
||||
fxSpeed : 'fast',
|
||||
|
||||
DatasetDCEViewClass : DC_BASE.DatasetDCEBaseView,
|
||||
NestedDCEViewClass : DC_BASE.NestedDCEBaseView,
|
||||
DatasetDCEViewClass : DC_LI.DatasetDCEListItemView,
|
||||
NestedDCDCEViewClass : DC_LI.NestedDCDCEListItemView,
|
||||
|
||||
// ......................................................................... SET UP
|
||||
/** Set up the view, set up storage, bind listeners to HistoryContents events
|
||||
@@ -44,9 +39,13 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
}
|
||||
this.log( this + '.initialize:', attributes );
|
||||
|
||||
this.linkTarget = attributes.linkTarget || '_blank';
|
||||
|
||||
this.hasUser = attributes.hasUser;
|
||||
this.panelStack = [];
|
||||
this.parentName = attributes.parentName;
|
||||
|
||||
//window.collectionPanel = this;
|
||||
},
|
||||
|
||||
/** create any event listeners for the panel
|
||||
@@ -70,7 +69,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ panel rendering
|
||||
/** Render urls, historyPanel body, and hdas (if any are shown)
|
||||
/** Render panel
|
||||
* @fires: rendered when the panel is attached and fully visible
|
||||
* @see Backbone.View#render
|
||||
*/
|
||||
@@ -122,7 +121,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
return this;
|
||||
},
|
||||
|
||||
/** render with history data
|
||||
/** render with collection data
|
||||
* @returns {jQuery} dom fragment as temporary container to be swapped out later
|
||||
*/
|
||||
renderModel : function( ){
|
||||
@@ -139,7 +138,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
return $newRender;
|
||||
},
|
||||
|
||||
/** Set up HistoryPanel js/widget behaviours */
|
||||
/** Set up js/widget behaviours */
|
||||
_setUpBehaviours : function( $where ){
|
||||
//TODO: these should be either sub-MVs, or handled by events
|
||||
$where = $where || this.$el;
|
||||
@@ -152,16 +151,16 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
$container : function(){
|
||||
return ( this.findContainerFn )?( this.findContainerFn.call( this ) ):( this.$el.parent() );
|
||||
},
|
||||
/** where hdaViews are attached */
|
||||
/** where list content views are attached */
|
||||
$datasetsList : function( $where ){
|
||||
return ( $where || this.$el ).find( '.datasets-list' );
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ sub-views
|
||||
/** Set up/render a view for each HDA to be shown, init with model and listeners.
|
||||
* HDA views are cached to the map this.hdaViews (using the model.id as key).
|
||||
* @param {jQuery} $whereTo what dom element to prepend the HDA views to
|
||||
* @returns the number of visible hda views
|
||||
/** Set up/render a view for each DCE to be shown, init with model and listeners.
|
||||
* DCE views are cached to the map this.contentViews (using the model.id as key).
|
||||
* @param {jQuery} $whereTo what dom element to prepend the DCE views to
|
||||
* @returns the number of visible DCE views
|
||||
*/
|
||||
renderContents : function( $whereTo ){
|
||||
//this.debug( 'renderContents, elements:', this.model.elements );
|
||||
@@ -172,7 +171,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
contentViews = {},
|
||||
//NOTE: no filtering here
|
||||
visibleContents = this.model.getVisibleContents();
|
||||
this.log( 'renderContents, visibleContents:', visibleContents, $whereTo );
|
||||
//this.debug( 'renderContents, visibleContents:', visibleContents, $whereTo );
|
||||
|
||||
this.$datasetsList( $whereTo ).empty();
|
||||
if( visibleContents && visibleContents.length ){
|
||||
@@ -192,8 +191,8 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
//this.debug( 'content json:', JSON.stringify( content, null, ' ' ) );
|
||||
var contentView = null,
|
||||
ContentClass = this._getContentClass( content );
|
||||
this.debug( 'ContentClass:', ContentClass );
|
||||
this.debug( 'content:', content );
|
||||
//this.debug( 'content:', content );
|
||||
//this.debug( 'ContentClass:', ContentClass );
|
||||
contentView = new ContentClass({
|
||||
model : content,
|
||||
linkTarget : this.linkTarget,
|
||||
@@ -201,20 +200,20 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
hasUser : this.hasUser,
|
||||
logger : this.logger
|
||||
});
|
||||
this.debug( 'contentView:', contentView );
|
||||
//this.debug( 'contentView:', contentView );
|
||||
this._setUpContentListeners( contentView );
|
||||
return contentView;
|
||||
},
|
||||
|
||||
/** */
|
||||
_getContentClass : function( content ){
|
||||
this.debug( this + '._getContentClass:', content );
|
||||
this.debug( 'DCEViewClass:', this.DCEViewClass );
|
||||
//this.debug( this + '._getContentClass:', content );
|
||||
//TODO: subclasses use DCEViewClass - but are currently unused - decide
|
||||
switch( content.get( 'element_type' ) ){
|
||||
case 'hda':
|
||||
return this.DCEViewClass;
|
||||
return this.DatasetDCEViewClass;
|
||||
case 'dataset_collection':
|
||||
return this.DCEViewClass;
|
||||
return this.NestedDCDCEViewClass;
|
||||
}
|
||||
throw new TypeError( 'Unknown element type:', content.get( 'element_type' ) );
|
||||
},
|
||||
@@ -232,14 +231,16 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
|
||||
/** */
|
||||
_addCollectionPanel : function( collectionView ){
|
||||
//TODO: a bit hackish
|
||||
var currPanel = this,
|
||||
collectionModel = collectionView.model;
|
||||
|
||||
this.debug( 'collection panel (stack), collectionView:', collectionView );
|
||||
this.debug( 'collection panel (stack), collectionModel:', collectionModel );
|
||||
//this.debug( 'collection panel (stack), collectionView:', collectionView );
|
||||
//this.debug( 'collection panel (stack), collectionModel:', collectionModel );
|
||||
var panel = new PairCollectionPanel({
|
||||
model : collectionModel,
|
||||
parentName : this.model.get( 'name' )
|
||||
parentName : this.model.get( 'name' ),
|
||||
linkTarget : this.linkTarget
|
||||
});
|
||||
currPanel.panelStack.push( panel );
|
||||
|
||||
@@ -277,7 +278,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
'click .navigation .back' : 'close'
|
||||
},
|
||||
|
||||
/** */
|
||||
/** close/remove this collection panel */
|
||||
close : function( event ){
|
||||
this.$el.remove();
|
||||
this.trigger( 'close' );
|
||||
@@ -334,7 +335,8 @@ CollectionPanel.templates = CollectionPanel.prototype.templates = (function(){
|
||||
/** @class non-editable, read-only View/Controller for a dataset collection. */
|
||||
var ListCollectionPanel = CollectionPanel.extend({
|
||||
|
||||
DCEViewClass : DC_BASE.DatasetDCEBaseView,
|
||||
//TODO: not strictly needed - due to switch in CollectionPanel._getContentClass
|
||||
DatasetDCEViewClass : DC_LI.DatasetDCEListItemView,
|
||||
|
||||
// ........................................................................ misc
|
||||
/** string rep */
|
||||
@@ -360,7 +362,8 @@ var PairCollectionPanel = ListCollectionPanel.extend({
|
||||
/** @class non-editable, read-only View/Controller for a dataset collection. */
|
||||
var ListOfPairsCollectionPanel = CollectionPanel.extend({
|
||||
|
||||
DCEViewClass : DC_BASE.NestedDCDCEBaseView,
|
||||
//TODO: not strictly needed - due to switch in CollectionPanel._getContentClass
|
||||
NestedDCDCEViewClass : DC_LI.NestedDCDCEListItemView,
|
||||
|
||||
// ........................................................................ misc
|
||||
/** string rep */
|
||||
|
||||
+5
-11
@@ -1,6 +1,6 @@
|
||||
define([
|
||||
"mvc/dataset/states",
|
||||
"mvc/dataset/dataset-list-element",
|
||||
"mvc/dataset/dataset-li",
|
||||
"mvc/tags",
|
||||
"mvc/annotations",
|
||||
"mvc/base-mvc",
|
||||
@@ -9,15 +9,9 @@ define([
|
||||
//==============================================================================
|
||||
var _super = DATASET_LI.DatasetListItemView;
|
||||
/** @class Editing view for DatasetAssociation.
|
||||
* @name EditableDatasetListItemView
|
||||
*
|
||||
* @augments HDABaseView
|
||||
* @borrows LoggableMixin#logger as #logger
|
||||
* @borrows LoggableMixin#log as #log
|
||||
* @constructs
|
||||
*/
|
||||
var EditableDatasetListItemView = _super.extend(
|
||||
/** @lends EditableDatasetListItemView.prototype */{
|
||||
var DatasetListItemEdit = _super.extend(
|
||||
/** @lends DatasetListItemEdit.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
@@ -285,7 +279,7 @@ var EditableDatasetListItemView = _super.extend(
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
EditableDatasetListItemView.prototype.templates = (function(){
|
||||
DatasetListItemEdit.prototype.templates = (function(){
|
||||
//TODO: move to require text! plugin
|
||||
|
||||
var warnings = _.extend( {}, _super.prototype.templates.warnings, {
|
||||
@@ -352,6 +346,6 @@ EditableDatasetListItemView.prototype.templates = (function(){
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
EditableDatasetListItemView : EditableDatasetListItemView
|
||||
DatasetListItemEdit : DatasetListItemEdit
|
||||
};
|
||||
});
|
||||
-1
@@ -13,7 +13,6 @@ var DatasetListItemView = _super.extend(
|
||||
/** @lends DatasetListItemView.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
//logger : console,
|
||||
|
||||
className : _super.prototype.className + " dataset",
|
||||
@@ -74,11 +74,10 @@ var DatasetAssociation = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
|
||||
'meta_download' : 'dataset/get_metadata_file?hda_id=' + id + '&metadata_name='
|
||||
};
|
||||
//TODO: global
|
||||
if( galaxy_config && galaxy_config.root ){
|
||||
_.each( urls, function( key, value ){
|
||||
urls[ key ] = galaxy_config.root + value;
|
||||
});
|
||||
}
|
||||
var root = ( galaxy_config && galaxy_config.root )?( galaxy_config.root ):( '/' );
|
||||
_.each( urls, function( value, key ){
|
||||
urls[ key ] = root + value;
|
||||
});
|
||||
this.urls = urls;
|
||||
return urls;
|
||||
},
|
||||
|
||||
+11
-11
@@ -1,15 +1,15 @@
|
||||
define([
|
||||
"mvc/dataset/editable-dataset-list-element",
|
||||
"mvc/dataset/hda-base",
|
||||
"mvc/dataset/dataset-li-edit",
|
||||
"mvc/history/hda-li",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DATASET_EDIT, HDA_BASE, BASE_MVC, _l ){
|
||||
], function( DATASET_LI_EDIT, HDA_LI, BASE_MVC, _l ){
|
||||
//==============================================================================
|
||||
var _super = DATASET_EDIT.EditableDatasetListItemView;
|
||||
var _super = DATASET_LI_EDIT.DatasetListItemEdit;
|
||||
/** @class Editing view for HistoryDatasetAssociation.
|
||||
*/
|
||||
var HDAEditView = _super.extend(
|
||||
/** @lends HDAEditView.prototype */{
|
||||
var HDAListItemEdit = _super.extend(
|
||||
/** @lends HDAListItemEdit.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
@@ -26,14 +26,14 @@ var HDAEditView = _super.extend(
|
||||
/** string rep */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'HDAEditView(' + modelString + ')';
|
||||
return 'HDAListItemEdit(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
HDAEditView.prototype.templates = (function(){
|
||||
HDAListItemEdit.prototype.templates = (function(){
|
||||
//TODO: move to require text! plugin
|
||||
|
||||
var warnings = _.extend( {}, _super.prototype.templates.warnings, {
|
||||
@@ -49,8 +49,8 @@ HDAEditView.prototype.templates = (function(){
|
||||
});
|
||||
|
||||
return _.extend( {}, _super.prototype.templates, {
|
||||
//NOTE: *steal* the HDABaseView titleBar
|
||||
titleBar : HDA_BASE.HDABaseView.prototype.templates.titleBar,
|
||||
//NOTE: *steal* the HDAListItemView titleBar
|
||||
titleBar : HDA_LI.HDAListItemView.prototype.templates.titleBar,
|
||||
warnings : warnings
|
||||
});
|
||||
}());
|
||||
@@ -58,6 +58,6 @@ HDAEditView.prototype.templates = (function(){
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HDAEditView : HDAEditView
|
||||
HDAListItemEdit : HDAListItemEdit
|
||||
};
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
define([
|
||||
"mvc/dataset/dataset-list-element",
|
||||
"mvc/dataset/dataset-li",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DATASET_LI, BASE_MVC, _l ){
|
||||
@@ -11,8 +11,8 @@ var _super = DATASET_LI.DatasetListItemView;
|
||||
* the primary thing this class does (currently) is override templates
|
||||
* to render the HID.
|
||||
*/
|
||||
var HDABaseView = _super.extend(
|
||||
/** @lends HDABaseView.prototype */{
|
||||
var HDAListItemView = _super.extend(
|
||||
/** @lends HDAListItemView.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
@@ -27,13 +27,13 @@ var HDABaseView = _super.extend(
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'HDABaseView(' + modelString + ')';
|
||||
return 'HDAListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
// ............................................................................ TEMPLATES
|
||||
/** underscore templates */
|
||||
HDABaseView.prototype.templates = (function(){
|
||||
HDAListItemView.prototype.templates = (function(){
|
||||
//TODO: move to require text! plugin
|
||||
|
||||
var titleBarTemplate = BASE_MVC.wrapTemplate([
|
||||
@@ -69,6 +69,6 @@ HDABaseView.prototype.templates = (function(){
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HDABaseView : HDABaseView
|
||||
HDAListItemView : HDAListItemView
|
||||
};
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
define([
|
||||
"mvc/dataset/dataset-model",
|
||||
"mvc/history/history-content-base",
|
||||
"mvc/history/history-content-model",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( DATASET, HISTORY_CONTENT, BASE_MVC, _l ){
|
||||
@@ -13,7 +13,6 @@ var HistoryDatasetAssociation = _super.extend( BASE_MVC.mixin( hcontentMixin,
|
||||
/** @lends HistoryDatasetAssociation.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
// comment this out to suppress log output
|
||||
//logger : console,
|
||||
|
||||
// because all objects have constructors (as this hashmap would even if this next line wasn't present)
|
||||
+6
-6
@@ -1,13 +1,13 @@
|
||||
define([
|
||||
"mvc/dataset/states",
|
||||
"mvc/collection/hdca-base",
|
||||
"mvc/history/hdca-li",
|
||||
"utils/localization"
|
||||
], function( STATES, HDCA_BASE, _l ){
|
||||
], function( STATES, HDCA_LI, _l ){
|
||||
//==============================================================================
|
||||
var _super = HDCA_BASE.HDCABaseView;
|
||||
var _super = HDCA_LI.HDCAListItemView;
|
||||
/** @class Editing view for HistoryDatasetCollectionAssociation.
|
||||
*/
|
||||
var HDCAEditView = _super.extend({
|
||||
var HDCAListItemEdit = _super.extend({
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
@@ -44,12 +44,12 @@ var HDCAEditView = _super.extend({
|
||||
/** string rep */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'HDCAEditView(' + modelString + ')';
|
||||
return 'HDCAListItemEdit(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HDCAEditView : HDCAEditView
|
||||
HDCAListItemEdit : HDCAListItemEdit
|
||||
};
|
||||
});
|
||||
@@ -1,15 +1,15 @@
|
||||
define([
|
||||
"mvc/dataset/states",
|
||||
"mvc/collection/dataset-collection-base",
|
||||
"mvc/collection/collection-li",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( STATES, DC_BASE, BASE_MVC, _l ){
|
||||
], function( STATES, DC_LI, BASE_MVC, _l ){
|
||||
/* global Backbone */
|
||||
//==============================================================================
|
||||
var _super = DC_BASE.DCBaseView;
|
||||
var _super = DC_LI.DCListItemView;
|
||||
/** @class Read only view for HistoryDatasetCollectionAssociation (a dataset collection inside a history).
|
||||
*/
|
||||
var HDCABaseView = _super.extend({
|
||||
var HDCAListItemView = _super.extend({
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
@@ -33,12 +33,12 @@ var HDCABaseView = _super.extend({
|
||||
/** String representation */
|
||||
toString : function(){
|
||||
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
|
||||
return 'HDCABaseView(' + modelString + ')';
|
||||
return 'HDCAListItemView(' + modelString + ')';
|
||||
}
|
||||
});
|
||||
|
||||
/** underscore templates */
|
||||
HDCABaseView.prototype.templates = (function(){
|
||||
HDCAListItemView.prototype.templates = (function(){
|
||||
|
||||
// could steal this from hda-base (or use mixed content)
|
||||
var titleBarTemplate = BASE_MVC.wrapTemplate([
|
||||
@@ -62,6 +62,6 @@ HDCABaseView.prototype.templates = (function(){
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HDCABaseView : HDCABaseView
|
||||
HDCAListItemView : HDCAListItemView
|
||||
};
|
||||
});
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
define([
|
||||
"mvc/history/history-content-base",
|
||||
"mvc/collection/collection-model",
|
||||
"mvc/history/history-content-model",
|
||||
"utils/localization"
|
||||
], function( HISTORY_CONTENT, DC_MODEL, _l ){
|
||||
], function( DC_MODEL, HISTORY_CONTENT, _l ){
|
||||
/*==============================================================================
|
||||
|
||||
Models for DatasetCollections contained within a history.
|
||||
@@ -1,44 +0,0 @@
|
||||
define([
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( BASE_MVC, _l ){
|
||||
/* global Backbone */
|
||||
//==============================================================================
|
||||
/** @class Read only view for history content views to mixin/extend.
|
||||
* Functionality here should be history-centric.
|
||||
*/
|
||||
var HistoryContentViewMixin = {
|
||||
//PRECONDITION: expects to be mixed into an BASE_MVC.ExpandableView
|
||||
initialize : function( attributes ){
|
||||
|
||||
}
|
||||
|
||||
//TODO: render title with HID
|
||||
//TODO: render based on visiblility (HDA only)
|
||||
|
||||
};
|
||||
|
||||
//NOTE: no templates, they're defined at the leaves of the hierarchy
|
||||
//TODO:?? you sure about that?
|
||||
|
||||
//==============================================================================
|
||||
/** @class Read only view for history content views to extend.
|
||||
* @name HistoryContentBaseView
|
||||
*
|
||||
* @augments Backbone.View
|
||||
* @borrows LoggableMixin#logger as #logger
|
||||
* @borrows LoggableMixin#log as #log
|
||||
* @constructs
|
||||
*/
|
||||
var HistoryContentBaseView = BASE_MVC.ExpandableView.extend(
|
||||
/** @lends HistoryContentBaseView.prototype */HistoryContentViewMixin );
|
||||
|
||||
//TODO: not sure base view class is warranted or even wise
|
||||
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HistoryContentViewMixin : HistoryContentViewMixin,
|
||||
HistoryContentBaseView : HistoryContentBaseView
|
||||
};
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
define([
|
||||
"mvc/history/history-content-base",
|
||||
"mvc/dataset/hda-model",
|
||||
"mvc/collection/hdca-model",
|
||||
"mvc/history/history-content-model",
|
||||
"mvc/history/hda-model",
|
||||
"mvc/history/hdca-model",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( HISTORY_CONTENT, HDA_MODEL, HDCA_MODEL, BASE_MVC, _l ){
|
||||
|
||||
+6
-5
@@ -1,13 +1,13 @@
|
||||
define([
|
||||
"mvc/dataset/hda-base",
|
||||
"mvc/history/readonly-history-panel",
|
||||
"mvc/history/history-panel",
|
||||
"mvc/history/hda-li",
|
||||
"utils/localization"
|
||||
], function( HDA_BASE, READONLY_HPANEL, _l ){
|
||||
], function( HPANEL, HDA_LI, _l ){
|
||||
/* =============================================================================
|
||||
TODO:
|
||||
|
||||
============================================================================= */
|
||||
var _super = READONLY_HPANEL.ReadOnlyHistoryPanel;
|
||||
var _super = HPANEL.ReadOnlyHistoryPanel;
|
||||
// used in history/display.mako and history/embed.mako
|
||||
/** @class View/Controller for a tabular view of the history model.
|
||||
* @name AnnotatedHistoryPanel
|
||||
@@ -31,8 +31,9 @@ var AnnotatedHistoryPanel = _super.extend(
|
||||
|
||||
className : 'annotated-history-panel',
|
||||
|
||||
//TODO:?? possibly into own annotated class
|
||||
/** class to use for constructing the HDA views */
|
||||
HDAViewClass : HDA_BASE.HDABaseView,
|
||||
//HDAViewClass : HDA_LI.HDAListItemView,
|
||||
|
||||
// ------------------------------------------------------------------------ panel rendering
|
||||
/** render with history data
|
||||
+5
-5
@@ -1,10 +1,9 @@
|
||||
define([
|
||||
"mvc/dataset/hda-edit",
|
||||
"mvc/history/history-panel",
|
||||
"mvc/history/history-panel-edit",
|
||||
"mvc/collection/collection-panel",
|
||||
"mvc/base-mvc",
|
||||
"utils/localization"
|
||||
], function( HDA_EDIT, HISTORY_PANEL, DC_PANEL, BASE_MVC, _l ){
|
||||
], function( HPANEL_EDIT, DC_PANEL, BASE_MVC, _l ){
|
||||
// ============================================================================
|
||||
/** session storage for history panel preferences (and to maintain state)
|
||||
*/
|
||||
@@ -31,7 +30,7 @@ HistoryPanelPrefs.storageKey = function storageKey(){
|
||||
TODO:
|
||||
|
||||
============================================================================= */
|
||||
var _super = HISTORY_PANEL.HistoryPanel;
|
||||
var _super = HPANEL_EDIT.HistoryPanel;
|
||||
// used in root/index.mako
|
||||
/** @class View/Controller for the user's current history model as used in the history
|
||||
* panel (current right hand panel) of the analysis page.
|
||||
@@ -318,7 +317,8 @@ var CurrentHistoryPanel = _super.extend(
|
||||
var panel = new ( this._getCollectionPanelClass( collectionModel ) )({
|
||||
model : collectionModel,
|
||||
HDAViewClass : this.HDAViewClass,
|
||||
parentName : this.model.get( 'name' )
|
||||
parentName : this.model.get( 'name' ),
|
||||
linkTarget : this.linkTarget
|
||||
});
|
||||
historyView.panelStack.push( panel );
|
||||
|
||||
@@ -0,0 +1,503 @@
|
||||
define([
|
||||
"mvc/history/history-panel",
|
||||
"mvc/history/history-contents",
|
||||
"mvc/dataset/states",
|
||||
"mvc/history/hda-model",
|
||||
"mvc/history/hda-li-edit",
|
||||
"mvc/history/hdca-li-edit",
|
||||
"mvc/tags",
|
||||
"mvc/annotations",
|
||||
"utils/localization"
|
||||
], function(
|
||||
HPANEL,
|
||||
HISTORY_CONTENTS,
|
||||
STATES,
|
||||
HDA_MODEL,
|
||||
HDA_LI_EDIT,
|
||||
HDCA_LI_EDIT,
|
||||
TAGS,
|
||||
ANNOTATIONS,
|
||||
_l
|
||||
){
|
||||
/* =============================================================================
|
||||
TODO:
|
||||
|
||||
============================================================================= */
|
||||
var _super = HPANEL.ReadOnlyHistoryPanel;
|
||||
// base class for current-history-panel and used as-is in history/view.mako
|
||||
/** @class Editable View/Controller for the history model.
|
||||
* @name HistoryPanel
|
||||
*
|
||||
* Allows:
|
||||
* (everything ReadOnlyHistoryPanel allows)
|
||||
* changing the name
|
||||
* displaying and editing tags and annotations
|
||||
* multi-selection and operations on mulitple hdas
|
||||
*
|
||||
* @augments Backbone.View
|
||||
* @borrows LoggableMixin#logger as #logger
|
||||
* @borrows LoggableMixin#log as #log
|
||||
* @constructs
|
||||
*/
|
||||
var HistoryPanel = _super.extend(
|
||||
/** @lends HistoryPanel.prototype */{
|
||||
|
||||
/** logger used to record this.log messages, commonly set to console */
|
||||
//logger : console,
|
||||
|
||||
/** class to use for constructing the HistoryDatasetAssociation views */
|
||||
HDAViewClass : HDA_LI_EDIT.HDAListItemEdit,
|
||||
/** class to use for constructing the HistoryDatasetCollectionAssociation views */
|
||||
HDCAViewClass : HDCA_LI_EDIT.HDCAListItemEdit,
|
||||
|
||||
// ......................................................................... SET UP
|
||||
/** Set up the view, set up storage, bind listeners to HistoryContents events
|
||||
* @param {Object} attributes
|
||||
*/
|
||||
initialize : function( attributes ){
|
||||
attributes = attributes || {};
|
||||
|
||||
// ---- set up instance vars
|
||||
/** selected hda ids */
|
||||
this.selectedHdaIds = [];
|
||||
/** last selected hda */
|
||||
this.lastSelectedViewId = null;
|
||||
|
||||
/** editor for tags - sub-view */
|
||||
this.tagsEditor = null;
|
||||
/** editor for annotations - sub-view */
|
||||
this.annotationEditor = null;
|
||||
|
||||
/** allow user purge of dataset files? */
|
||||
this.purgeAllowed = attributes.purgeAllowed || false;
|
||||
|
||||
// states/modes the panel can be in
|
||||
/** is the panel currently showing the dataset selection controls? */
|
||||
this.selecting = attributes.selecting || false;
|
||||
this.annotationEditorShown = attributes.annotationEditorShown || false;
|
||||
this.tagsEditorShown = attributes.tagsEditorShown || false;
|
||||
|
||||
_super.prototype.initialize.call( this, attributes );
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ panel rendering
|
||||
/** listening for history and HDA events */
|
||||
_setUpModelEventHandlers : function(){
|
||||
_super.prototype._setUpModelEventHandlers.call( this );
|
||||
|
||||
this.model.on( 'change:nice_size', this.updateHistoryDiskSize, this );
|
||||
|
||||
this.model.contents.on( 'change:deleted', this._handleHdaDeletionChange, this );
|
||||
this.model.contents.on( 'change:visible', this._handleHdaVisibleChange, this );
|
||||
this.model.contents.on( 'change:purged', function( hda ){
|
||||
// hafta get the new nice-size w/o the purged hda
|
||||
this.model.fetch();
|
||||
}, this );
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ panel rendering
|
||||
/** render with history data
|
||||
* In this override, add tags, annotations, and multi select
|
||||
* @returns {jQuery} dom fragment as temporary container to be swapped out later
|
||||
*/
|
||||
renderModel : function( ){
|
||||
//TODO: can't call ReadOnlyHistoryPanel?
|
||||
var $newRender = $( '<div/>' );
|
||||
|
||||
$newRender.append( HistoryPanel.templates.historyPanel( this.model.toJSON() ) );
|
||||
this.$emptyMessage( $newRender ).text( this.emptyMsg );
|
||||
if( Galaxy && Galaxy.currUser && Galaxy.currUser.id && Galaxy.currUser.id === this.model.get( 'user_id' ) ){
|
||||
this._renderTags( $newRender );
|
||||
this._renderAnnotation( $newRender );
|
||||
}
|
||||
// search and select available to both anon/logged-in users
|
||||
$newRender.find( '.history-secondary-actions' ).prepend( this._renderSelectButton() );
|
||||
$newRender.find( '.history-dataset-actions' ).toggle( this.selecting );
|
||||
$newRender.find( '.history-secondary-actions' ).prepend( this._renderSearchButton() );
|
||||
|
||||
this._setUpBehaviours( $newRender );
|
||||
|
||||
// render hda views (if any and any shown (show_deleted/hidden)
|
||||
this.renderHdas( $newRender );
|
||||
return $newRender;
|
||||
},
|
||||
|
||||
/** render the tags sub-view controller */
|
||||
_renderTags : function( $where ){
|
||||
var panel = this;
|
||||
this.tagsEditor = new TAGS.TagsEditor({
|
||||
model : this.model,
|
||||
el : $where.find( '.history-controls .tags-display' ),
|
||||
onshowFirstTime : function(){ this.render(); },
|
||||
// show hide hda view tag editors when this is shown/hidden
|
||||
onshow : function(){
|
||||
panel.toggleHDATagEditors( true, panel.fxSpeed );
|
||||
},
|
||||
onhide : function(){
|
||||
panel.toggleHDATagEditors( false, panel.fxSpeed );
|
||||
},
|
||||
$activator : faIconButton({
|
||||
title : _l( 'Edit history tags' ),
|
||||
classes : 'history-tag-btn',
|
||||
faIcon : 'fa-tags'
|
||||
}).appendTo( $where.find( '.history-secondary-actions' ) )
|
||||
});
|
||||
},
|
||||
/** render the annotation sub-view controller */
|
||||
_renderAnnotation : function( $where ){
|
||||
var panel = this;
|
||||
this.annotationEditor = new ANNOTATIONS.AnnotationEditor({
|
||||
model : this.model,
|
||||
el : $where.find( '.history-controls .annotation-display' ),
|
||||
onshowFirstTime : function(){ this.render(); },
|
||||
// show hide hda view annotation editors when this is shown/hidden
|
||||
onshow : function(){
|
||||
panel.toggleHDAAnnotationEditors( true, panel.fxSpeed );
|
||||
},
|
||||
onhide : function(){
|
||||
panel.toggleHDAAnnotationEditors( false, panel.fxSpeed );
|
||||
},
|
||||
$activator : faIconButton({
|
||||
title : _l( 'Edit history annotation' ),
|
||||
classes : 'history-annotate-btn',
|
||||
faIcon : 'fa-comment'
|
||||
}).appendTo( $where.find( '.history-secondary-actions' ) )
|
||||
});
|
||||
},
|
||||
|
||||
/** button for starting select mode */
|
||||
_renderSelectButton : function( $where ){
|
||||
return faIconButton({
|
||||
title : _l( 'Operations on multiple datasets' ),
|
||||
classes : 'history-select-btn',
|
||||
faIcon : 'fa-check-square-o'
|
||||
});
|
||||
},
|
||||
|
||||
/** Set up HistoryPanel js/widget behaviours
|
||||
* In this override, add the multi select popup menu and make the name editable
|
||||
*/
|
||||
_setUpBehaviours : function( $where ){
|
||||
$where = $where || this.$el;
|
||||
_super.prototype._setUpBehaviours.call( this, $where );
|
||||
|
||||
// anon users shouldn't have access to any of the following
|
||||
if( !this.model ){
|
||||
return;
|
||||
}
|
||||
|
||||
// set up the pupup for actions available when multi selecting
|
||||
this._setUpDatasetActionsPopup( $where );
|
||||
|
||||
// anon users shouldn't have access to any of the following
|
||||
if( ( !Galaxy.currUser || Galaxy.currUser.isAnonymous() )
|
||||
|| ( Galaxy.currUser.id !== this.model.get( 'user_id' ) ) ){
|
||||
return;
|
||||
}
|
||||
|
||||
var panel = this;
|
||||
$where.find( '.history-name' )
|
||||
.attr( 'title', _l( 'Click to rename history' ) ).tooltip({ placement: 'bottom' })
|
||||
.make_text_editable({
|
||||
on_finish: function( newName ){
|
||||
var previousName = panel.model.get( 'name' );
|
||||
if( newName && newName !== previousName ){
|
||||
panel.$el.find( '.history-name' ).text( newName );
|
||||
panel.model.save({ name: newName })
|
||||
.fail( function(){
|
||||
panel.$el.find( '.history-name' ).text( panel.model.previous( 'name' ) );
|
||||
});
|
||||
} else {
|
||||
panel.$el.find( '.history-name' ).text( previousName );
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** return a new popup menu for choosing a multi selection action
|
||||
* ajax calls made for multiple datasets are queued
|
||||
*/
|
||||
_setUpDatasetActionsPopup : function( $where ){
|
||||
var panel = this,
|
||||
actions = [
|
||||
{ html: _l( 'Hide datasets' ), func: function(){
|
||||
var action = HDA_MODEL.HistoryDatasetAssociation.prototype.hide;
|
||||
panel.getSelectedHdaCollection().ajaxQueue( action );
|
||||
}
|
||||
},
|
||||
{ html: _l( 'Unhide datasets' ), func: function(){
|
||||
var action = HDA_MODEL.HistoryDatasetAssociation.prototype.unhide;
|
||||
panel.getSelectedHdaCollection().ajaxQueue( action );
|
||||
}
|
||||
},
|
||||
{ html: _l( 'Delete datasets' ), func: function(){
|
||||
var action = HDA_MODEL.HistoryDatasetAssociation.prototype['delete'];
|
||||
panel.getSelectedHdaCollection().ajaxQueue( action );
|
||||
}
|
||||
},
|
||||
{ html: _l( 'Undelete datasets' ), func: function(){
|
||||
var action = HDA_MODEL.HistoryDatasetAssociation.prototype.undelete;
|
||||
panel.getSelectedHdaCollection().ajaxQueue( action );
|
||||
}
|
||||
} ];
|
||||
if( panel.purgeAllowed ){
|
||||
actions.push({
|
||||
html: _l( 'Permanently delete datasets' ), func: function(){
|
||||
if( confirm( _l( 'This will permanently remove the data in your datasets. Are you sure?' ) ) ){
|
||||
var action = HDA_MODEL.HistoryDatasetAssociation.prototype.purge;
|
||||
panel.getSelectedHdaCollection().ajaxQueue( action );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
actions.push( {
|
||||
html: _l( 'Build Dataset List (Experimental)' ), func: function() {
|
||||
panel.getSelectedHdaCollection().promoteToHistoryDatasetCollection( panel.model, "list" );
|
||||
}
|
||||
});
|
||||
actions.push( {
|
||||
// TODO: Only show quick pair if two things selected.
|
||||
html: _l( 'Build Dataset Pair (Experimental)' ), func: function() {
|
||||
panel.getSelectedHdaCollection().promoteToHistoryDatasetCollection( panel.model, "paired" );
|
||||
}
|
||||
});
|
||||
actions.push( {
|
||||
// TODO: Only show quick pair if two things selected.
|
||||
html: _l( 'Build List of Dataset Pairs (Experimental)' ),
|
||||
func: _.bind( panel._showPairedCollectionModal, panel )
|
||||
});
|
||||
return new PopupMenu( $where.find( '.history-dataset-action-popup-btn' ), actions );
|
||||
},
|
||||
|
||||
_showPairedCollectionModal : function(){
|
||||
var panel = this,
|
||||
datasets = panel.getSelectedHdaCollection().toJSON().filter( function( content ){
|
||||
return content.history_content_type === 'dataset'
|
||||
&& content.state === STATES.OK;
|
||||
});
|
||||
if( datasets.length ){
|
||||
require([ 'mvc/collection/paired-collection-creator' ], function( creator ){
|
||||
window.creator = creator.pairedCollectionCreatorModal( datasets, {
|
||||
historyId : panel.model.id
|
||||
});
|
||||
});
|
||||
} else {
|
||||
//Galaxy.modal.show({
|
||||
// body : _l( 'No valid datasets were selected' ),
|
||||
// buttons : {
|
||||
// 'Ok': function(){ Galaxy.modal.hide(); }
|
||||
// }
|
||||
//});
|
||||
}
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ hda sub-views
|
||||
/** If this hda is deleted and we're not showing deleted hdas, remove the view
|
||||
* @param {HistoryDataAssociation} the hda to check
|
||||
*/
|
||||
_handleHdaDeletionChange : function( hda ){
|
||||
if( hda.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){
|
||||
this.removeHdaView( this.hdaViews[ hda.id ] );
|
||||
} // otherwise, the hdaView rendering should handle it
|
||||
},
|
||||
|
||||
|
||||
/** If this hda is hidden and we're not showing hidden hdas, remove the view
|
||||
* @param {HistoryDataAssociation} the hda to check
|
||||
*/
|
||||
_handleHdaVisibleChange : function( hda ){
|
||||
if( hda.hidden() && !this.storage.get( 'show_hidden' ) ){
|
||||
this.removeHdaView( this.hdaViews[ hda.id ] );
|
||||
} // otherwise, the hdaView rendering should handle it
|
||||
},
|
||||
|
||||
_getContentOptions : function( content ){
|
||||
var options = _super.prototype._getContentOptions.call( this, content );
|
||||
_.extend( options, {
|
||||
selectable : this.selecting,
|
||||
purgeAllowed : this.purgeAllowed,
|
||||
tagsEditorShown : ( this.tagsEditor && !this.tagsEditor.hidden ),
|
||||
annotationEditorShown : ( this.annotationEditor && !this.annotationEditor.hidden )
|
||||
});
|
||||
return options;
|
||||
},
|
||||
|
||||
/** Set up HistoryPanel listeners for HDAView events. Currently binds:
|
||||
* HDAView#body-visible, HDAView#body-hidden to store expanded states
|
||||
* @param {HDAView} hdaView HDAView (base or edit) to listen to
|
||||
*/
|
||||
_setUpHdaListeners : function( hdaView ){
|
||||
var historyView = this;
|
||||
_super.prototype._setUpHdaListeners.call( this, hdaView );
|
||||
|
||||
// maintain a list of hdas that are selected
|
||||
hdaView.on( 'selected', function( hdaView, event ){
|
||||
if( !event ){ return; }
|
||||
//console.debug( 'selected', event );
|
||||
var selectedIds = [];
|
||||
//console.debug( historyView.lastSelectedViewId, historyView.hdaViews[ historyView.lastSelectedViewId ] );
|
||||
|
||||
// shift will select a range, but not set lastSelectedViewId
|
||||
if( ( event.shiftKey )
|
||||
&& ( historyView.lastSelectedViewId && _.has( historyView.hdaViews, historyView.lastSelectedViewId ) ) ){
|
||||
var lastSelectedView = historyView.hdaViews[ historyView.lastSelectedViewId ];
|
||||
selectedIds = historyView.selectDatasetRange( hdaView, lastSelectedView )
|
||||
.map( function( view ){ return view.model.id; });
|
||||
|
||||
// only
|
||||
} else {
|
||||
var id = hdaView.model.id;
|
||||
historyView.lastSelectedViewId = id;
|
||||
//console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
|
||||
selectedIds = [ id ];
|
||||
}
|
||||
//console.debug( 'selectedIds:', selectedIds );
|
||||
historyView.selectedHdaIds = _.union( historyView.selectedHdaIds, selectedIds );
|
||||
//TODO: might want to use getSelectedHdaViews instead managing these lists with ops
|
||||
//console.debug( 'selected', historyView.selectedHdaIds );
|
||||
});
|
||||
hdaView.on( 'de-selected', function( hdaView, event ){
|
||||
//console.debug( 'de-selected', event );
|
||||
var id = hdaView.model.id;
|
||||
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
|
||||
//console.debug( 'de-selected', historyView.selectedHdaIds );
|
||||
});
|
||||
},
|
||||
|
||||
/** toggle the visibility of each hdaView's tagsEditor applying all the args sent to this function */
|
||||
toggleHDATagEditors : function( showOrHide ){
|
||||
var args = arguments;
|
||||
_.each( this.hdaViews, function( hdaView ){
|
||||
if( hdaView.tagsEditor ){
|
||||
hdaView.tagsEditor.toggle.apply( hdaView.tagsEditor, args );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** toggle the visibility of each hdaView's annotationEditor applying all the args sent to this function */
|
||||
toggleHDAAnnotationEditors : function( showOrHide ){
|
||||
var args = arguments;
|
||||
_.each( this.hdaViews, function( hdaView ){
|
||||
if( hdaView.annotationEditor ){
|
||||
hdaView.annotationEditor.toggle.apply( hdaView.annotationEditor, args );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** Remove a view from the panel and if the panel is now empty, re-render
|
||||
* @param {Int} the id of the hdaView to remove
|
||||
*/
|
||||
removeHdaView : function( hdaView ){
|
||||
if( !hdaView ){ return; }
|
||||
|
||||
var panel = this;
|
||||
hdaView.$el.fadeOut( panel.fxSpeed, function(){
|
||||
hdaView.off();
|
||||
hdaView.remove();
|
||||
delete panel.hdaViews[ hdaView.model.id ];
|
||||
if( _.isEmpty( panel.hdaViews ) ){
|
||||
panel.trigger( 'empty-history', panel );
|
||||
panel._renderEmptyMsg();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------------ panel events
|
||||
/** event map */
|
||||
events : _.extend( _.clone( _super.prototype.events ), {
|
||||
'click .history-select-btn' : 'toggleSelectors',
|
||||
'click .history-select-all-datasets-btn' : 'selectAllDatasets',
|
||||
'click .history-deselect-all-datasets-btn' : 'deselectAllDatasets'
|
||||
}),
|
||||
|
||||
/** Update the history size display (curr. upper right of panel).
|
||||
*/
|
||||
updateHistoryDiskSize : function(){
|
||||
this.$el.find( '.history-size' ).text( this.model.get( 'nice_size' ) );
|
||||
},
|
||||
|
||||
// ........................................................................ multi-select of hdas
|
||||
//TODO: to toggle showOrHide pattern
|
||||
/** show selectors on all visible hdas and associated controls */
|
||||
showSelectors : function( speed ){
|
||||
speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
|
||||
this.selecting = true;
|
||||
this.$( '.history-dataset-actions' ).slideDown( speed );
|
||||
_.each( this.hdaViews, function( view ){
|
||||
view.showSelector();
|
||||
});
|
||||
this.selectedHdaIds = [];
|
||||
this.lastSelectedViewId = null;
|
||||
},
|
||||
|
||||
/** hide selectors on all visible hdas and associated controls */
|
||||
hideSelectors : function( speed ){
|
||||
speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
|
||||
this.selecting = false;
|
||||
this.$( '.history-dataset-actions' ).slideUp( speed );
|
||||
_.each( this.hdaViews, function( view ){
|
||||
view.hideSelector();
|
||||
});
|
||||
this.selectedHdaIds = [];
|
||||
this.lastSelectedViewId = null;
|
||||
},
|
||||
|
||||
/** show or hide selectors on all visible hdas and associated controls */
|
||||
toggleSelectors : function(){
|
||||
if( !this.selecting ){
|
||||
this.showSelectors();
|
||||
} else {
|
||||
this.hideSelectors();
|
||||
}
|
||||
},
|
||||
|
||||
/** select all visible hdas */
|
||||
selectAllDatasets : function( event ){
|
||||
_.each( this.hdaViews, function( view ){
|
||||
view.select( event );
|
||||
});
|
||||
},
|
||||
|
||||
/** deselect all visible hdas */
|
||||
deselectAllDatasets : function( event ){
|
||||
this.lastSelectedViewId = null;
|
||||
_.each( this.hdaViews, function( view ){
|
||||
view.deselect( event );
|
||||
});
|
||||
},
|
||||
|
||||
/** select a range of datasets between A and B */
|
||||
selectDatasetRange : function( viewA, viewB ){
|
||||
var range = this.hdaViewRange( viewA, viewB );
|
||||
_.each( range, function( view ){
|
||||
view.select();
|
||||
});
|
||||
return range;
|
||||
},
|
||||
|
||||
/** return an array of all currently selected hdas */
|
||||
getSelectedHdaViews : function(){
|
||||
return _.filter( this.hdaViews, function( v ){
|
||||
return v.selected;
|
||||
});
|
||||
},
|
||||
|
||||
/** return an HdaCollection of the models of all currenly selected hdas */
|
||||
getSelectedHdaCollection : function(){
|
||||
return new HISTORY_CONTENTS.HistoryContents( _.map( this.getSelectedHdaViews(), function( hdaView ){
|
||||
return hdaView.model;
|
||||
}), { historyId: this.model.id });
|
||||
},
|
||||
|
||||
// ........................................................................ misc
|
||||
/** Return a string rep of the history */
|
||||
toString : function(){
|
||||
return 'HistoryPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
|
||||
}
|
||||
});
|
||||
|
||||
//==============================================================================
|
||||
return {
|
||||
HistoryPanel : HistoryPanel
|
||||
};
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
define(["mvc/collection/collection-li","utils/localization"],function(b,a){var c=b.DCListItemView;var d=c.extend({toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"DCEListItemEdit("+e+")"}});return{DCEListItemEdit:d}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/dataset-li","mvc/base-mvc","utils/localization"],function(h,d,f){var c=d.ListItemView;var a=c.extend({className:c.prototype.className+" dataset-collection",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+"(DCListItemView).initialize:",i);c.prototype.initialize.call(this,i)},expand:function(){var i=this;return i._fetchModelDetails().always(function(){i.trigger("expanded",i)})},_renderSubtitle:function(){var i=$('<div class="subtitle"></div>');switch(this.model.get("collection_type")){case"list":return i.text(f("a list of datasets"));case"paired":return i.text(f("a pair of datasets"));case"list:paired":return i.text(f("a list of paired datasets"))}return i},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCListItemView("+i+")"}});a.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- collection.element_identifier || collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},c.prototype.templates,{titleBar:i})}());var b=c.extend({logger:console,className:c.prototype.className+" dataset-collection-element",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DCEListItemView.initialize:",i);c.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCEListItemView("+i+")"}});b.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element");return _.extend({},c.prototype.templates,{titleBar:i})}());var e=h.DatasetListItemView.extend({className:h.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DatasetDCEListItemView.initialize:",i);h.DatasetListItemView.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DatasetDCEListItemView("+i+")"}});e.prototype.templates=(function(){var i=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>","</div>"],"element");return _.extend({},h.DatasetListItemView.prototype.templates,{titleBar:i})}());var g=a.extend({className:a.prototype.className+" dataset-collection-element",_swapNewRender:function(i){a.prototype._swapNewRender.call(this,i);var j=this.model.get("state")||"ok";this.$el.addClass("state-"+j);return this.$el},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"NestedDCDCEListItemView("+i+")"}});return{DCListItemView:a,DCEListItemView:b,DatasetDCEListItemView:e,NestedDCDCEListItemView:g}});
|
||||
@@ -1 +1 @@
|
||||
define(["mvc/dataset/dataset-model","mvc/base-mvc","utils/localization"],function(b,o,e){var f={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(q){_.extend(q,q.object);delete q.object;return q},constructor:function(q,r){this.debug("\t DatasetCollectionElement.constructor:",q,r);q=this._mergeObject(q);Backbone.Model.apply(this,arguments)},parse:function(r,s){var q=r;q=this._mergeObject(q);return q}};var p=Backbone.Model.extend(o.LoggableMixin).extend(f);var m=Backbone.Collection.extend(o.LoggableMixin).extend({model:p,initialize:function(q,r){this.debug(this+"(DCECollection).initialize:",q,r);r=r||{}},toString:function(){return(["DatasetCollectionElementCollection(",this.length,")"].join(""))}});var g=b.DatasetAssociation.extend(o.mixin(f,{defaults:_.extend({},b.DatasetAssociation.prototype.defaults,f.defaults),constructor:function(q,r){this.debug("\t DatasetDCE.constructor:",q,r);f.constructor.call(this,q,r)},initialize:function(q,r){this.debug(this+"(DatasetDCE).initialize:",q,r);b.DatasetAssociation.prototype.initialize.call(this,q,r)},toString:function(){var q=this.get("element_identifier");return(["DatasetDCE(",q,")"].join(""))}}));var l=m.extend({model:g,initialize:function(q,r){this.debug(this+"(DatasetDCECollection).initialize:",q,r);m.prototype.initialize.call(this,q,r)},toString:function(){return(["DatasetDCECollection(",this.length,")"].join(""))}});var i=Backbone.Model.extend(o.LoggableMixin).extend(o.SearchableModelMixin).extend({defaults:{collection_type:null,deleted:false},collectionClass:m,initialize:function(r,q){this.debug(this+"(DatasetCollection).initialize:",r,q,this);this.elements=this._createElementsModel();this.on("change:elements",function(){this.log("change:elements");this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var q=this.get("elements")||[];this.unset("elements",{silent:true});this.elements=new this.collectionClass(q);return this.elements},toJSON:function(){var q=Backbone.Model.prototype.toJSON.call(this);if(this.elements){q.elements=this.elements.toJSON()}return q},inReadyState:function(){return true},hasDetails:function(){this.debug("hasDetails:",this.elements.length);return this.elements.length!==0},getVisibleContents:function(q){return this.elements},"delete":function(q){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},q)},undelete:function(q){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},q)},searchAttributes:["name"],toString:function(){var q=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+(q.join(","))+")"}});var h=i.extend({collectionClass:l,initialize:function(r,q){this.debug(this+"(ListDatasetCollection).initialize:",r,q);i.prototype.initialize.call(this,r,q)},toString:function(){return(["ListDatasetCollection(",this.get("name"),")"].join(""))}});var d=h.extend({initialize:function(r,q){this.debug(this+"(PairDatasetCollection).initialize:",r,q);h.prototype.initialize.call(this,r,q)},toString:function(){return(["PairDatasetCollection(",this.get("name"),")"].join(""))}});var j=i.extend(o.mixin(f,{constructor:function(q,r){this.debug("\t NestedDCDCE.constructor:",q,r);f.constructor.call(this,q,r)},toString:function(){var q=(this.object)?(""+this.object):(this.get("element_identifier"));return(["NestedDCDCE(",q,")"].join(""))}}));var n=m.extend({model:j,initialize:function(r,q){this.debug(this+"(NestedDCDCECollection).initialize:",r,q);m.prototype.initialize.call(this,r,q)},toString:function(){return(["NestedDCDCECollection(",this.length,")"].join(""))}});var a=d.extend(o.mixin(f,{constructor:function(q,r){this.debug("\t NestedPairDCDCE.constructor:",q,r);f.constructor.call(this,q,r)},toString:function(){var q=(this.object)?(""+this.object):(this.get("element_identifier"));return(["NestedPairDCDCE(",q,")"].join(""))}}));var k=n.extend({model:a,initialize:function(r,q){this.debug(this+"(NestedPairDCDCECollection).initialize:",r,q);n.prototype.initialize.call(this,r,q)},toString:function(){return(["NestedPairDCDCECollection(",this.length,")"].join(""))}});var c=i.extend({collectionClass:k,initialize:function(q,r){this.debug(this+"(ListPairedDatasetCollection).initialize:",q,r);i.prototype.initialize.call(this,q,r)},toString:function(){return(["ListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{ListDatasetCollection:h,PairDatasetCollection:d,ListPairedDatasetCollection:c}});
|
||||
define(["mvc/dataset/dataset-model","mvc/base-mvc","utils/localization"],function(l,o,d){var e={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(q){_.extend(q,q.object);delete q.object;return q},constructor:function(q,r){this.debug("\t DatasetCollectionElement.constructor:",q,r);q=this._mergeObject(q);Backbone.Model.apply(this,arguments)},parse:function(r,s){var q=r;q=this._mergeObject(q);return q}};var p=Backbone.Model.extend(o.LoggableMixin).extend(e);var m=Backbone.Collection.extend(o.LoggableMixin).extend({model:p,initialize:function(q,r){this.debug(this+"(DCECollection).initialize:",q,r);r=r||{}},toString:function(){return(["DatasetCollectionElementCollection(",this.length,")"].join(""))}});var f=l.DatasetAssociation.extend(o.mixin(e,{defaults:_.extend({},l.DatasetAssociation.prototype.defaults,e.defaults),constructor:function(q,r){this.debug("\t DatasetDCE.constructor:",q,r);e.constructor.call(this,q,r)},initialize:function(q,r){this.debug(this+"(DatasetDCE).initialize:",q,r);l.DatasetAssociation.prototype.initialize.call(this,q,r)},toString:function(){var q=this.get("element_identifier");return(["DatasetDCE(",q,")"].join(""))}}));var k=m.extend({model:f,initialize:function(q,r){this.debug(this+"(DatasetDCECollection).initialize:",q,r);m.prototype.initialize.call(this,q,r)},toString:function(){return(["DatasetDCECollection(",this.length,")"].join(""))}});var h=Backbone.Model.extend(o.LoggableMixin).extend(o.SearchableModelMixin).extend({defaults:{collection_type:null,deleted:false},collectionClass:m,initialize:function(r,q){this.debug(this+"(DatasetCollection).initialize:",r,q,this);this.elements=this._createElementsModel();this.on("change:elements",function(){this.log("change:elements");this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var q=this.get("elements")||[];this.unset("elements",{silent:true});this.elements=new this.collectionClass(q);return this.elements},toJSON:function(){var q=Backbone.Model.prototype.toJSON.call(this);if(this.elements){q.elements=this.elements.toJSON()}return q},inReadyState:function(){return true},hasDetails:function(){this.debug("hasDetails:",this.elements.length);return this.elements.length!==0},getVisibleContents:function(q){return this.elements},"delete":function(q){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},q)},undelete:function(q){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},q)},searchAttributes:["name"],toString:function(){var q=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+(q.join(","))+")"}});var g=h.extend({collectionClass:k,initialize:function(r,q){this.debug(this+"(ListDatasetCollection).initialize:",r,q);h.prototype.initialize.call(this,r,q)},toString:function(){return(["ListDatasetCollection(",this.get("name"),")"].join(""))}});var c=g.extend({initialize:function(r,q){this.debug(this+"(PairDatasetCollection).initialize:",r,q);g.prototype.initialize.call(this,r,q)},toString:function(){return(["PairDatasetCollection(",this.get("name"),")"].join(""))}});var i=h.extend(o.mixin(e,{constructor:function(q,r){this.debug("\t NestedDCDCE.constructor:",q,r);e.constructor.call(this,q,r)},toString:function(){var q=(this.object)?(""+this.object):(this.get("element_identifier"));return(["NestedDCDCE(",q,")"].join(""))}}));var n=m.extend({model:i,initialize:function(r,q){this.debug(this+"(NestedDCDCECollection).initialize:",r,q);m.prototype.initialize.call(this,r,q)},toString:function(){return(["NestedDCDCECollection(",this.length,")"].join(""))}});var a=c.extend(o.mixin(e,{constructor:function(q,r){this.debug("\t NestedPairDCDCE.constructor:",q,r);e.constructor.call(this,q,r)},toString:function(){var q=(this.object)?(""+this.object):(this.get("element_identifier"));return(["NestedPairDCDCE(",q,")"].join(""))}}));var j=n.extend({model:a,initialize:function(r,q){this.debug(this+"(NestedPairDCDCECollection).initialize:",r,q);n.prototype.initialize.call(this,r,q)},toString:function(){return(["NestedPairDCDCECollection(",this.length,")"].join(""))}});var b=h.extend({collectionClass:j,initialize:function(q,r){this.debug(this+"(ListPairedDatasetCollection).initialize:",q,r);h.prototype.initialize.call(this,q,r)},toString:function(){return(["ListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{ListDatasetCollection:g,PairDatasetCollection:c,ListPairedDatasetCollection:b}});
|
||||
@@ -1 +1 @@
|
||||
define(["mvc/collection/dataset-collection-base","mvc/base-mvc","utils/localization"],function(f,a,e){var d=Backbone.View.extend(a.LoggableMixin).extend({tagName:"div",className:"dataset-collection-panel",fxSpeed:"fast",DatasetDCEViewClass:f.DatasetDCEBaseView,NestedDCEViewClass:f.NestedDCEBaseView,initialize:function(h){h=h||{};if(h.logger){this.logger=h.logger}this.log(this+".initialize:",h);this.hasUser=h.hasUser;this.panelStack=[];this.parentName=h.parentName},_setUpListeners:function(){this.on("all",function(h){this.log(this+"",arguments)},this);return this},_setUpModelEventHandlers:function(){return this},render:function(j,k){this.log("render:",j,k);j=(j===undefined)?(this.fxSpeed):(j);var h=this,i;if(!this.model){return this}i=this.renderModel();$(h).queue("fx",[function(l){if(j&&h.$el.is(":visible")){h.$el.fadeOut(j,l)}else{l()}},function(l){h.$el.empty();if(i){h.$el.append(i.children())}l()},function(l){if(j&&!h.$el.is(":visible")){h.$el.fadeIn(j,l)}else{l()}},function(l){if(k){k.call(this)}h.trigger("rendered",this);l()}]);return this},renderModel:function(){var j=this.model.get("collection_type")||this.model.object.get("collection_type"),i=_.extend(this.model.toJSON(),{parentName:this.parentName,type:j}),h=$("<div/>").append(this.templates.panel(i));this._setUpBehaviours(h);this.renderContents(h);return h},_setUpBehaviours:function(h){h=h||this.$el;h.find("[title]").tooltip({placement:"bottom"});return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(h){return(h||this.$el).find(".datasets-list")},renderContents:function(i){i=i||this.$el;this.warn(this+".renderContents:, model:",this.model);var h=this,k={},j=this.model.getVisibleContents();this.log("renderContents, visibleContents:",j,i);this.$datasetsList(i).empty();if(j&&j.length){j.each(function(m){var n=m.id,l=h._createContentView(m);k[n]=l;h._attachContentView(l.render(),i)})}this.contentViews=k;return this.contentViews},_createContentView:function(j){var i=null,h=this._getContentClass(j);this.debug("ContentClass:",h);this.debug("content:",j);i=new h({model:j,linkTarget:this.linkTarget,hasUser:this.hasUser,logger:this.logger});this.debug("contentView:",i);this._setUpContentListeners(i);return i},_getContentClass:function(h){this.debug(this+"._getContentClass:",h);this.debug("DCEViewClass:",this.DCEViewClass);switch(h.get("element_type")){case"hda":return this.DCEViewClass;case"dataset_collection":return this.DCEViewClass}throw new TypeError("Unknown element type:",h.get("element_type"))},_setUpContentListeners:function(i){var h=this;if(i.model.get("element_type")==="dataset_collection"){i.on("expanded",function(j){h.info("expanded",j);h._addCollectionPanel(j)})}},_addCollectionPanel:function(j){var k=this,h=j.model;this.debug("collection panel (stack), collectionView:",j);this.debug("collection panel (stack), collectionModel:",h);var i=new c({model:h,parentName:this.model.get("name")});k.panelStack.push(i);k.$(".controls").add(".datasets-list").hide();k.$el.append(i.$el);i.on("close",function(){k.render();j.collapse();k.panelStack.pop()});if(!i.model.hasDetails()){var l=i.model.fetch();l.done(function(){i.render()})}else{i.render()}},_attachContentView:function(j,i){i=i||this.$el;var h=this.$datasetsList(i);h.append(j.$el);return this},events:{"click .navigation .back":"close"},close:function(h){this.$el.remove();this.trigger("close")},toString:function(){return"CollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});d.templates=d.prototype.templates=(function(){var h=_.template(['<div class="controls">','<div class="navigation">','<a class="back" href="javascript:void(0)">','<span class="fa fa-icon fa-angle-left"></span>',e("Back to "),"<%- collection.parentName %>","</a>","</div>",'<div class="title">','<div class="name"><%- collection.name || collection.element_identifier %></div>','<div class="subtitle">','<% if( collection.type === "list" ){ %>',e("a list of datasets"),'<% } else if( collection.type === "paired" ){ %>',e("a pair of datasets"),'<% } else if( collection.type === "list:paired" ){ %>',e("a list of paired datasets"),"<% } %>","</div>","</div>","</div>",'<div class="datasets-list"></div>'].join(""));return{panel:function(i){return h({_l:e,collection:i})}}}());var b=d.extend({DCEViewClass:f.DatasetDCEBaseView,toString:function(){return"ListCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var c=b.extend({toString:function(){return"PairCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var g=d.extend({DCEViewClass:f.NestedDCDCEBaseView,toString:function(){return"ListOfPairsCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CollectionPanel:d,ListCollectionPanel:b,PairCollectionPanel:c,ListOfPairsCollectionPanel:g}});
|
||||
define(["mvc/collection/collection-model","mvc/collection/collection-li","mvc/base-mvc","utils/localization"],function(h,f,a,e){var d=Backbone.View.extend(a.LoggableMixin).extend({tagName:"div",className:"dataset-collection-panel",fxSpeed:"fast",DatasetDCEViewClass:f.DatasetDCEListItemView,NestedDCDCEViewClass:f.NestedDCDCEListItemView,initialize:function(i){i=i||{};if(i.logger){this.logger=i.logger}this.log(this+".initialize:",i);this.linkTarget=i.linkTarget||"_blank";this.hasUser=i.hasUser;this.panelStack=[];this.parentName=i.parentName;window.collectionPanel=this},_setUpListeners:function(){this.on("all",function(i){this.log(this+"",arguments)},this);return this},_setUpModelEventHandlers:function(){return this},render:function(k,l){this.log("render:",k,l);k=(k===undefined)?(this.fxSpeed):(k);var i=this,j;if(!this.model){return this}j=this.renderModel();$(i).queue("fx",[function(m){if(k&&i.$el.is(":visible")){i.$el.fadeOut(k,m)}else{m()}},function(m){i.$el.empty();if(j){i.$el.append(j.children())}m()},function(m){if(k&&!i.$el.is(":visible")){i.$el.fadeIn(k,m)}else{m()}},function(m){if(l){l.call(this)}i.trigger("rendered",this);m()}]);return this},renderModel:function(){var k=this.model.get("collection_type")||this.model.object.get("collection_type"),j=_.extend(this.model.toJSON(),{parentName:this.parentName,type:k}),i=$("<div/>").append(this.templates.panel(j));this._setUpBehaviours(i);this.renderContents(i);return i},_setUpBehaviours:function(i){i=i||this.$el;i.find("[title]").tooltip({placement:"bottom"});return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(i){return(i||this.$el).find(".datasets-list")},renderContents:function(j){j=j||this.$el;this.warn(this+".renderContents:, model:",this.model);var i=this,l={},k=this.model.getVisibleContents();this.$datasetsList(j).empty();if(k&&k.length){k.each(function(n){var o=n.id,m=i._createContentView(n);l[o]=m;i._attachContentView(m.render(),j)})}this.contentViews=l;return this.contentViews},_createContentView:function(k){var j=null,i=this._getContentClass(k);j=new i({model:k,linkTarget:this.linkTarget,hasUser:this.hasUser,logger:this.logger});this._setUpContentListeners(j);return j},_getContentClass:function(i){switch(i.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.NestedDCDCEViewClass}throw new TypeError("Unknown element type:",i.get("element_type"))},_setUpContentListeners:function(j){var i=this;if(j.model.get("element_type")==="dataset_collection"){j.on("expanded",function(k){i.info("expanded",k);i._addCollectionPanel(k)})}},_addCollectionPanel:function(k){var l=this,i=k.model;var j=new c({model:i,parentName:this.model.get("name"),linkTarget:this.linkTarget});l.panelStack.push(j);l.$(".controls").add(".datasets-list").hide();l.$el.append(j.$el);j.on("close",function(){l.render();k.collapse();l.panelStack.pop()});if(!j.model.hasDetails()){var m=j.model.fetch();m.done(function(){j.render()})}else{j.render()}},_attachContentView:function(k,j){j=j||this.$el;var i=this.$datasetsList(j);i.append(k.$el);return this},events:{"click .navigation .back":"close"},close:function(i){this.$el.remove();this.trigger("close")},toString:function(){return"CollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});d.templates=d.prototype.templates=(function(){var i=_.template(['<div class="controls">','<div class="navigation">','<a class="back" href="javascript:void(0)">','<span class="fa fa-icon fa-angle-left"></span>',e("Back to "),"<%- collection.parentName %>","</a>","</div>",'<div class="title">','<div class="name"><%- collection.name || collection.element_identifier %></div>','<div class="subtitle">','<% if( collection.type === "list" ){ %>',e("a list of datasets"),'<% } else if( collection.type === "paired" ){ %>',e("a pair of datasets"),'<% } else if( collection.type === "list:paired" ){ %>',e("a list of paired datasets"),"<% } %>","</div>","</div>","</div>",'<div class="datasets-list"></div>'].join(""));return{panel:function(j){return i({_l:e,collection:j})}}}());var b=d.extend({DatasetDCEViewClass:f.DatasetDCEListItemView,toString:function(){return"ListCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var c=b.extend({toString:function(){return"PairCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var g=d.extend({NestedDCDCEViewClass:f.NestedDCDCEListItemView,toString:function(){return"ListOfPairsCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CollectionPanel:d,ListCollectionPanel:b,PairCollectionPanel:c,ListOfPairsCollectionPanel:g}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/dataset-list-element","mvc/base-mvc","utils/localization"],function(g,c,d){var b=c.ListItemView;var a=b.extend({className:b.prototype.className+" dataset-collection",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DCBaseView.initialize:",i);b.prototype.initialize.call(this,i)},expand:function(){var i=this;return i._fetchModelDetails().always(function(){i.trigger("expanded",i)})},_renderSubtitle:function(){var i=$('<div class="subtitle"></div>');switch(this.model.get("collection_type")){case"list":return i.text(d("a list of datasets"));case"paired":return i.text(d("a pair of datasets"));case"list:paired":return i.text(d("a list of paired datasets"))}return i},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCBaseView("+i+")"}});a.prototype.templates=(function(){var i=c.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- collection.element_identifier || collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},b.prototype.templates,{titleBar:i})}());var f=b.extend({logger:console,className:b.prototype.className+" dataset-collection-element",fxSpeed:"fast",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DCEBaseView.initialize:",i);b.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DCEBaseView("+i+")"}});f.prototype.templates=(function(){var i=c.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element");return _.extend({},b.prototype.templates,{titleBar:i})}());var h=g.DatasetListItemView.extend({className:g.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log("DatasetDCEBaseView.initialize:",i);g.DatasetListItemView.prototype.initialize.call(this,i)},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"DatasetDCEBaseView("+i+")"}});h.prototype.templates=(function(){var i=c.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>","</div>"],"element");return _.extend({},g.DatasetListItemView.prototype.templates,{titleBar:i})}());var e=a.extend({className:a.prototype.className+" dataset-collection-element",_swapNewRender:function(i){g.DatasetListItemView.prototype._swapNewRender.call(this,i);var j=this.model.get("state")||"ok";this.$el.addClass("state-"+j);return this.$el},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"NestedDCDCEBaseView("+i+")"}});return{DCBaseView:a,DCEBaseView:f,DatasetDCEBaseView:h,NestedDCDCEBaseView:e}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/states","mvc/collection/dataset-collection-base","utils/localization"],function(b,e,c){var d=e.DCBaseView;var a=d.extend({toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"DCEditView("+f+")"}});return{DCEditView:a}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/states","mvc/collection/dataset-collection-base","mvc/base-mvc","utils/localization"],function(a,d,b,c){var e=d.DCBaseView;var f=e.extend({className:e.prototype.className+" history-content",_swapNewRender:function(g){e.prototype._swapNewRender.call(this,g);var h=this.model.get("state")||a.OK;this.$el.addClass("state-"+h);return this.$el},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDCABaseView("+g+")"}});f.prototype.templates=(function(){var g=b.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- collection.hid %></span> ','<span class="name"><%- collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},e.prototype.templates,{titleBar:g})}());return{HDCABaseView:f}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/states","mvc/collection/hdca-base","utils/localization"],function(a,e,b){var d=e.HDCABaseView;var c=d.extend({_renderPrimaryActions:function(){this.log(this+"._renderPrimaryActions");return d.prototype._renderPrimaryActions.call(this).concat([this._renderDeleteButton()])},_renderDeleteButton:function(){var g=this,f=this.model.get("deleted");return faIconButton({title:f?b("Dataset collection is already deleted"):b("Delete"),classes:"delete-btn",faIcon:"fa-times",disabled:f,onclick:function(){g.$el.find(".icon-btn.delete-btn").trigger("mouseout");g.model["delete"]()}})},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDCAEditView("+f+")"}});return{HDCAEditView:c}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/history/history-content-base","mvc/collection/collection-model","utils/localization"],function(i,c,a){var g=i.HistoryContentMixin,h=c.ListDatasetCollection,j=c.PairDatasetCollection,f=c.ListPairedDatasetCollection;var d=h.extend(g).extend({initialize:function(l,k){h.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryListDatasetCollection(",this.get("name"),")"].join(""))}});var e=j.extend(g).extend({initialize:function(l,k){j.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryPairDatasetCollection(",this.get("name"),")"].join(""))}});var b=f.extend(g).extend({initialize:function(l,k){f.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{HistoryListDatasetCollection:d,HistoryPairDatasetCollection:e,HistoryListPairedDatasetCollection:b}});
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=b.SearchableModelMixin;var e=Backbone.Model.extend(b.LoggableMixin).extend(b.mixin(f,{defaults:{state:a.NEW,deleted:false,purged:false,name:"(unnamed dataset)",accessible:true,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(h,g){this.debug("Dataset.initialize",h,g);if(!this.get("accessible")){this.set("state",a.NOT_VIEWABLE)}this.urls=this._generateUrls();this._setUpListeners()},_generateUrls:function(){var h=this.get("id");if(!h){return{}}var g={purge:"datasets/"+h+"/purge_async",display:"datasets/"+h+"/display/?preview=True",edit:"datasets/"+h+"/edit",download:"datasets/"+h+"/display?to_ext="+this.get("file_ext"),report_error:"dataset/errors?id="+h,rerun:"tool_runner/rerun?id="+h,show_params:"datasets/"+h+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+h+"&metadata_name="};if(galaxy_config&&galaxy_config.root){_.each(g,function(i,j){g[i]=galaxy_config.root+j})}this.urls=g;return g},_setUpListeners:function(){this.on("change:state",function(h,g){this.log(this+" has changed state:",h,g);if(this.inReadyState()){this.trigger("state:ready",h,g,this.previous("state"))}});this.on("change:id change:file_ext",function(g){this._generateUrls()})},toJSON:function(){var g=Backbone.Model.prototype.toJSON.call(this);return _.extend(g,{urls:this.urls})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var g=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||g)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function(g){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},g)},undelete:function(g){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},g)},purge:function d(g){if(this.get("purged")){return jQuery.when()}g=g||{};g.url=this.urls.purge;var h=this,i=jQuery.ajax(g);i.done(function(l,j,k){h.set({deleted:true,purged:true})});i.fail(function(n,j,m){var k=c("Unable to purge dataset");var l=("Removal of datasets by users is not allowed in this Galaxy instance");if(n.responseJSON&&n.responseJSON.error){k=n.responseJSON.error}else{if(n.responseText.indexOf(l)!==-1){k=l}}n.responseText=k;h.trigger("error",h,n,g,c(k),{error:k})});return i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var g=this.get("id")||"";if(this.get("name")){g='"'+this.get("name")+'",'+g}return"Dataset("+g+")"}}));return{DatasetAssociation:e}});
|
||||
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=b.SearchableModelMixin;var e=Backbone.Model.extend(b.LoggableMixin).extend(b.mixin(f,{defaults:{state:a.NEW,deleted:false,purged:false,name:"(unnamed dataset)",accessible:true,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(h,g){this.debug("Dataset.initialize",h,g);if(!this.get("accessible")){this.set("state",a.NOT_VIEWABLE)}this.urls=this._generateUrls();this._setUpListeners()},_generateUrls:function(){var i=this.get("id");if(!i){return{}}var h={purge:"datasets/"+i+"/purge_async",display:"datasets/"+i+"/display/?preview=True",edit:"datasets/"+i+"/edit",download:"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:"dataset/errors?id="+i,rerun:"tool_runner/rerun?id="+i,show_params:"datasets/"+i+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};var g=(galaxy_config&&galaxy_config.root)?(galaxy_config.root):("/");_.each(h,function(k,j){h[j]=g+k});this.urls=h;return h},_setUpListeners:function(){this.on("change:state",function(h,g){this.log(this+" has changed state:",h,g);if(this.inReadyState()){this.trigger("state:ready",h,g,this.previous("state"))}});this.on("change:id change:file_ext",function(g){this._generateUrls()})},toJSON:function(){var g=Backbone.Model.prototype.toJSON.call(this);return _.extend(g,{urls:this.urls})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var g=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||g)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function(g){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},g)},undelete:function(g){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},g)},purge:function d(g){if(this.get("purged")){return jQuery.when()}g=g||{};g.url=this.urls.purge;var h=this,i=jQuery.ajax(g);i.done(function(l,j,k){h.set({deleted:true,purged:true})});i.fail(function(n,j,m){var k=c("Unable to purge dataset");var l=("Removal of datasets by users is not allowed in this Galaxy instance");if(n.responseJSON&&n.responseJSON.error){k=n.responseJSON.error}else{if(n.responseText.indexOf(l)!==-1){k=l}}n.responseText=k;h.trigger("error",h,n,g,c(k),{error:k})});return i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var g=this.get("id")||"";if(this.get("name")){g='"'+this.get("name")+'",'+g}return"Dataset("+g+")"}}));return{DatasetAssociation:e}});
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/dataset-list-element","mvc/base-mvc","utils/localization"],function(e,b,c){var d=e.DatasetListItemView;var a=d.extend({initialize:function(f,g){d.prototype.initialize.call(this,f,g)},className:d.prototype.className+" history-content",toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+f+")"}});a.prototype.templates=(function(){var g=b.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- dataset.hid %></span> ','<span class="name"><%- dataset.name %></span>',"</div>","</div>"],"dataset");var f=_.extend({},d.prototype.templates.warnings,{hidden:b.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',c("This dataset has been hidden"),"</div>","<% } %>"],"dataset")});return _.extend({},d.prototype.templates,{titleBar:g,warnings:f})}());return{HDABaseView:a}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/editable-dataset-list-element","mvc/dataset/hda-base","mvc/base-mvc","utils/localization"],function(e,a,b,c){var d=e.EditableDatasetListItemView;var f=d.extend({className:d.prototype.className+" history-content",events:_.extend(_.clone(d.prototype.events),{"click .unhide-link":function(g){this.model.unhide();return false}}),toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAEditView("+g+")"}});f.prototype.templates=(function(){var g=_.extend({},d.prototype.templates.warnings,{hidden:b.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',c("This dataset has been hidden"),'<br /><a class="unhide-link" a href="javascript:void(0);">',c("Unhide it"),"</a>","</div>","<% } %>"],"dataset")});return _.extend({},d.prototype.templates,{titleBar:a.HDABaseView.prototype.templates.titleBar,warnings:g})}());return{HDAEditView:f}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/dataset-model","mvc/history/history-content-base","mvc/base-mvc","utils/localization"],function(e,g,b,c){var f=e.DatasetAssociation,d=g.HistoryContentMixin;var a=f.extend(b.mixin(d,{constructor:function(i,h){d.constructor.call(this,i,h)},defaults:_.extend({},f.prototype.defaults,d.defaults,{model_class:"HistoryDatasetAssociation"}),initialize:function(h,i){f.prototype.initialize.call(this,h,i);d.initialize.call(this,h,i)},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}}));return{HistoryDatasetAssociation:a}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/dataset/hda-base","mvc/history/readonly-history-panel","utils/localization"],function(a,c,b){var e=c.ReadOnlyHistoryPanel;var d=e.extend({className:"annotated-history-panel",HDAViewClass:a.HDABaseView,renderModel:function(){this.$el.addClass(this.className);var h=e.prototype.renderModel.call(this),f=this.$datasetsList(h),g=$("<table/>").addClass("datasets-list datasets-table");g.append(f.children());f.replaceWith(g);h.find(".history-subtitle").after(this.renderHistoryAnnotation());h.find(".history-search-btn").hide();h.find(".history-controls").after(h.find(".history-search-controls").show());return h},renderHistoryAnnotation:function(){var f=this.model.get("annotation");if(!f){return null}return $(['<div class="history-annotation">',f,"</div>"].join(""))},renderHdas:function(g){g=g||this.$el;var f=e.prototype.renderHdas.call(this,g);this.$datasetsList(g).prepend($("<tr/>").addClass("headers").append([$("<th/>").text(b("Dataset")),$("<th/>").text(b("Annotation"))]));return f},attachContentView:function(i,g){g=g||this.$el;var j=_.find(i.el.classList,function(k){return(/^state\-/).test(k)}),f=i.model.get("annotation")||"",h=$("<tr/>").addClass("dataset-row").append([$("<td/>").addClass("dataset-container").append(i.$el).addClass(j?j.replace("-","-color-"):""),$("<td/>").addClass("additional-info").text(f)]);this.$datasetsList(g).append(h)},events:_.extend(_.clone(e.prototype.events),{"click tr":function(f){$(f.currentTarget).find(".dataset-title-bar").click()},"click .icon-btn":function(f){f.stopPropagation()}}),toString:function(){return"AnnotatedHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{AnnotatedHistoryPanel:d}});
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/dataset-li-edit","mvc/history/hda-li","mvc/base-mvc","utils/localization"],function(b,d,a,c){var e=b.DatasetListItemEdit;var f=e.extend({className:e.prototype.className+" history-content",events:_.extend(_.clone(e.prototype.events),{"click .unhide-link":function(g){this.model.unhide();return false}}),toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAListItemEdit("+g+")"}});f.prototype.templates=(function(){var g=_.extend({},e.prototype.templates.warnings,{hidden:a.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',c("This dataset has been hidden"),'<br /><a class="unhide-link" a href="javascript:void(0);">',c("Unhide it"),"</a>","</div>","<% } %>"],"dataset")});return _.extend({},e.prototype.templates,{titleBar:d.HDAListItemView.prototype.templates.titleBar,warnings:g})}());return{HDAListItemEdit:f}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/dataset-li","mvc/base-mvc","utils/localization"],function(e,a,c){var d=e.DatasetListItemView;var b=d.extend({initialize:function(f,g){d.prototype.initialize.call(this,f,g)},className:d.prototype.className+" history-content",toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDAListItemView("+f+")"}});b.prototype.templates=(function(){var g=a.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- dataset.hid %></span> ','<span class="name"><%- dataset.name %></span>',"</div>","</div>"],"dataset");var f=_.extend({},d.prototype.templates.warnings,{hidden:a.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',c("This dataset has been hidden"),"</div>","<% } %>"],"dataset")});return _.extend({},d.prototype.templates,{titleBar:g,warnings:f})}());return{HDAListItemView:b}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/dataset-model","mvc/history/history-content-model","mvc/base-mvc","utils/localization"],function(e,g,b,c){var f=e.DatasetAssociation,d=g.HistoryContentMixin;var a=f.extend(b.mixin(d,{constructor:function(i,h){d.constructor.call(this,i,h)},defaults:_.extend({},f.prototype.defaults,d.defaults,{model_class:"HistoryDatasetAssociation"}),initialize:function(h,i){f.prototype.initialize.call(this,h,i);d.initialize.call(this,h,i)},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}}));return{HistoryDatasetAssociation:a}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/states","mvc/history/hdca-li","utils/localization"],function(a,e,b){var c=e.HDCAListItemView;var d=c.extend({_renderPrimaryActions:function(){this.log(this+"._renderPrimaryActions");return c.prototype._renderPrimaryActions.call(this).concat([this._renderDeleteButton()])},_renderDeleteButton:function(){var g=this,f=this.model.get("deleted");return faIconButton({title:f?b("Dataset collection is already deleted"):b("Delete"),classes:"delete-btn",faIcon:"fa-times",disabled:f,onclick:function(){g.$el.find(".icon-btn.delete-btn").trigger("mouseout");g.model["delete"]()}})},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDCAListItemEdit("+f+")"}});return{HDCAListItemEdit:d}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/dataset/states","mvc/collection/collection-li","mvc/base-mvc","utils/localization"],function(a,e,c,d){var f=e.DCListItemView;var b=f.extend({className:f.prototype.className+" history-content",_swapNewRender:function(g){f.prototype._swapNewRender.call(this,g);var h=this.model.get("state")||a.OK;this.$el.addClass("state-"+h);return this.$el},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDCAListItemView("+g+")"}});b.prototype.templates=(function(){var g=c.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- collection.hid %></span> ','<span class="name"><%- collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},f.prototype.templates,{titleBar:g})}());return{HDCAListItemView:b}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/collection/collection-model","mvc/history/history-content-model","utils/localization"],function(c,i,a){var g=i.HistoryContentMixin,h=c.ListDatasetCollection,j=c.PairDatasetCollection,f=c.ListPairedDatasetCollection;var d=h.extend(g).extend({initialize:function(l,k){h.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryListDatasetCollection(",this.get("name"),")"].join(""))}});var e=j.extend(g).extend({initialize:function(l,k){j.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryPairDatasetCollection(",this.get("name"),")"].join(""))}});var b=f.extend(g).extend({initialize:function(l,k){f.prototype.initialize.call(this,l,k);g.initialize.call(this,l,k)},toString:function(){return(["HistoryListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{HistoryListDatasetCollection:d,HistoryPairDatasetCollection:e,HistoryListPairedDatasetCollection:b}});
|
||||
@@ -1 +0,0 @@
|
||||
define(["mvc/base-mvc","utils/localization"],function(a,b){var d={initialize:function(e){}};var c=a.ExpandableView.extend(d);return{HistoryContentViewMixin:d,HistoryContentBaseView:c}});
|
||||
@@ -1 +1 @@
|
||||
define(["mvc/history/history-content-base","mvc/dataset/hda-model","mvc/collection/hdca-model","mvc/base-mvc","utils/localization"],function(g,e,b,a,c){var f=Backbone.Collection.extend(a.LoggableMixin).extend({model:function(i,h){if(i.history_content_type==="dataset"){return new e.HistoryDatasetAssociation(i,h)}else{if(i.history_content_type==="dataset_collection"){switch(i.collection_type){case"list":return new b.HistoryListDatasetCollection(i,h);case"paired":return new b.HistoryPairDatasetCollection(i,h);case"list:paired":return new b.HistoryListPairedDatasetCollection(i,h)}throw new TypeError("Unknown collection_type: "+i.collection_type)}}throw new TypeError("Unknown history_content_type: "+i.history_content_type)},initialize:function(i,h){h=h||{};this.historyId=h.historyId;this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(h){return h.get("id")})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(j){var i=!j.inReadyState();if(i){h.push(j.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];this.debug("checking isVisible");var i=new f(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new f(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(m){var l=m.attributes||m,n=g.typeIdStr(l.history_content_type,l.id),o=i.get(n);if(!o){return m}var k=o.toJSON();_.extend(k,m);return k});Backbone.Collection.prototype.set.call(this,j,h)},promoteToHistoryDatasetCollection:function d(m,k,i){i=i||{};i.url=this.url();i.type="POST";var o=k;var l=[],h=null;if(k==="list"){this.chain().each(function(r){var p=r.attributes.name;var s=r.get("id");var q=r.attributes.history_content_type;if(q==="dataset"){if(o!=="list"){this.log("Invalid collection type")}l.push({name:p,src:"hda",id:s})}else{if(o==="list"){o="list:"+r.attributes.collection_type}else{if(o!=="list:"+r.attributes.collection_type){this.log("Invalid collection type")}}l.push({name:p,src:"hdca",id:s})}});h="New Dataset List"}else{if(k==="paired"){var j=this.ids();if(j.length!==2){}l.push({name:"forward",src:"hda",id:j[0]});l.push({name:"reverse",src:"hda",id:j[1]});h="New Dataset Pair"}}i.data={type:"dataset_collection",name:h,collection_type:o,element_identifiers:JSON.stringify(l)};var n=jQuery.ajax(i);n.done(function(r,p,q){m.refresh()});n.fail(function(r,p,q){if(r.responseJSON&&r.responseJSON.error){error=r.responseJSON.error}else{error=r.responseJSON}r.responseText=error});return n},print:function(){var h=this;h.each(function(i){h.debug(i);if(i.elements){h.debug("\t elements:",i.elements)}})},toString:function(){return(["HistoryContents(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryContents:f}});
|
||||
define(["mvc/history/history-content-model","mvc/history/hda-model","mvc/history/hdca-model","mvc/base-mvc","utils/localization"],function(g,e,b,a,c){var f=Backbone.Collection.extend(a.LoggableMixin).extend({model:function(i,h){if(i.history_content_type==="dataset"){return new e.HistoryDatasetAssociation(i,h)}else{if(i.history_content_type==="dataset_collection"){switch(i.collection_type){case"list":return new b.HistoryListDatasetCollection(i,h);case"paired":return new b.HistoryPairDatasetCollection(i,h);case"list:paired":return new b.HistoryListPairedDatasetCollection(i,h)}throw new TypeError("Unknown collection_type: "+i.collection_type)}}throw new TypeError("Unknown history_content_type: "+i.history_content_type)},initialize:function(i,h){h=h||{};this.historyId=h.historyId;this.on("all",function(){this.debug(this+".event:",arguments)})},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},ids:function(){return this.map(function(h){return h.get("id")})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(j){var i=!j.inReadyState();if(i){h.push(j.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];this.debug("checking isVisible");var i=new f(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new f(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(m){var l=m.attributes||m,n=g.typeIdStr(l.history_content_type,l.id),o=i.get(n);if(!o){return m}var k=o.toJSON();_.extend(k,m);return k});Backbone.Collection.prototype.set.call(this,j,h)},promoteToHistoryDatasetCollection:function d(m,k,i){i=i||{};i.url=this.url();i.type="POST";var o=k;var l=[],h=null;if(k==="list"){this.chain().each(function(r){var p=r.attributes.name;var s=r.get("id");var q=r.attributes.history_content_type;if(q==="dataset"){if(o!=="list"){this.log("Invalid collection type")}l.push({name:p,src:"hda",id:s})}else{if(o==="list"){o="list:"+r.attributes.collection_type}else{if(o!=="list:"+r.attributes.collection_type){this.log("Invalid collection type")}}l.push({name:p,src:"hdca",id:s})}});h="New Dataset List"}else{if(k==="paired"){var j=this.ids();if(j.length!==2){}l.push({name:"forward",src:"hda",id:j[0]});l.push({name:"reverse",src:"hda",id:j[1]});h="New Dataset Pair"}}i.data={type:"dataset_collection",name:h,collection_type:o,element_identifiers:JSON.stringify(l)};var n=jQuery.ajax(i);n.done(function(r,p,q){m.refresh()});n.fail(function(r,p,q){if(r.responseJSON&&r.responseJSON.error){error=r.responseJSON.error}else{error=r.responseJSON}r.responseText=error});return n},print:function(){var h=this;h.each(function(i){h.debug(i);if(i.elements){h.debug("\t elements:",i.elements)}})},toString:function(){return(["HistoryContents(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryContents:f}});
|
||||
@@ -0,0 +1 @@
|
||||
define(["mvc/history/history-panel","mvc/history/hda-li","utils/localization"],function(e,b,a){var d=e.ReadOnlyHistoryPanel;var c=d.extend({className:"annotated-history-panel",HDAViewClass:b.HDAReadonlyListItemView,renderModel:function(){this.$el.addClass(this.className);var h=d.prototype.renderModel.call(this),f=this.$datasetsList(h),g=$("<table/>").addClass("datasets-list datasets-table");g.append(f.children());f.replaceWith(g);h.find(".history-subtitle").after(this.renderHistoryAnnotation());h.find(".history-search-btn").hide();h.find(".history-controls").after(h.find(".history-search-controls").show());return h},renderHistoryAnnotation:function(){var f=this.model.get("annotation");if(!f){return null}return $(['<div class="history-annotation">',f,"</div>"].join(""))},renderHdas:function(g){g=g||this.$el;var f=d.prototype.renderHdas.call(this,g);this.$datasetsList(g).prepend($("<tr/>").addClass("headers").append([$("<th/>").text(a("Dataset")),$("<th/>").text(a("Annotation"))]));return f},attachContentView:function(i,g){g=g||this.$el;var j=_.find(i.el.classList,function(k){return(/^state\-/).test(k)}),f=i.model.get("annotation")||"",h=$("<tr/>").addClass("dataset-row").append([$("<td/>").addClass("dataset-container").append(i.$el).addClass(j?j.replace("-","-color-"):""),$("<td/>").addClass("additional-info").text(f)]);this.$datasetsList(g).append(h)},events:_.extend(_.clone(d.prototype.events),{"click tr":function(f){$(f.currentTarget).find(".dataset-title-bar").click()},"click .icon-btn":function(f){f.stopPropagation()}}),toString:function(){return"AnnotatedHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{AnnotatedHistoryPanel:c}});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -53,7 +53,7 @@
|
||||
|
||||
require.config({
|
||||
baseUrl : "${h.url_for( '/static/scripts' )}"
|
||||
})([ 'mvc/history/annotated-history-panel' ], function( panelMod ){
|
||||
})([ 'mvc/history/history-panel-annotated' ], function( panelMod ){
|
||||
// history module is already in the dpn chain from the panel. We can re-scope it here.
|
||||
var historyModel = require( 'mvc/history/history-model' ),
|
||||
history = new historyModel.History( historyJSON, hdaJSON, {
|
||||
|
||||
@@ -143,12 +143,11 @@
|
||||
## load edit views for each of the hdas
|
||||
<script type="text/javascript">
|
||||
define( 'display-structured', function(){
|
||||
require([ 'mvc/dataset/hda-edit' ], function( hdaEdit ){
|
||||
var hdaModel = require( 'mvc/dataset/hda-model' ),
|
||||
hdaJSON = ${ h.to_json_string( hda_dicts, indent=( 2 if trans.debug else 0 ) ) };
|
||||
require([ 'mvc/history/hda-li-edit', 'mvc/history/hda-model' ], function( hdaEdit, hdaModel ){
|
||||
var hdaJSON = ${ h.to_json_string( hda_dicts, indent=( 2 if trans.debug else 0 ) ) };
|
||||
|
||||
window.hdas = hdaJSON.map( function( hda ){
|
||||
return new hdaEdit.HDAEditView({
|
||||
return new hdaEdit.HDAListItemEdit({
|
||||
model : new hdaModel.HistoryDatasetAssociation( hda ),
|
||||
el : $( '#hda-' + hda.id ),
|
||||
linkTarget : '_self',
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
require.config({
|
||||
baseUrl : "${h.url_for( '/static/scripts' )}"
|
||||
});
|
||||
require([ 'mvc/history/annotated-history-panel' ], function( panelMod ){
|
||||
require([ 'mvc/history/history-panel-annotated' ], function( panelMod ){
|
||||
|
||||
function toggleExpanded( ev ){
|
||||
var $embeddedHistory = $( thisScript ).prev();
|
||||
|
||||
@@ -167,8 +167,9 @@ ${parent.javascripts()}
|
||||
historyJSON = ${h.to_json_string( history )},
|
||||
hdaJSON = ${h.to_json_string( hdas )};
|
||||
panelToUse = ( userIsOwner )?
|
||||
({ location: 'mvc/history/history-panel', className: 'HistoryPanel' }):
|
||||
({ location: 'mvc/history/readonly-history-panel', className: 'ReadOnlyHistoryPanel' });
|
||||
//TODO: change class names
|
||||
({ location: 'mvc/history/history-panel-edit', className: 'HistoryPanel' }):
|
||||
({ location: 'mvc/history/history-panel', className: 'ReadOnlyHistoryPanel' });
|
||||
|
||||
require.config({
|
||||
baseUrl : "${h.url_for( '/static/scripts' )}"
|
||||
|
||||
@@ -20,7 +20,7 @@ $(function(){
|
||||
<script type="text/javascript">
|
||||
define( 'app', function(){
|
||||
require([
|
||||
'mvc/history/current-history-panel'
|
||||
'mvc/history/history-panel-edit-current'
|
||||
], function( historyPanel ){
|
||||
$(function(){
|
||||
// history module is already in the dpn chain from the panel. We can re-scope it here.
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<div id="current-history-panel" class="history-panel"></div>
|
||||
## Don't bootstrap data here - confuses the browser history: load via API
|
||||
<script type="text/javascript">
|
||||
require([ "mvc/history/current-history-panel" ], function( historyPanel ){
|
||||
require([ "mvc/history/history-panel-edit-current" ], function( historyPanel ){
|
||||
$(function(){
|
||||
var currPanel = new historyPanel.CurrentHistoryPanel({
|
||||
el : $( "#current-history-panel" ),
|
||||
|
||||
Reference in New Issue
Block a user