Collections view drill-down: (still a work in progress) allow overlay of collection panel view over *current* history panel (not implemented for other history panels), refactoring of history/hda/collections; remove unused init_history_items; pack scripts

This commit is contained in:
Carl Eberhard
2014-07-31 12:05:26 -04:00
parent 3274ec834b
commit 4762943341
35 changed files with 1584 additions and 972 deletions
-82
View File
@@ -463,88 +463,6 @@ function async_save_text( click_to_edit_elt, text_elt_id, save_url,
});
}
function init_history_items(historywrapper, noinit, nochanges) {
//NOTE: still needed for non-panel history views
var action = function() {
// Load saved state and show as necessary
try {
var stored = $.jStorage.get("history_expand_state");
if (stored) {
for (var id in stored) {
$("#" + id + " div.historyItemBody" ).show();
}
}
} catch(err) {
// Something was wrong with values in storage, so clear storage
$.jStorage.deleteKey("history_expand_state");
}
// If Mozilla, hide scrollbars in hidden items since they cause animation bugs
if ( $.browser.mozilla ) {
$( "div.historyItemBody" ).each( function() {
if ( !$(this).is(":visible") ) { $(this).find( "pre.peek" ).css( "overflow", "hidden" ); }
});
}
historywrapper.each( function() {
var id = this.id,
body = $(this).children( "div.historyItemBody" ),
peek = body.find( "pre.peek" );
$(this).find( ".historyItemTitleBar > .historyItemTitle" ).wrap( "<a href='javascript:void(0);'></a>" )
.click( function() {
var prefs;
if ( body.is(":visible") ) {
// Hiding stuff here
if ( $.browser.mozilla ) { peek.css( "overflow", "hidden" ); }
body.slideUp( "fast" );
if (!nochanges) { // Ignore embedded item actions
// Save setting
prefs = $.jStorage.get("history_expand_state");
if (prefs) {
delete prefs[id];
$.jStorage.set("history_expand_state", prefs);
}
}
} else {
// Showing stuff here
body.slideDown( "fast", function() {
if ( $.browser.mozilla ) { peek.css( "overflow", "auto" ); }
});
if (!nochanges) {
// Save setting
prefs = $.jStorage.get("history_expand_state");
if (!prefs) { prefs = {}; }
prefs[id] = true;
$.jStorage.set("history_expand_state", prefs);
}
}
return false;
});
});
// Generate 'collapse all' link
$("#top-links > a.toggle").click( function() {
var prefs = $.jStorage.get("history_expand_state");
if (!prefs) { prefs = {}; }
$( "div.historyItemBody:visible" ).each( function() {
if ( $.browser.mozilla ) {
$(this).find( "pre.peek" ).css( "overflow", "hidden" );
}
$(this).slideUp( "fast" );
if (prefs) {
delete prefs[$(this).parent().attr("id")];
}
});
$.jStorage.set("history_expand_state", prefs);
}).show();
};
action();
}
function commatize( number ) {
number += ''; // Convert to string
var rgx = /(\d+)(\d{3})/;
+137 -1
View File
@@ -220,11 +220,147 @@ function mixin( mixinHash1, /* mixinHash2, etc: ... variadic */ propsHash ){
}
//==============================================================================
var ExpandableView = Backbone.View.extend( LoggableMixin ).extend({
//TODO: Although the reasoning behind them is different, this shares a lot with HiddenUntilActivated above: combine them
//PRECONDITION: model must have method hasDetails
initialize : function( attributes ){
/** are the details of this view expanded/shown or not? */
this.expanded = attributes.expanded || false;
this.log( '\t expanded:', this.expanded );
},
// ........................................................................ render main
//TODO: for lack of a better place, add rendering logic here
fxSpeed : 'fast',
/** Render this content, set up ui.
* @param {Integer} speed the speed of the render
* @fires rendered when rendered
* @fires rendered:ready when first rendered and NO running HDAs
* @returns {Object} this HDABaseView
*/
render : function( speed ){
var $newRender = this._buildNewRender();
this._queueNewRender( $newRender, speed );
return this;
},
_buildNewRender : function(){
// create a new render using a skeleton template, render title buttons, render body, and set up events, etc.
var $newRender = $( this.templates.skeleton( this.model.toJSON() ) );
if( this.expanded ){
$newRender.children( '.details' ).replaceWith( this._renderDetails() );
}
this._setUpBehaviors( $newRender );
return $newRender;
},
/** Fade out the old el, replace with new dom, then fade in.
* @param {Boolean} fade whether or not to fade out/in when re-rendering
* @fires rendered when rendered
* @fires rendered:ready when first rendered and NO running HDAs
*/
_queueNewRender : function( $newRender, speed ) {
speed = ( speed === undefined )?( this.fxSpeed ):( speed );
var view = this;
$( view ).queue( 'fx', [
function( next ){ this.$el.fadeOut( speed, next ); },
function( next ){
view._swapNewRender( $newRender );
next();
},
function( next ){ this.$el.fadeIn( speed, next ); },
function( next ){
this.trigger( 'rendered', view );
next();
}
]);
},
_swapNewRender : function( $newRender ){
return this.$el.empty().attr( 'class', this.className ).append( $newRender.children() );
},
/** set up js behaviors, event handlers for elements within the given container
* @param {jQuery} $container jq object that contains the elements to process (defaults to this.$el)
*/
_setUpBehaviors : function( $container ){
$container = $container || this.$el;
// set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.)
make_popup_menus( $container );
$container.find( '[title]' ).tooltip({ placement : 'bottom' });
},
// ......................................................................... details
_renderDetails : function(){
// override this
return null;
},
// ......................................................................... expansion/details
/** Show or hide the body/details of history content.
* @param {Boolean} expand if true, expand; if false, collapse
*/
toggleExpanded : function( expand ){
expand = ( expand === undefined )?( !this.expanded ):( expand );
if( expand ){
this.expand();
} else {
this.collapse();
}
return this;
},
/** Render and show the full, detailed body of this view including extra data and controls.
* note: if the model does not have detailed data, fetch that data before showing the body
* @fires expanded when a body has been expanded
*/
expand : function(){
var view = this;
function _renderDetailsAndExpand(){
view.$( '.details' ).replaceWith( view._renderDetails() );
// needs to be set after the above or the slide will not show
view.expanded = true;
view.$( '.details' ).slideDown( view.fxSpeed, function(){
view.trigger( 'expanded', view );
});
}
//TODO:?? remove
// fetch first if no details in the model
if( !view.model.hasDetails() ){
// we need the change event on HDCA's for the elements to be processed - so silent == false
view.model.fetch().always( function( model ){
_renderDetailsAndExpand();
});
//TODO: no error handling
} else {
_renderDetailsAndExpand();
}
},
/** Hide the body/details of an HDA.
* @fires collapsed when a body has been collapsed
*/
collapse : function(){
var view = this;
view.expanded = false;
this.$( '.details' ).slideUp( view.fxSpeed, function(){
view.trigger( 'collapsed', view );
});
}
});
//==============================================================================
return {
LoggableMixin : LoggableMixin,
SessionStorageModel : SessionStorageModel,
HiddenUntilActivatedViewMixin : HiddenUntilActivatedViewMixin,
mixin : mixin
mixin : mixin,
ExpandableView : ExpandableView
};
});
+128 -46
View File
@@ -16,6 +16,7 @@ define([
*/
var DatasetCollectionElement = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
/** @lends DatasetCollectionElement.prototype */{
//TODO:?? this model may be unneccessary - it reflects the api structure, but...
// if we munge the element with the element.object at parse, we can flatten the entire hierarchy
@@ -24,7 +25,6 @@ var DatasetCollectionElement = Backbone.Model.extend( BASE_MVC.LoggableMixin ).e
//logger : console,
defaults : {
id : null,
model_class : 'DatasetCollectionElement',
element_identifier : null,
element_index : null,
@@ -41,33 +41,48 @@ var DatasetCollectionElement = Backbone.Model.extend( BASE_MVC.LoggableMixin ).e
this.object = this._createObjectModel();
this.on( 'change:object', function(){
//console.log( 'change:object' );
//this.log( 'change:object' );
//TODO: prob. better to update the sub-model instead of re-creating it
this.object = this._createObjectModel();
});
},
_createObjectModel : function(){
//console.log( '_createObjectModel', this.get( 'object' ), this.object );
//this.log( '_createObjectModel', this.get( 'object' ), this.object );
//TODO: same patterns as HDCA _createElementsModel - refactor to BASE_MVC.hasSubModel?
if( _.isUndefined( this.object ) ){ this.object = null; }
if( !this.get( 'object' ) ){ return this.object; }
var object = this.get( 'object' );
var object = this.get( 'object' ),
ObjectClass = this._getObjectClass();
this.unset( 'object', { silent: true });
this.object = new ObjectClass( object );
return this.object;
},
_getObjectClass : function(){
this.debug( 'DCE, element_type:', this.get( 'element_type' ) );
switch( this.get( 'element_type' ) ){
case 'dataset_collection':
this.object = new DatasetCollection( object );
break;
return DatasetCollection;
case 'hda':
this.object = new HDA_MODEL.HistoryDatasetAssociation( object );
break;
default:
throw new TypeError( 'Unknown element_type: ' + this.get( 'element_type' ) );
return HDA_MODEL.HistoryDatasetAssociation;
}
return this.object;
throw new TypeError( 'Unknown element_type: ' + this.get( 'element_type' ) );
},
toJSON : function(){
var json = Backbone.Model.prototype.toJSON.call( this );
if( this.object ){
json.object = this.object.toJSON();
}
return json;
},
hasDetails : function(){
return ( this.object !== null
&& this.object.hasDetails() );
},
/** String representation. */
@@ -78,6 +93,52 @@ var DatasetCollectionElement = Backbone.Model.extend( BASE_MVC.LoggableMixin ).e
});
//==============================================================================
/** @class Backbone model for
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var HDADCE = DatasetCollectionElement.extend(
/** @lends DatasetCollectionElement.prototype */{
_getObjectClass : function(){
return HDA_MODEL.HistoryDatasetAssociation;
},
/** String representation. */
toString : function(){
var objStr = ( this.object )?( '' + this.object ):( this.get( 'element_identifier' ) );
return ([ 'HDADCE(', objStr, ')' ].join( '' ));
}
});
//==============================================================================
/** @class Backbone model for
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var DCDCE = DatasetCollectionElement.extend(
/** @lends DatasetCollectionElement.prototype */{
_getObjectClass : function(){
return DatasetCollection;
},
getVisibleContents : function(){
return this.object? this.object.getVisibleContents(): [];
},
/** String representation. */
toString : function(){
var objStr = ( this.object )?( '' + this.object ):( this.get( 'element_identifier' ) );
return ([ 'DCDCE(', objStr, ')' ].join( '' ));
}
});
//==============================================================================
/** @class Backbone collection for DCEs.
* NOTE: used *only* in second level of list:paired collections (a
@@ -87,7 +148,7 @@ var DatasetCollectionElement = Backbone.Model.extend( BASE_MVC.LoggableMixin ).e
* @borrows LoggableMixin#log as #log
* @constructs
*/
var DatasetCollectionElementCollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).extend(
var DCECollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).extend(
/** @lends DatasetCollectionElementCollection.prototype */{
model: DatasetCollectionElement,
@@ -111,6 +172,40 @@ var DatasetCollectionElementCollection = Backbone.Collection.extend( BASE_MVC.Lo
});
//==============================================================================
/** @class Backbone collection for
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var HDADCECollection = DCECollection.extend(
/** @lends DatasetCollectionElementCollection.prototype */{
model: HDADCE,
/** String representation. */
toString : function(){
return ([ 'HDADCECollection(', this.length, ')' ].join( '' ));
}
});
//==============================================================================
/** @class Backbone collection for
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var DCDCECollection = DCECollection.extend(
/** @lends DatasetCollectionElementCollection.prototype */{
model: DCDCE,
/** String representation. */
toString : function(){
return ([ 'DCDCECollection(', this.length, ')' ].join( '' ));
}
});
//==============================================================================
/** @class Backbone model for Dataset Collections.
* DCs contain a bbone collection named 'elements' using the class found in
@@ -133,7 +228,7 @@ var DatasetCollection = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
collection_type : 'list'
},
collectionClass : DatasetCollectionElementCollection,
collectionClass : DCECollection,
/** */
initialize : function( model, options ){
@@ -159,11 +254,25 @@ var DatasetCollection = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
return this.elements;
},
toJSON : function(){
var json = Backbone.Model.prototype.toJSON.call( this );
if( this.elements ){
json.elements = this.elements.toJSON();
}
return json;
},
hasDetails : function(){
//TODO: this is incorrect for (accidentally) empty collections
this.debug( 'hasDetails:', this.elements.length );
return this.elements.length !== 0;
},
getVisibleContents : function( filters ){
//TODO: filters unused for now
return this.elements;
},
// ........................................................................ misc
/** String representation */
toString : function(){
@@ -173,38 +282,12 @@ var DatasetCollection = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
});
//==============================================================================
/** @class Backbone collection for a collection of collection collections collecting correctly. */
var DatasetCollectionCollection = Backbone.Collection.extend( BASE_MVC.LoggableMixin ).extend({
model: DatasetCollection,
///** logger used to record this.log messages, commonly set to console */
//// comment this out to suppress log output
//logger : console,
/** Set up.
* @see Backbone.Collection#initialize
*/
initialize : function( models, options ){
options = options || {};
this.info( 'DatasetCollectionCollection.initialize:', models, options );
//this._setUpListeners();
},
/** String representation. */
toString : function(){
return ([ 'DatasetCollectionCollection(', this.get( 'name' ), ')' ].join( '' ));
}
});
//NOTE: the following prototypes may not be necessary - but I wanted to specifiy
// them (for now) and allow for the possibility of unique functionality
//==============================================================================
var ListDatasetCollection = DatasetCollection.extend(
/** @lends ListDatasetCollection.prototype */{
collectionClass : HDADCECollection,
/** String representation. */
toString : function(){
return ([ 'ListDatasetCollection(', this.get( 'name' ), ')' ].join( '' ));
@@ -213,7 +296,7 @@ var ListDatasetCollection = DatasetCollection.extend(
//==============================================================================
var PairDatasetCollection = DatasetCollection.extend(
var PairDatasetCollection = ListDatasetCollection.extend(
/** @lends ListDatasetCollection.prototype */{
/** String representation. */
@@ -227,6 +310,8 @@ var PairDatasetCollection = DatasetCollection.extend(
var ListPairedDatasetCollection = DatasetCollection.extend(
/** @lends ListDatasetCollection.prototype */{
collectionClass : DCDCECollection,
// list:paired is the only collection that itself contains collections
//collectionClass : DatasetCollectionCollection,
@@ -239,10 +324,7 @@ var ListPairedDatasetCollection = DatasetCollection.extend(
//==============================================================================
return {
DatasetCollectionElement : DatasetCollectionElement,
DatasetCollectionElementCollection : DatasetCollectionElementCollection,
DatasetCollection : DatasetCollection,
DatasetCollectionCollection : DatasetCollectionCollection,
//DatasetCollection : DatasetCollection,
ListDatasetCollection : ListDatasetCollection,
PairDatasetCollection : PairDatasetCollection,
ListPairedDatasetCollection : ListPairedDatasetCollection
+155 -103
View File
@@ -1,13 +1,13 @@
define([
"mvc/collection/dataset-collection-base",
"mvc/dataset/hda-base",
"mvc/base-mvc",
"utils/localization"
], function( DC_BASE, HDA_BASE, BASE_MVC, _l ){
], function( DC_BASE, BASE_MVC, _l ){
/* =============================================================================
TODO:
============================================================================= */
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection.
* @name CollectionPanel
*
@@ -18,17 +18,20 @@ TODO:
*/
var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
/** @lends CollectionPanel.prototype */{
//MODEL is either a DatasetCollection (or subclass) or a DatasetCollectionElement (list of pairs)
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
//logger : console,
tagName : 'div',
className : 'history-panel',
className : 'dataset-collection-panel',
/** (in ms) that jquery effects will use */
fxSpeed : 'fast',
DCEViewClass : DC_BASE.DCEBaseView,
// ......................................................................... SET UP
/** Set up the view, set up storage, bind listeners to HistoryContents events
* @param {Object} attributes optional settings for the panel
@@ -42,7 +45,10 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
this.log( this + '.initialize:', attributes );
this.hasUser = attributes.hasUser;
this.HDAViewClass = attributes.HDAViewClass || HDA_BASE.HDABaseView;
this.panelStack = [];
this.parentName = attributes.parentName;
window.collectionPanel = this;
},
/** create any event listeners for the panel
@@ -74,7 +80,7 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
this.log( 'render:', speed, callback );
// send a speed of 0 to have no fade in/out performed
speed = ( speed === undefined )?( this.fxSpeed ):( speed );
//console.debug( this + '.render, fxSpeed:', speed );
//this.debug( this + '.render, fxSpeed:', speed );
var panel = this,
$newRender;
@@ -123,7 +129,13 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
*/
renderModel : function( ){
// tmp div for final swap in render
var $newRender = $( '<div/>' ).append( CollectionPanel.templates.panel( this.model.toJSON() ) );
//TODO: ugh - reuse issue - refactor out
var type = this.model.get( 'collection_type' ) || this.model.object.get( 'collection_type' ),
json = _.extend( this.model.toJSON(), {
parentName : this.parentName,
type : type
}),
$newRender = $( '<div/>' ).append( this.templates.panel( json ) );
this._setUpBehaviours( $newRender );
this.renderContents( $newRender );
return $newRender;
@@ -154,13 +166,15 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
* @returns the number of visible hda views
*/
renderContents : function( $whereTo ){
//console.debug( 'renderContents, elements:', this.model.elements );
//this.debug( 'renderContents, elements:', this.model.elements );
$whereTo = $whereTo || this.$el;
this.warn( this + '.renderContents:, model:', this.model );
var panel = this,
contentViews = {},
visibleContents = this.model.elements || [];
//this.log( 'renderContents, visibleContents:', visibleContents, $whereTo );
//NOTE: no filtering here
visibleContents = this.model.getVisibleContents();
this.log( 'renderContents, visibleContents:', visibleContents, $whereTo );
this.$datasetsList( $whereTo ).empty();
if( visibleContents && visibleContents.length ){
@@ -168,66 +182,92 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
var contentId = content.id,
contentView = panel._createContentView( content );
contentViews[ contentId ] = contentView;
panel.attachContentView( contentView.render(), $whereTo );
panel._attachContentView( contentView.render(), $whereTo );
});
}
this.contentViews = contentViews;
return this.contentViews;
},
/**
* @param {HistoryDatasetAssociation} content
*/
/** */
_createContentView : function( content ){
//console.debug( 'content json:', JSON.stringify( content, null, ' ' ) );
//this.debug( 'content json:', JSON.stringify( content, null, ' ' ) );
var contentView = null,
ContentClass = this._getContentClass( content );
//console.debug( 'content.object json:', JSON.stringify( content.object, null, ' ' ) );
//console.debug( 'ContentClass:', ContentClass );
//console.debug( 'content:', content );
//console.debug( 'content.object:', content.object );
//this.debug( 'content.object json:', JSON.stringify( content.object, null, ' ' ) );
this.debug( 'ContentClass:', ContentClass );
//this.debug( 'content:', content );
this.debug( 'content.object:', content.object );
contentView = new ContentClass({
model : content.object,
model : content,
linkTarget : this.linkTarget,
//draggable : true,
hasUser : this.hasUser,
logger : this.logger
});
//this._setUpHdaListeners( contentView );
this.debug( 'contentView:', contentView );
this._setUpContentListeners( contentView );
return contentView;
},
/** */
_getContentClass : function( content ){
this.debug( this + '._getContentClass:', content );
switch( content.get( 'element_type' ) ){
case 'hda':
return this.HDAViewClass;
return this.DCEViewClass;
case 'dataset_collection':
return DC_BASE.NestedDCEBaseView;
return this.DCEViewClass;
}
throw new TypeError( 'Unknown element type:', content.get( 'element_type' ) );
},
// /** 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 panel = this;
// hdaView.on( 'error', function( model, xhr, options, msg ){
// panel.errorHandler( model, xhr, options, msg );
// });
// // maintain a list of hdas whose bodies are expanded
// hdaView.on( 'body-expanded', function( model ){
// panel.storage.addExpandedHda( model );
// });
// hdaView.on( 'body-collapsed', function( id ){
// panel.storage.removeExpandedHda( id );
// });
// return this;
// },
/** Set up listeners for content view events. In this override, handle collection expansion. */
_setUpContentListeners : function( contentView ){
var panel = this;
if( contentView.model.get( 'element_type' ) === 'dataset_collection' ){
contentView.on( 'expanded', function( collectionView ){
panel.info( 'expanded', collectionView );
panel._addCollectionPanel( collectionView );
});
}
},
/** */
_addCollectionPanel : function( collectionView ){
var currPanel = this,
collectionModel = collectionView.model;
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' )
});
currPanel.panelStack.push( panel );
currPanel.$( '.controls' ).add( '.datasets-list' ).hide();
currPanel.$el.append( panel.$el );
panel.on( 'close', function(){
currPanel.render();
collectionView.collapse();
currPanel.panelStack.pop();
});
//TODO: to hdca-model, hasDetails
if( !panel.model.hasDetails() ){
var xhr = panel.model.fetch();
xhr.done( function(){
//TODO: (re-)render collection contents
panel.render();
});
} else {
panel.render();
}
},
/** attach an contentView to the panel */
attachContentView : function( contentView, $whereTo ){
_attachContentView : function( contentView, $whereTo ){
$whereTo = $whereTo || this.$el;
var $datasetsList = this.$datasetsList( $whereTo );
$datasetsList.append( contentView.$el );
@@ -237,90 +277,102 @@ var CollectionPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend(
// ------------------------------------------------------------------------ panel events
/** event map */
events : {
'click .panel-navigation-back' : 'close'
'click .navigation .back' : 'close'
},
/** */
close : function( event ){
this.$el.remove();
this.trigger( 'collection-close' );
this.trigger( 'close' );
},
// ........................................................................ misc
/** Return a string rep of the history */
/** string rep */
toString : function(){
return 'CollectionPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
}
});
//----------------------------------------------------------------------------- TEMPLATES
/** underscore templates */
CollectionPanel.templates = CollectionPanel.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var _panelTemplate = _.template([
'<div class="controls">',
'<div class="navigation">',
'<a class="back" href="javascript:void(0)">',
'<span class="fa fa-icon fa-angle-left"></span>',
_l( 'Back to ' ), '<%- collection.parentName %>',
'</a>',
'</div>',
//------------------------------------------------------------------------------ TEMPLATES
var _panelTemplate = [
'<div class="history-controls">',
'<div class="panel-navigation">',
'<a class="panel-navigation-back" href="javascript:void(0)">', _l( 'Back' ), '</a>',
'<div class="title">',
'<div class="name"><%- collection.name || collection.element_identifier %></div>',
'<div class="subtitle">',
//TODO: remove logic from template
'<% if( collection.type === "list" ){ %>',
_l( 'a list of datasets' ),
'<% } else if( collection.type === "paired" ){ %>',
_l( 'a pair of datasets' ),
'<% } else if( collection.type === "list:paired" ){ %>',
_l( 'a list of paired datasets' ),
'<% } %>',
'</div>',
'</div>',
'</div>',
// where the datasets/hdas are added
'<div class="datasets-list"></div>'
].join( '' ));
'<div class="history-title">',
'<% if( collection.name ){ %>',
'<div class="history-name"><%= collection.hid %> : <%= collection.name %></div>',
'<% } %>',
'</div>',
// we override here in order to pass the localizer (_L) into the template scope - since we use it as a fn within
return {
panel : function( json ){
return _panelTemplate({ _l: _l, collection: json });
}
};
}());
//'<div class="history-subtitle clear">',
// '<% if( history.nice_size ){ %>',
// '<div class="history-size"><%= history.nice_size %></div>',
// '<% } %>',
// '<div class="history-secondary-actions"></div>',
//'</div>',
//
//'<% if( history.deleted ){ %>',
// '<div class="warningmessagesmall"><strong>',
// _l( 'You are currently viewing a deleted history!' ),
// '</strong></div>',
//'<% } %>',
//
//'<div class="message-container">',
// '<% if( history.message ){ %>',
// // should already be localized
// '<div class="<%= history.status %>message"><%= history.message %></div>',
// '<% } %>',
//'</div>',
//
//'<div class="quota-message errormessage">',
// _l( 'You are over your disk quota' ), '. ',
// _l( 'Tool execution is on hold until your disk usage drops below your allocated quota' ), '.',
//'</div>',
//
//'<div class="tags-display"></div>',
//'<div class="annotation-display"></div>',
//'<div class="history-dataset-actions">',
// '<div class="btn-group">',
// '<button class="history-select-all-datasets-btn btn btn-default"',
// 'data-mode="select">', _l( 'All' ), '</button>',
// '<button class="history-deselect-all-datasets-btn btn btn-default"',
// 'data-mode="select">', _l( 'None' ), '</button>',
// '</div>',
// '<button class="history-dataset-action-popup-btn btn btn-default">',
// _l( 'For all selected' ), '...</button>',
//'</div>',
'</div>',
// end history controls
// where the datasets/hdas are added
'<div class="datasets-list"></div>'
].join( '' );
CollectionPanel.templates = {
panel : function( JSON ){
return _.template( _panelTemplate, JSON, { variable: 'collection' });
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
var ListCollectionPanel = CollectionPanel.extend({
DCEViewClass : DC_BASE.HDADCEBaseView,
// ........................................................................ misc
/** string rep */
toString : function(){
return 'ListCollectionPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
}
};
});
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
var PairCollectionPanel = ListCollectionPanel.extend({
// ........................................................................ misc
/** string rep */
toString : function(){
return 'PairCollectionPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
}
});
// =============================================================================
/** @class non-editable, read-only View/Controller for a dataset collection. */
var ListOfPairsCollectionPanel = CollectionPanel.extend({
DCEViewClass : DC_BASE.DCDCEBaseView,
// ........................................................................ misc
/** string rep */
toString : function(){
return 'ListOfPairsCollectionPanel(' + (( this.model )?( this.model.get( 'name' )):( '' )) + ')';
}
});
//==============================================================================
return {
CollectionPanel: CollectionPanel
CollectionPanel : CollectionPanel,
ListCollectionPanel : ListCollectionPanel,
PairCollectionPanel : PairCollectionPanel,
ListOfPairsCollectionPanel : ListOfPairsCollectionPanel
};
});
@@ -29,7 +29,82 @@ var DCBaseView = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
this.log( 'DCBaseView.initialize:', attributes );
},
//TODO: render has been removed from the inheritance chain here, so this won't work when called as is
// ........................................................................ render main
/** Render this content, set up ui.
* @param {Boolean} fade whether or not to fade out/in when re-rendering
* @fires rendered when rendered
* @fires rendered:ready when first rendered and NO running HDAs
* @returns {Object} this HDABaseView
*/
render : function( fade ){
var $newRender = this._buildNewRender();
this._queueNewRender( $newRender, fade );
return this;
},
_buildNewRender : function(){
// create a new render using a skeleton template, render title buttons, render body, and set up events, etc.
var $newRender = $( this.templates.skeleton( this.model.toJSON() ) );
$newRender.find( '.primary-actions' ).append( this._render_primaryActions() );
this._setUpBehaviors( $newRender );
//this._renderSelectable( $newRender );
return $newRender;
},
/** Fade out the old el, replace with new dom, then fade in.
* @param {Boolean} fade whether or not to fade out/in when re-rendering
* @fires rendered when rendered
* @fires rendered:ready when first rendered and NO running HDAs
*/
_queueNewRender : function( $newRender, fade ) {
fade = ( fade === undefined )?( true ):( fade );
var view = this;
// fade the old render out (if desired)
if( fade ){
$( view ).queue( function( next ){ this.$el.fadeOut( view.fxSpeed, next ); });
}
// empty the old render, swap in the new render contents
$( view ).queue( function( next ){
//TODO:?? change to replaceWith pattern?
this.$el.empty().attr( 'class', view.className ).append( $newRender.children() );
next();
});
// fade the new in
if( fade ){
$( view ).queue( function( next ){ this.$el.fadeIn( view.fxSpeed, next ); });
}
// trigger an event to know we're ready
$( view ).queue( function( next ){
this.trigger( 'rendered', view );
next();
});
},
/** set up js behaviors, event handlers for elements within the given container
* @param {jQuery} $container jq object that contains the elements to process (defaults to this.$el)
*/
_setUpBehaviors : function( $container ){
$container = $container || this.$el;
make_popup_menus( $container );
$container.find( '[title]' ).tooltip({ placement : 'bottom' });
},
// ........................................................................ titlebar buttons
/** Render icon-button group for the common, most easily accessed actions.
* @returns {jQuery} rendered DOM or null
*/
_render_primaryActions : function(){
// override
return [];
},
// ......................................................................... misc
events : {
'click .title-bar' : function( event ){
this.trigger( 'expanded', this );
}
},
// ......................................................................... misc
/** String representation */
@@ -40,37 +115,23 @@ var DCBaseView = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
});
/** templates for DCBaseViews (skeleton and body) */
DCBaseView.templates = (function(){
DCBaseView.templates = DCBaseView.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var skeletonTemplate = _.template([
'<div class="dataset hda">',
'<div class="dataset-warnings">',
'<% if ( collection.deleted ) { %>',
'<div class="dataset-deleted-msg warningmessagesmall"><strong>',
_l( 'This collection has been deleted.' ),
'</div>',
'<% } %>',
'<% if ( !collection.visible ) { %>',
'<div class="dataset-hidden-msg warningmessagesmall"><strong>',
_l( 'This collection has been hidden.' ),
'</div>',
'<% } %>',
'</div>',
'<div class="dataset-primary-actions"></div>',
'<div class="dataset-title-bar clear" tabindex="0">',
'<span class="dataset-state-icon state-icon"></span>',
'<div class="dataset-title">',
'<span class="dataset-name"><%- collection.name %></span>',
'<div class="dataset-collection">',
'<div class="primary-actions"></div>',
'<div class="title-bar clear" tabindex="0">',
'<div class="title">',
'<span class="name"><%- collection.element_identifier %></span>',
'</div>',
'</div>',
'<div class="dataset-body"></div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
var bodyTemplate = _.template([
'<div class="dataset-body">',
'<div class="dataset-summary">',
_l( 'A dataset collection.' ),
'<div class="details">',
'<div class="summary">', _l( 'A dataset collection.' ), '</div>',
'</div>'
].join( '' ));
@@ -86,66 +147,312 @@ DCBaseView.templates = (function(){
}());
//TODO: unused
////==============================================================================
///** @class Read only view for DatasetCollectionElement.
// * @name DCEBaseView
// *
// * @augments Backbone.View
// * @borrows LoggableMixin#logger as #logger
// * @borrows LoggableMixin#log as #log
// * @constructs
// */
//var NestedDCBaseView = DCBaseView.extend({
//
// logger : console,
//
// /** */
// initialize : function( attributes ){
// if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
// this.warn( this + '.initialize:', attributes );
// DCBaseView.prototype.initialize.call( this, attributes );
// },
//
// _template : function(){
// this.debug( this.model );
// this.debug( this.model.toJSON() );
// return NestedDCBaseView.templates.skeleton( this.model.toJSON() );
// },
//
// // ......................................................................... misc
// /** String representation */
// toString : function(){
// var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
// return 'NestedDCBaseView(' + modelString + ')';
// }
//});
//
////------------------------------------------------------------------------------ TEMPLATES
////TODO: possibly break these out into a sep. module
//NestedDCBaseView.templates = (function(){
// var skeleton = _.template([
// '<div class="dataset hda history-panel-hda state-ok">',
// '<div class="dataset-primary-actions"></div>',
// '<div class="dataset-title-bar clear" tabindex="0">',
// '<div class="dataset-title">',
// '<span class="dataset-name"><%= collection.name %></span>',
// '</div>',
// '</div>',
// '</div>'
// ].join( '' ));
// // we override here in order to pass the localizer (_L) into the template scope - since we use it as a fn within
// return {
// skeleton : function( json ){
// return skeleton({ _l: _l, collection: json });
// }
// };
//}());
//==============================================================================
/** @class Read only view for DatasetCollectionElement.
* @name DCBaseView
*
* @augments Backbone.View
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var DCEBaseView = BASE_MVC.ExpandableView.extend({
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
//logger : console,
/** */
className : "dataset-collection-element collection-dataset dataset",
/** */
fxSpeed : 'fast',
/** */
initialize : function( attributes ){
if( attributes.logger ){ this.logger = this.model.logger = attributes.logger; }
this.log( 'DCEBaseView.initialize:', attributes );
BASE_MVC.ExpandableView.prototype.initialize.call( this, attributes );
},
// ......................................................................... renderers
/** Render the enclosing div of the hda body and, if expanded, the html in the body
* @returns {jQuery} rendered DOM
*/
_renderDetails : function(){
var $details = $( this.templates.details( this.model.toJSON() ) );
this._setUpBehaviors( $details );
// only render the body html if it's being shown
if( this.expanded ){
$details.show();
}
return $details;
},
// ......................................................................... events
events : {
// expand the body when the title is clicked or when in focus and space or enter is pressed
'click .title-bar' : '_clickTitleBar',
'keydown .title-bar' : '_keyDownTitleBar'
},
_clickTitleBar : function( event ){
event.stopPropagation();
this.toggleExpanded();
},
_keyDownTitleBar : function( event ){
// bail (with propagation) if keydown and not space or enter
var KEYCODE_SPACE = 32, KEYCODE_RETURN = 13;
if( event && ( event.type === 'keydown' )
&&( event.keyCode === KEYCODE_SPACE || event.keyCode === KEYCODE_RETURN ) ){
this.toggleExpanded();
event.stopPropagation();
return false;
}
return true;
},
// ......................................................................... misc
/** String representation */
toString : function(){
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
return 'DCEBaseView(' + modelString + ')';
}
});
/** templates for DCBaseViews (skeleton and body) */
DCEBaseView.templates = DCEBaseView.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var skeletonTemplate = _.template([
'<div class="dataset-collection-element collection-dataset dataset">',
'<div class="primary-actions"></div>',
'<div class="title-bar clear" tabindex="0">',
'<span class="state-icon"></span>',
'<div class="title">',
'<span class="name"><%- collection.element_identifier %></span>',
'</div>',
'</div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
var bodyTemplate = _.template([
'<div class="details">',
'<div class="summary">',
_l( 'A dataset collection element.' ),
'</div>',
'</div>'
].join( '' ));
// we override here in order to pass the localizer (_L) into the template scope - since we use it as a fn within
return {
skeleton : function( collectionJSON ){
return skeletonTemplate({ _l: _l, collection: collectionJSON });
},
body : function( collectionJSON ){
return bodyTemplate({ _l: _l, collection: collectionJSON });
}
};
}());
//==============================================================================
/** @class Read only view for DatasetCollectionElement.
* @name DCBaseView
*
* @augments Backbone.View
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var HDADCEBaseView = DCEBaseView.extend({
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
//logger : console,
// ......................................................................... misc
/** String representation */
toString : function(){
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
return 'HDADCEBaseView(' + modelString + ')';
}
});
/** templates for DCBaseViews (skeleton and body) */
HDADCEBaseView.templates = HDADCEBaseView.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var skeletonTemplate = _.template([
'<div class="dataset-collection-element dataset">',
'<div class="primary-actions"></div>',
'<div class="title-bar clear" tabindex="0">',
'<span class="state-icon"></span>',
'<div class="title">',
//TODO:?? re-check this: in pairs the name and identifier are different - but not otherwise
'<span class="name"><%- element.element_identifier %></span>',
'</div>',
// '<% if( element.element_identifier !== hda.name ){ %>',
// '<div class="subtitle"><%- element.element_identifier %></div>',
// '<% } %>',
'</div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
var detailsTemplate = _.template([
'<div class="details">',
'<div class="summary">',
'<% if( hda.misc_blurb ){ %>',
'<div class="blurb">',
'<span class="value"><%- hda.misc_blurb %></span>',
'</div>',
'<% } %>',
'<% if( hda.data_type ){ %>',
'<div class="datatype">',
'<label class="prompt">', _l( 'format' ), '</label>',
'<span class="value"><%- hda.data_type %></span>',
'</div>',
'<% } %>',
'<% if( hda.metadata_dbkey ){ %>',
'<div class="dbkey">',
'<label class="prompt">', _l( 'database' ), '</label>',
'<span class="value">',
'<%- hda.metadata_dbkey %>',
'</span>',
'</div>',
'<% } %>',
'<% if( hda.misc_info ){ %>',
'<div class="info">',
'<span class="value"><%- hda.misc_info %></span>',
'</div>',
'<% } %>',
'</div>',
// end dataset-summary
'<div class="actions clear">',
'<div class="left"></div>',
'<div class="right"></div>',
'</div>',
'<% if( !hda.deleted ){ %>',
'<div class="tags-display"></div>',
'<div class="annotation-display"></div>',
'<div class="display-applications">',
//TODO: the following two should be compacted
'<% _.each( hda.display_apps, function( app ){ %>',
'<div class="display-application">',
'<span class="display-application-location"><%- app.label %></span> ',
'<span class="display-application-links">',
'<% _.each( app.links, function( link ){ %>',
'<a target="<%= link.target %>" href="<%= link.href %>">',
'<% print( _l( link.text ) ); %>',
'</a> ',
'<% }); %>',
'</span>',
'</div>',
'<% }); %>',
'<% _.each( hda.display_types, function( app ){ %>',
'<div class="display-application">',
'<span class="display-application-location"><%- app.label %></span> ',
'<span class="display-application-links">',
'<% _.each( app.links, function( link ){ %>',
'<a target="<%= link.target %>" href="<%= link.href %>">',
'<% print( _l( link.text ) ); %>',
'</a> ',
'<% }); %>',
'</span>',
'</div>',
'<% }); %>',
'</div>',
'<% if( hda.peek ){ %>',
'<pre class="dataset-peek"><%= hda.peek %></pre>',
'<% } %>',
'<% } %>',
// end if !deleted
'</div>'
].join( '' ));
// we override here in order to pass the localizer (_L) into the template scope - since we use it as a fn within
return {
skeleton : function( json ){
return skeletonTemplate({ _l: _l, element: json, hda: json.object });
},
details : function( json ){
return detailsTemplate({ _l: _l, element: json, hda: json.object });
}
};
}());
//==============================================================================
/** @class Read only view for DatasetCollectionElement.
* @name DCBaseView
*
* @augments Backbone.View
* @borrows LoggableMixin#logger as #logger
* @borrows LoggableMixin#log as #log
* @constructs
*/
var DCDCEBaseView = DCEBaseView.extend({
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
//logger : console,
// ......................................................................... misc
/** String representation */
expand : function(){
this.trigger( 'expanded', this );
},
// ......................................................................... misc
/** String representation */
toString : function(){
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
return 'DCDCEBaseView(' + modelString + ')';
}
});
/** templates for DCBaseViews (skeleton and body) */
DCDCEBaseView.templates = DCDCEBaseView.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var skeletonTemplate = _.template([
'<div class="dataset-collection-element dataset-collection">',
'<div class="primary-actions"></div>',
'<div class="title-bar clear" tabindex="0">',
'<span class="state-icon"></span>',
'<div class="title">',
'<span class="name"><%- element.element_identifier %></span>',
'</div>',
//TODO: currently correct, but needs logic if more nested types are added
'<div class="subtitle">', _l( 'paired datasets' ), '</div>',
'</div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
// we override here in order to pass the localizer (_L) into the template scope - since we use it as a fn within
return {
skeleton : function( json ){
return skeletonTemplate({ _l: _l, element: json, collection: json.object });
}
};
}());
//==============================================================================
return {
DCBaseView : DCBaseView,
//NestedDCBaseView : NestedDCBaseView,
DCEBaseView : DCEBaseView,
HDADCEBaseView : HDADCEBaseView,
DCDCEBaseView : DCDCEBaseView
};
});
+44 -12
View File
@@ -22,8 +22,9 @@ var HDCABaseView = _super.extend( BASE_MVC.mixin( HCVMixin, {
// comment this out to suppress log output
//logger : console,
//TODO: not a dataset
/** */
className : "dataset hda history-panel-hda",
className : "dataset hdca history-panel-hda",
/** */
initialize : function( attributes ){
@@ -52,6 +53,26 @@ var HDCABaseView = _super.extend( BASE_MVC.mixin( HCVMixin, {
return $body;
},
/** In this override, do not slide down or render any body/details - allow the container to handle it
* @fires expanded when a body has been expanded
*/
expand : function(){
this.warn( this + '.expand' );
var contentView = this;
// fetch first if no details in the model
if( this.model.inReadyState() && !this.model.hasDetails() ){
// we need the change event on HDCA's for the elements to be processed - so silent == false
this.model.fetch().always( function( model ){
contentView.expanded = true;
contentView.trigger( 'expanded', contentView );
});
} else {
contentView.expanded = true;
contentView.trigger( 'expanded', contentView );
}
},
// ......................................................................... misc
/** String representation */
toString : function(){
@@ -64,7 +85,8 @@ var HDCABaseView = _super.extend( BASE_MVC.mixin( HCVMixin, {
HDCABaseView.templates = HDCABaseView.prototype.templates = (function(){
// use closure to run underscore template fn only once at module load
var skeletonTemplate = _.template([
'<div class="dataset hda">',
//TODO: not a dataset
'<div class="dataset hdca">',
'<div class="dataset-warnings">',
'<% if ( collection.deleted ) { %>',
'<div class="dataset-deleted-msg warningmessagesmall"><strong>',
@@ -77,22 +99,32 @@ HDCABaseView.templates = HDCABaseView.prototype.templates = (function(){
'</div>',
'<% } %>',
'</div>',
'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>',
'<div class="dataset-primary-actions"></div>',
'<div class="dataset-title-bar clear" tabindex="0">',
'<span class="dataset-state-icon state-icon"></span>',
'<div class="dataset-title">',
'<span class="hda-hid"><%- collection.hid %></span> ',
'<span class="dataset-name"><%- collection.name %></span>',
'<div class="selector"><span class="fa fa-2x fa-square-o"></span></div>',
'<div class="primary-actions"></div>',
'<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">',
//TODO: remove from template logic
'<% if( collection.collection_type === "list" ){ %>',
_l( 'a list of datasets' ),
'<% } else if( collection.collection_type === "paired" ){ %>',
_l( 'a pair of datasets' ),
'<% } else if( collection.collection_type === "list:paired" ){ %>',
_l( 'a list of paired datasets' ),
'<% } %>',
'</div>',
'</div>',
'<div class="dataset-body"></div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
var bodyTemplate = _.template([
'<div class="dataset-body">',
'<div class="dataset-summary">',
'<div class="details">',
'<div class="summary">',
_l( 'A dataset collection.' ),
'</div>'
].join( '' ));
+4 -4
View File
@@ -23,13 +23,13 @@ var HDCAEditView = _super.extend({
// ......................................................................... edit attr, delete
/** Render icon-button group for the common, most easily accessed actions.
* Overrides _render_titleButtons to include editing related buttons.
* Overrides _render_primaryActions to include editing related buttons.
* @returns {jQuery} rendered DOM
*/
_render_titleButtons : function(){
this.log( this + '._render_titleButtons' );
_render_primaryActions : function(){
this.log( this + '._render_primaryActions' );
// render the display, edit attr and delete icon-buttons
return _super.prototype._render_titleButtons.call( this )
return _super.prototype._render_primaryActions.call( this )
.concat([
this._render_deleteButton()
]);
+6 -14
View File
@@ -5,20 +5,15 @@ define([
], function( HISTORY_CONTENT, DC_MODEL, _l ){
//==============================================================================
var hcontentMixin = HISTORY_CONTENT.HistoryContentMixin,
/** @class Backbone model for (generic) Dataset Collection within a History.
* @constructs
*/
HistoryDatasetCollection = DC_MODEL.DatasetCollection.extend( hcontentMixin );
ListDC = DC_MODEL.ListDatasetCollection,
PairDC = DC_MODEL.PairDatasetCollection,
ListPairedDC = DC_MODEL.ListPairedDatasetCollection;
//NOTE: the following prototypes may not be necessary - but I wanted to specifiy
// them (for now) and allow for the possibility of unique functionality
//==============================================================================
var ListDC = DC_MODEL.ListDatasetCollection,
/** @class Backbone model for List Dataset Collection within a History.
* @constructs
*/
HistoryListDatasetCollection = ListDC.extend( hcontentMixin ).extend(
var HistoryListDatasetCollection = ListDC.extend( hcontentMixin ).extend(
/** @lends HistoryListDatasetCollection.prototype */{
initialize : function( model, options ){
@@ -36,11 +31,10 @@ var ListDC = DC_MODEL.ListDatasetCollection,
//==============================================================================
var PairDC = DC_MODEL.PairDatasetCollection,
/** @class Backbone model for Pair Dataset Collection within a History.
* @constructs
*/
HistoryPairDatasetCollection = PairDC.extend( hcontentMixin ).extend(
var HistoryPairDatasetCollection = PairDC.extend( hcontentMixin ).extend(
/** @lends HistoryPairDatasetCollection.prototype */{
initialize : function( model, options ){
@@ -58,11 +52,10 @@ var PairDC = DC_MODEL.PairDatasetCollection,
//==============================================================================
var ListPairedDC = DC_MODEL.ListPairedDatasetCollection,
/** @class Backbone model for List of Pairs Dataset Collection within a History.
* @constructs
*/
HistoryListPairedDatasetCollection = ListPairedDC.extend( hcontentMixin ).extend(
var HistoryListPairedDatasetCollection = ListPairedDC.extend( hcontentMixin ).extend(
/** @lends HistoryListPairedDatasetCollection.prototype */{
initialize : function( model, options ){
@@ -81,7 +74,6 @@ var ListPairedDC = DC_MODEL.ListPairedDatasetCollection,
//==============================================================================
return {
HistoryDatasetCollection : HistoryDatasetCollection,
HistoryListDatasetCollection : HistoryListDatasetCollection,
HistoryPairDatasetCollection : HistoryPairDatasetCollection,
HistoryListPairedDatasetCollection : HistoryListPairedDatasetCollection
+33 -33
View File
@@ -23,7 +23,7 @@ var HDABaseView = _super.extend(
//logger : console,
tagName : "div",
className : "dataset hda history-panel-hda",
className : "dataset hda history-content",
id : function(){ return 'hda-' + this.model.get( 'id' ); },
fxSpeed : 'fast',
@@ -96,7 +96,7 @@ var HDABaseView = _super.extend(
/** In this override, render the dataset display button
* @returns {jQuery} rendered DOM
*/
_render_titleButtons : function(){
_render_primaryActions : function(){
// render just the display for read-only
return [ this._render_displayButton() ];
},
@@ -115,7 +115,7 @@ var HDABaseView = _super.extend(
var displayBtnData = {
target : this.linkTarget,
classes : 'dataset-display'
classes : 'display-btn'
};
// show a disabled display if the data's been purged
@@ -181,7 +181,7 @@ var HDABaseView = _super.extend(
if( _.isEmpty( meta_files ) ){
return $([
'<a href="' + urls.download + '" title="' + _l( 'Download' ) + '" ',
'class="icon-btn dataset-download-btn">',
'class="icon-btn download-btn">',
'<span class="fa fa-floppy-o"></span>',
'</a>'
].join( '' ) );
@@ -206,7 +206,7 @@ var HDABaseView = _super.extend(
'<div class="icon-btn-group">',
'<a href="' + urls.download + '" title="' + _l( 'Download' ) + '" ',
'class="icon-btn dataset-download-btn">',
'class="icon-btn download-btn">',
'<span class="fa fa-floppy-o"></span>',
// join these w/o whitespace or there'll be a gap when rendered
'</a><a class="icon-btn popup" id="' + menuId + '">',
@@ -256,7 +256,7 @@ var HDABaseView = _super.extend(
primaryButtonArray = primaryButtonArray || [];
var view = this,
$body = $( HDABaseView.templates.body( _.extend( this.model.toJSON(), { body: body })));
$body.find( '.dataset-actions .left' ).append(
$body.find( '.actions .left' ).append(
_.map( primaryButtonArray, function( renderingFn ){
return renderingFn.call( view );
})
@@ -358,7 +358,7 @@ var HDABaseView = _super.extend(
$body = $( HDABaseView.templates.body( this.model.toJSON() ) ),
// prepend the download btn to the defaults and render
btnRenderers = [ this._render_downloadButton ].concat( this.defaultPrimaryActionButtonRenderers );
$body.find( '.dataset-actions .left' ).append(
$body.find( '.actions .left' ).append(
_.map( btnRenderers, function( renderingFn ){
return renderingFn.call( view );
}));
@@ -385,11 +385,11 @@ var HDABaseView = _super.extend(
var hdaView = this;
function _renderBodyAndExpand(){
hdaView.$el.children( '.dataset-body' ).replaceWith( hdaView._renderBody() );
hdaView.$el.children( '.details' ).replaceWith( hdaView._renderBody() );
//NOTE: needs to be set after the above or the slide will not show
hdaView.expanded = true;
hdaView.$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
hdaView.trigger( 'expanded', hdaView.model );
hdaView.$el.children( '.details' ).slideDown( hdaView.fxSpeed, function(){
hdaView.trigger( 'expanded', hdaView );
});
}
// fetch first if no details in the model
@@ -429,24 +429,24 @@ var HDABaseView = _super.extend(
//TODO: possibly break these out into a sep. module
var skeletonTemplate = _.template([
'<div class="dataset hda">',
'<div class="dataset-warnings">',
'<div class="warnings">',
// error during index fetch - show error on dataset
'<% if( hda.error ){ %>',
'<div class="errormessagesmall">',
_l( 'There was an error getting the data for this dataset' ), ':<%- hda.error %>',
_l( 'There was an error getting the data for this dataset' ), ': <%- hda.error %>',
'</div>',
'<% } %>',
'<% if( hda.deleted ){ %>',
// purged and deleted
'<% if( hda.purged ){ %>',
'<div class="dataset-purged-msg warningmessagesmall"><strong>',
'<div class="purged-msg warningmessagesmall"><strong>',
_l( 'This dataset has been deleted and removed from disk' ) + '.',
'</strong></div>',
// deleted not purged
'<% } else { %>',
'<div class="dataset-deleted-msg warningmessagesmall"><strong>',
'<div class="deleted-msg warningmessagesmall"><strong>',
_l( 'This dataset has been deleted' ) + '.',
'</strong></div>',
'<% } %>',
@@ -454,61 +454,61 @@ var skeletonTemplate = _.template([
// hidden
'<% if( !hda.visible ){ %>',
'<div class="dataset-hidden-msg warningmessagesmall"><strong>',
'<div class="hidden-msg warningmessagesmall"><strong>',
_l( 'This dataset has been hidden' ) + '.',
'</strong></div>',
'<% } %>',
'</div>',
// multi-select checkbox
'<div class="dataset-selector">',
'<div class="selector">',
'<span class="fa fa-2x fa-square-o"></span>',
'</div>',
// space for title bar buttons
'<div class="dataset-primary-actions"></div>',
'<div class="primary-actions"></div>',
// adding a tabindex here allows focusing the title bar and the use of keydown to expand the dataset display
'<div class="dataset-title-bar clear" tabindex="0">',
'<span class="dataset-state-icon state-icon"></span>',
'<div class="dataset-title">',
'<div class="title-bar clear" tabindex="0">',
'<span class="state-icon"></span>',
'<div class="title">',
//TODO: remove whitespace and use margin-right
'<span class="hda-hid"><%- hda.hid %></span> ',
'<span class="dataset-name"><%- hda.name %></span>',
'<span class="hid"><%- hda.hid %></span> ',
'<span class="name"><%- hda.name %></span>',
'</div>',
'</div>',
'<div class="dataset-body"></div>',
'<div class="details"></div>',
'</div>'
].join( '' ));
var bodyTemplate = _.template([
'<div class="dataset-body">',
'<div class="details">',
'<% if( hda.body ){ %>',
'<div class="dataset-summary">',
'<div class="summary">',
'<%= hda.body %>',
'</div>',
'<div class="dataset-actions clear">',
'<div class="actions clear">',
'<div class="left"></div>',
'<div class="right"></div>',
'</div>',
'<% } else { %>',
'<div class="dataset-summary">',
'<div class="summary">',
'<% if( hda.misc_blurb ){ %>',
'<div class="dataset-blurb">',
'<div class="blurb">',
'<span class="value"><%- hda.misc_blurb %></span>',
'</div>',
'<% } %>',
'<% if( hda.data_type ){ %>',
'<div class="dataset-datatype">',
'<div class="datatype">',
'<label class="prompt">', _l( 'format' ), '</label>',
'<span class="value"><%- hda.data_type %></span>',
'</div>',
'<% } %>',
'<% if( hda.metadata_dbkey ){ %>',
'<div class="dataset-dbkey">',
'<div class="dbkey">',
'<label class="prompt">', _l( 'database' ), '</label>',
'<span class="value">',
'<%- hda.metadata_dbkey %>',
@@ -517,14 +517,14 @@ var bodyTemplate = _.template([
'<% } %>',
'<% if( hda.misc_info ){ %>',
'<div class="dataset-info">',
'<div class="info">',
'<span class="value"><%- hda.misc_info %></span>',
'</div>',
'<% } %>',
'</div>',
// end dataset-summary
'<div class="dataset-actions clear">',
'<div class="actions clear">',
'<div class="left"></div>',
'<div class="right"></div>',
'</div>',
@@ -533,7 +533,7 @@ var bodyTemplate = _.template([
'<div class="tags-display"></div>',
'<div class="annotation-display"></div>',
'<div class="dataset-display-applications">',
'<div class="display-applications">',
//TODO: the following two should be compacted
'<% _.each( hda.display_apps, function( app ){ %>',
'<div class="display-application">',
+35 -31
View File
@@ -53,13 +53,13 @@ var HDAEditView = _super.extend(
// ......................................................................... edit attr, delete
/** Render icon-button group for the common, most easily accessed actions.
* Overrides _render_titleButtons to include edit and delete buttons.
* @see HDABaseView#_render_titleButtons
* Overrides _render_primaryActions to include edit and delete buttons.
* @see HDABaseView#_render_primaryActions
* @returns {jQuery} rendered DOM
*/
_render_titleButtons : function(){
_render_primaryActions : function(){
// render the display, edit attr and delete icon-buttons
return _super.prototype._render_titleButtons.call( this ).concat([
return _super.prototype._render_primaryActions.call( this ).concat([
this._render_editButton(),
this._render_deleteButton()
]);
@@ -85,7 +85,7 @@ var HDAEditView = _super.extend(
title : _l( 'Edit attributes' ),
href : this.urls.edit,
target : this.linkTarget,
classes : 'dataset-edit'
classes : 'edit-btn'
};
// disable if purged or deleted and explain why in the tooltip
@@ -124,10 +124,10 @@ var HDAEditView = _super.extend(
var self = this,
deleteBtnData = {
title : _l( 'Delete' ),
classes : 'dataset-delete',
classes : 'delete-btn',
onclick : function() {
// ...bler... tooltips being left behind in DOM (hover out never called on deletion)
self.$el.find( '.icon-btn.dataset-delete' ).trigger( 'mouseout' );
self.$el.find( '.icon-btn.delete-btn' ).trigger( 'mouseout' );
self.model[ 'delete' ]();
}
};
@@ -152,7 +152,7 @@ var HDAEditView = _super.extend(
return faIconButton({
title : _l( 'View or report this error' ),
href : this.urls.report_error,
classes : 'dataset-report-error-btn',
classes : 'report-error-btn',
target : this.linkTarget,
faIcon : 'fa-bug'
});
@@ -165,7 +165,7 @@ var HDAEditView = _super.extend(
return faIconButton({
title : _l( 'Run this job again' ),
href : this.urls.rerun,
classes : 'dataset-rerun-btn',
classes : 'rerun-btn',
target : this.linkTarget,
faIcon : 'fa-refresh'
});
@@ -205,7 +205,7 @@ var HDAEditView = _super.extend(
var $icon = faIconButton({
title : _l( 'Visualize' ),
classes : 'dataset-visualize-btn',
classes : 'visualize-btn',
faIcon : 'fa-bar-chart-o'
});
@@ -254,7 +254,7 @@ var HDAEditView = _super.extend(
}
var $icon = faIconButton({
title : _l( 'Visualize' ),
classes : 'dataset-visualize-btn',
classes : 'visualize-btn',
faIcon : 'fa-bar-chart-o'
});
@@ -298,18 +298,18 @@ var HDAEditView = _super.extend(
return [ '<a href="javascript:void(0)" class="', c, '">', t, '</a>' ].join( '' );
};
$newRender.find( '.dataset-deleted-msg' ).append([
br, link( _l( 'Undelete it' ), 'dataset-undelete' ), p
$newRender.find( '.deleted-msg' ).append([
br, link( _l( 'Undelete it' ), 'undelete-link' ), p
].join( '' ));
if( this.purgeAllowed ){
$newRender.find( '.dataset-deleted-msg' ).append([
br, link( _l( 'Permanently remove it from disk' ), 'dataset-purge' ), p
$newRender.find( '.deleted-msg' ).append([
br, link( _l( 'Permanently remove it from disk' ), 'purge-link' ), p
].join( '' ));
}
$newRender.find( '.dataset-hidden-msg' ).append([
br, link( _l( 'Unhide it' ), 'dataset-unhide' ), p
$newRender.find( '.hidden-msg' ).append([
br, link( _l( 'Unhide it' ), 'unhide-link' ), p
].join( '' ));
return $newRender;
@@ -336,7 +336,7 @@ var HDAEditView = _super.extend(
*/
_render_body_error : function(){
var $body = _super.prototype._render_body_error.call( this );
$body.find( '.dataset-actions .left' ).prepend( this._render_errButton() );
$body.find( '.actions .left' ).prepend( this._render_errButton() );
return $body;
},
@@ -351,11 +351,11 @@ var HDAEditView = _super.extend(
if( this.model.isDeletedOrPurged() ){
return $body;
}
this.makeDbkeyEditLink( $body );
this._makeDbkeyEditLink( $body );
// more actions/buttons
if( this.hasUser ){
$body.find( '.dataset-actions .left' ).append( this._render_visualizationsButton() );
$body.find( '.actions .left' ).append( this._render_visualizationsButton() );
//TODO: might be better to move these into the render() and call setElement here
this._renderTags( $body );
this._renderAnnotation( $body );
@@ -363,6 +363,7 @@ var HDAEditView = _super.extend(
return $body;
},
/** */
_renderTags : function( $where ){
var view = this;
this.tagsEditor = new TAGS.TagsEditor({
@@ -374,12 +375,14 @@ var HDAEditView = _super.extend(
onhide : function(){ view.tagsEditorShown = false; },
$activator : faIconButton({
title : _l( 'Edit dataset tags' ),
classes : 'dataset-tag-btn',
classes : 'tag-btn',
faIcon : 'fa-tags'
}).appendTo( $where.find( '.dataset-actions .right' ) )
}).appendTo( $where.find( '.actions .right' ) )
});
if( this.tagsEditorShown ){ this.tagsEditor.toggle( true ); }
},
/** */
_renderAnnotation : function( $where ){
var view = this;
this.annotationEditor = new ANNOTATIONS.AnnotationEditor({
@@ -391,34 +394,35 @@ var HDAEditView = _super.extend(
onhide : function(){ view.annotationEditorShown = false; },
$activator : faIconButton({
title : _l( 'Edit dataset annotation' ),
classes : 'dataset-annotate-btn',
classes : 'annotate-btn',
faIcon : 'fa-comment'
}).appendTo( $where.find( '.dataset-actions .right' ) )
}).appendTo( $where.find( '.actions .right' ) )
});
if( this.annotationEditorShown ){ this.annotationEditor.toggle( true ); }
},
makeDbkeyEditLink : function( $body ){
/** */
_makeDbkeyEditLink : function( $body ){
// make the dbkey a link to editing
if( this.model.get( 'metadata_dbkey' ) === '?'
&& !this.model.isDeletedOrPurged() ){
var editableDbkey = $( '<a class="value">?</a>' )
.attr( 'href', this.urls.edit )
.attr( 'target', this.linkTarget );
$body.find( '.dataset-dbkey .value' ).replaceWith( editableDbkey );
$body.find( '.dbkey .value' ).replaceWith( editableDbkey );
}
},
// ......................................................................... events
/** event map */
events : _.extend( _.clone( _super.prototype.events ), {
'click .dataset-undelete' : function( ev ){ this.model.undelete(); return false; },
'click .dataset-unhide' : function( ev ){ this.model.unhide(); return false; },
'click .dataset-purge' : 'confirmPurge'
'click .undelete-link' : function( ev ){ this.model.undelete(); return false; },
'click .unhide-link' : function( ev ){ this.model.unhide(); return false; },
'click .purge-link' : '_confirmPurge'
}),
/** listener for item purge */
confirmPurge : function _confirmPurge( ev ){
_confirmPurge : function _confirmPurge( ev ){
//TODO: confirm dialog
this.model.purge();
return false;
@@ -444,7 +448,7 @@ var HDAEditView = _super.extend(
//TODO: should be imported from trackster.js
//TODO: This function is redundant and also exists in data.js
// create action
function create_trackster_action_fn (vis_url, dataset_params, dbkey) {
function create_trackster_action_fn(vis_url, dataset_params, dbkey) {
return function() {
var listTracksParams = {};
if (dbkey){
@@ -34,7 +34,7 @@ TODO:
var _super = HISTORY_PANEL.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).
* panel (current right hand panel) of the analysis page.
* @name HistoryPanel
*
* @augments Backbone.View
@@ -43,15 +43,12 @@ var _super = HISTORY_PANEL.HistoryPanel;
* @constructs
*/
var CurrentHistoryPanel = _super.extend(
/** @lends HistoryPanel.prototype */{
/** @lends CurrentHistoryPanel.prototype */{
/** logger used to record this.log messages, commonly set to console */
// comment this out to suppress log output
//logger : console,
/** class to use for constructing the HDA views */
HDAViewClass : HDA_EDIT.HDAEditView,
emptyMsg : _l( "This history is empty. Click 'Get Data' on the left tool menu to start" ),
noneFoundMsg : _l( "No matching datasets found" ),
@@ -87,7 +84,7 @@ var CurrentHistoryPanel = _super.extend(
/** loads a history & hdas w/ details and makes them the current history */
switchToHistory : function( historyId, attributes ){
//console.info( 'switchToHistory:', historyId, attributes );
//this.info( 'switchToHistory:', historyId, attributes );
var panel = this,
historyFn = function(){
// make this current and get history data with one call
@@ -139,7 +136,7 @@ var CurrentHistoryPanel = _super.extend(
// update the quota meter when current history changes size
if( Galaxy && Galaxy.quotaMeter ){
this.listenTo( this.model, 'change:nice_size', function(){
//console.info( '!! model size changed:', this.model.get( 'nice_size' ) )
//this.info( '!! model size changed:', this.model.get( 'nice_size' ) )
//TODO: global
Galaxy.quotaMeter.update();
});
@@ -243,7 +240,7 @@ var CurrentHistoryPanel = _super.extend(
$toolMenu.find( 'span:contains("Get Data")' )
.click();
//.fadeTo( 200, 0.1, function(){
// console.debug( this )
// this.debug( this )
// $( this ).fadeTo( 200, 1.0 );
//});
});
@@ -302,36 +299,43 @@ var CurrentHistoryPanel = _super.extend(
_setUpHdaListeners : function( hdaView ){
_super.prototype._setUpHdaListeners.call( this, hdaView );
//var historyView = this;
//hdaView.on( 'expanded', function( event, collectionView ){
// //console.info( 'collection-expanded', event, collectionView );
// historyView._addCollectionPanel( collectionView.model );
//});
var historyView = this;
if( hdaView instanceof historyView.HDCAViewClass ){
hdaView.off( 'expanded' );
hdaView.on( 'expanded', function( collectionView ){
this.info( 'expanded', collectionView );
historyView._addCollectionPanel( collectionView );
});
hdaView.off( 'collapsed' );
}
},
_addCollectionPanel : function( model ){
var historyView = this;
_addCollectionPanel : function( collectionView ){
var historyView = this,
collectionModel = collectionView.model;
var panel = new ( this._getCollectionPanelClass( model ) )({
model : model,
HDAViewClass : this.HDAViewClass
this.debug( 'history panel (stack), collectionModel:', collectionModel );
var panel = new ( this._getCollectionPanelClass( collectionModel ) )({
model : collectionModel,
HDAViewClass : this.HDAViewClass,
parentName : this.model.get( 'name' )
});
//console.debug( panel.$el );
//console.debug( JSON.stringify( panel.model.toJSON(), null, ' ' ) );
historyView.panelStack.push( panel );
historyView.$el.hide().parent().append( panel.$el );
panel.on( 'collection-close', function(){
historyView.$el.fadeIn( historyView.fxSpeed );
historyView.$( '.history-controls' ).add( '.datasets-list' ).hide();
historyView.$el.append( panel.$el );
panel.on( 'close', function(){
historyView.render();
collectionView.collapse();
historyView.panelStack.pop();
});
//TODO: to hdca-model, hasDetails
if( !panel.model.get( 'elements' ) ){
if( !panel.model.hasDetails() ){
var xhr = panel.model.fetch();
xhr.done( function(){
//console.debug( 'collection data fetched' );
//console.debug( JSON.stringify( panel.model.toJSON(), null, ' ' ) );
//this.debug( 'collection data fetched' );
//this.debug( JSON.stringify( panel.model.toJSON(), null, ' ' ) );
//TODO: (re-)render collection contents
panel.render();
});
@@ -341,7 +345,25 @@ var CurrentHistoryPanel = _super.extend(
},
_getCollectionPanelClass : function( model ){
return DC_PANEL.CollectionPanel;
switch( model.get( 'collection_type' ) ){
case 'list':
return DC_PANEL.ListCollectionPanel;
case 'paired':
return DC_PANEL.PairCollectionPanel;
case 'list:paired':
return DC_PANEL.ListOfPairsCollectionPanel;
}
throw new TypeError( 'Uknown collection_type: ' + model.get( 'collection_type' ) );
},
/** In this override, check for any overlaid panels first
* @param {HistoryDatasetAssociation} hda
*/
addContentView : function( hda ){
if( this.panelStack.length ){
return this;
}
return _super.prototype.addContentView.call( this, hda );
},
// ........................................................................ external objects/MVC
@@ -8,6 +8,7 @@ define([
* Functionality here should be history-centric.
*/
var HistoryContentViewMixin = {
//PRECONDITION: expects to be mixed into an BASE_MVC.ExpandableView
//TODO: most of the fns/attrs here are basal to any sort of list view - consider moving
initialize : function( attributes ){
@@ -42,9 +43,8 @@ var HistoryContentViewMixin = {
_buildNewRender : function(){
// create a new render using a skeleton template, render title buttons, render body, and set up events, etc.
var $newRender = $( this.templates.skeleton( this.model.toJSON() ) );
var titleButtons = this._render_titleButtons();
$newRender.find( '.dataset-primary-actions' ).append( this._render_titleButtons() );
$newRender.children( '.dataset-body' ).replaceWith( this._renderBody() );
$newRender.find( '.primary-actions' ).append( this._render_primaryActions() );
$newRender.children( '.details' ).replaceWith( this._renderBody() );
this._setUpBehaviors( $newRender );
//this._renderSelectable( $newRender );
return $newRender;
@@ -103,7 +103,7 @@ var HistoryContentViewMixin = {
/** Render icon-button group for the common, most easily accessed actions.
* @returns {jQuery} rendered DOM or null
*/
_render_titleButtons : function(){
_render_primaryActions : function(){
// override
return [];
},
@@ -120,7 +120,6 @@ var HistoryContentViewMixin = {
*/
toggleExpanded : function( expand ){
expand = ( expand === undefined )?( !this.expanded ):( expand );
this.warn( this + '.toggleExpanded, expand:', expand );
if( expand ){
this.expand();
} else {
@@ -138,11 +137,11 @@ var HistoryContentViewMixin = {
var contentView = this;
function _renderBodyAndExpand(){
contentView.$el.children( '.dataset-body' ).replaceWith( contentView._renderBody() );
contentView.$( '.details' ).replaceWith( contentView._renderBody() );
// needs to be set after the above or the slide will not show
contentView.expanded = true;
contentView.$el.children( '.dataset-body' ).slideDown( contentView.fxSpeed, function(){
contentView.trigger( 'expanded', contentView.model );
contentView.$( '.details' ).slideDown( contentView.fxSpeed, function(){
contentView.trigger( 'expanded', contentView );
});
}
// fetch first if no details in the model
@@ -162,8 +161,8 @@ var HistoryContentViewMixin = {
collapse : function(){
var contentView = this;
contentView.expanded = false;
this.$el.children( '.dataset-body' ).slideUp( contentView.fxSpeed, function(){
contentView.trigger( 'collapsed', contentView.model.id );
this.$( '.details' ).slideUp( contentView.fxSpeed, function(){
contentView.trigger( 'collapsed', contentView );
});
},
@@ -181,8 +180,8 @@ var HistoryContentViewMixin = {
this.selectable = true;
this.trigger( 'selectable', true, this );
this.$( '.dataset-primary-actions' ).hide();
this.$( '.dataset-selector' ).show();
this.$( '.primary-actions' ).hide();
this.$( '.selector' ).show();
},
/** remove the selection checkbox */
@@ -191,13 +190,13 @@ var HistoryContentViewMixin = {
this.selectable = false;
this.trigger( 'selectable', false, this );
this.$( '.dataset-selector' ).hide();
this.$( '.dataset-primary-actions' ).show();
this.$( '.selector' ).hide();
this.$( '.primary-actions' ).show();
},
/** */
toggleSelector : function(){
if( !this.$el.find( '.dataset-selector' ).is( ':visible' ) ){
if( !this.$el.find( '.selector' ).is( ':visible' ) ){
this.showSelector();
} else {
this.hideSelector();
@@ -207,7 +206,7 @@ var HistoryContentViewMixin = {
/** event handler for selection (also programmatic selection) */
select : function( event ){
// switch icon, set selected, and trigger event
this.$el.find( '.dataset-selector span' )
this.$el.find( '.selector span' )
.removeClass( 'fa-square-o' ).addClass( 'fa-check-square-o' );
if( !this.selected ){
this.trigger( 'selected', this, event );
@@ -219,7 +218,7 @@ var HistoryContentViewMixin = {
/** event handler for clearing selection (also programmatic deselection) */
deselect : function( event ){
// switch icon, set selected, and trigger event
this.$el.find( '.dataset-selector span' )
this.$el.find( '.selector span' )
.removeClass( 'fa-check-square-o' ).addClass( 'fa-square-o' );
if( this.selected ){
this.trigger( 'de-selected', this, event );
@@ -243,14 +242,14 @@ var HistoryContentViewMixin = {
draggableOn : function(){
this.draggable = true;
//TODO: I have no idea why this doesn't work with the events hash or jq.on()...
//this.$el.find( '.dataset-title-bar' )
//this.$el.find( '.title-bar' )
// .attr( 'draggable', true )
// .bind( 'dragstart', this.dragStartHandler, false )
// .bind( 'dragend', this.dragEndHandler, false );
this.dragStartHandler = _.bind( this._dragStartHandler, this );
this.dragEndHandler = _.bind( this._dragEndHandler, this );
var titleBar = this.$el.find( '.dataset-title-bar' ).attr( 'draggable', true ).get(0);
var titleBar = this.$el.find( '.title-bar' ).attr( 'draggable', true ).get(0);
titleBar.addEventListener( 'dragstart', this.dragStartHandler, false );
titleBar.addEventListener( 'dragend', this.dragEndHandler, false );
},
@@ -258,7 +257,7 @@ var HistoryContentViewMixin = {
/** */
draggableOff : function(){
this.draggable = false;
var titleBar = this.$el.find( '.dataset-title-bar' ).attr( 'draggable', false ).get(0);
var titleBar = this.$el.find( '.title-bar' ).attr( 'draggable', false ).get(0);
titleBar.removeEventListener( 'dragstart', this.dragStartHandler, false );
titleBar.removeEventListener( 'dragend', this.dragEndHandler, false );
},
@@ -292,14 +291,14 @@ var HistoryContentViewMixin = {
// ......................................................................... events
events : {
// expand the body when the title is clicked or when in focus and space or enter is pressed
'click .dataset-title-bar' : '_clickTitleBar',
'keydown .dataset-title-bar' : '_keyDownTitleBar',
'click .title-bar' : '_clickTitleBar',
'keydown .title-bar' : '_keyDownTitleBar',
// dragging - don't work, originalEvent === null
//'dragstart .dataset-title-bar' : 'dragStartHandler',
//'dragend .dataset-title-bar' : 'dragEndHandler'
'click .dataset-selector' : 'toggleSelect'
'click .selector' : 'toggleSelect'
},
_clickTitleBar : function( event ){
@@ -337,6 +336,7 @@ var HistoryContentBaseView = Backbone.View.extend( BASE_MVC.LoggableMixin ).exte
//TODO: not sure base view class is warranted or even wise
//==============================================================================
return {
HistoryContentViewMixin : HistoryContentViewMixin,
@@ -105,11 +105,11 @@ var HistoryContentMixin = {
return ( this.isDeletedOrPurged() || ready );
},
/** Does this model already contain detailed data (as opposed to just summary level data)? */
hasDetails : function(){
// override
return true;
},
///** Does this model already contain detailed data (as opposed to just summary level data)? */
//hasDetails : function(){
// // override
// return true;
//},
/** Convenience function to match hda.has_data. */
hasData : function(){
@@ -23,9 +23,9 @@ var HistoryPrefs = BASE_MVC.SessionStorageModel.extend({
this.save( key, _.extend( this.get( key ), _.object([ model.id ], [ model.get( 'id' ) ]) ) );
},
/** remove an hda id from the hash of expanded hdas */
removeExpandedHda : function( id ){
removeExpandedHda : function( model ){
var key = 'expandedHdas';
this.save( key, _.omit( this.get( key ), id ) );
this.save( key, _.omit( this.get( key ), model.id ) );
},
toString : function(){
return 'HistoryPrefs(' + this.id + ')';
@@ -196,7 +196,7 @@ var ReadOnlyHistoryPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend
* @param {Object} msg optional object containing error details
*/
errorHandler : function( model, xhr, options, msg, details ){
console.error( model, xhr, options, msg, details );
this.error( model, xhr, options, msg, details );
//TODO: getting JSON parse errors from jq migrate
// interrupted ajax
@@ -262,7 +262,7 @@ var ReadOnlyHistoryPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend
/** loads a history & hdas w/ details (but does not make them the current history) */
loadHistoryWithHDADetails : function( historyId, attributes, historyFn, hdaFn ){
//console.info( 'loadHistoryWithHDADetails:', historyId, attributes, historyFn, hdaFn );
//this.info( 'loadHistoryWithHDADetails:', historyId, attributes, historyFn, hdaFn );
var hdaDetailIds = function( historyData ){
// will be called to get hda ids that need details from the api
//TODO: non-visible HDAs are getting details loaded... either stop loading them at all or filter ids thru isVisible
@@ -277,7 +277,7 @@ var ReadOnlyHistoryPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend
attributes = attributes || {};
panel.trigger( 'loading-history', panel );
//console.info( 'loadHistory:', historyId, attributes, historyFn, hdaFn, hdaDetailIds );
//this.info( 'loadHistory:', historyId, attributes, historyFn, hdaFn, hdaDetailIds );
var xhr = HISTORY_MODEL.History.getHistoryData( historyId, {
historyFn : historyFn,
hdaFn : hdaFn,
@@ -652,11 +652,11 @@ var ReadOnlyHistoryPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend
panel.errorHandler( model, xhr, options, msg );
});
// maintain a list of hdas whose bodies are expanded
hdaView.on( 'expanded', function( model ){
panel.storage.addExpandedHda( model );
hdaView.on( 'expanded', function( view ){
panel.storage.addExpandedHda( view.model );
});
hdaView.on( 'collapsed', function( id ){
panel.storage.removeExpandedHda( id );
hdaView.on( 'collapsed', function( view ){
panel.storage.removeExpandedHda( view.model );
});
return this;
},
@@ -743,8 +743,6 @@ var ReadOnlyHistoryPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend
//},
hdaViewRange : function( viewA, viewB ){
//console.debug( 'a: ', viewA, viewA.model );
//console.debug( 'b: ', viewB, viewB.model );
if( viewA === viewB ){ return [ viewA ]; }
//TODO: would probably be better if we cache'd the views as an ordered list (as well as a map)
var panel = this,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
define(["libs/underscore","mvc/tools"],function(c,b){var a=function(g,f){$("input[name='"+g+"'][type='checkbox']").attr("checked",!!f)};$("div.checkUncheckAllPlaceholder").each(function(){var f=$(this).attr("checkbox_name");select_link=$("<a class='action-button'></a>").text("Select All").click(function(){a(f,true)});unselect_link=$("<a class='action-button'></a>").text("Unselect All").click(function(){a(f,false)});$(this).append(select_link).append(" ").append(unselect_link)});var e={select_single:{icon_class:"fa-file-o",select_by:"Run tool on single input",allow_remap:true},select_multiple:{icon_class:"fa-files-o",select_by:"Run tool in parallel across multiple datasets",allow_remap:false,min_option_count:2},select_collection:{icon_class:"fa-folder-o",select_by:"Run tool in parallel across dataset collection",allow_remap:false},multiselect_single:{icon_class:"fa-list-alt",select_by:"Run tool over multiple datasets",allow_remap:true},multiselect_collection:{icon_class:"fa-folder-o",select_by:"Run tool over dataset collection",allow_remap:false,},select_single_collection:{icon_class:"fa-file-o",select_by:"Run tool on single collection",allow_remap:true},select_map_over_collections:{icon_class:"fa-folder-o",select_by:"Map tool over compontents of nested collection",allow_remap:false,}};var d=Backbone.View.extend({initialize:function(l){var g=l.default_option;var m=null;var k=l.switch_options;this.switchOptions=k;this.prefix=l.prefix;var j=this.$el;var f=this;var h=0;var i=0;c.each(this.switchOptions,function(r,t){var n=c.size(r.options);var q=e[t];var p=h++;var s=false;if(g==t){m=p}else{if(n<(q.min_option_count||1)){s=true}}if(!s){i++;var o=$('<i class="fa '+q.icon_class+' runOptionIcon" style="padding-left: 5px; padding-right: 2px;"></i>').click(function(){f.enableSelectBy(p,t)}).attr("title",q.select_by).data("index",p);f.formRow().find("label").append(o)}});if(i<2){f.formRow().find("i.runOptionIcon").hide()}if(m!=null){f.enableSelectBy(m,g)}},formRow:function(){return this.$el.closest(".form-row")},render:function(){},enableSelectBy:function(k,j){var h=e[j];if(h.allow_remap){$("div#remap-row").css("display","inherit")}else{$("div#remap-row").css("display","none")}this.formRow().find("i").each(function(n,o){var l=$(o);var m=l.data("index");if(m==k){l.css("color","black")}else{l.css("color","Gray")}});var g=this.$("select");var f=this.switchOptions[j];g.attr("name",this.prefix+f.name);g.attr("multiple",f.multiple);var i=this.$(".select2-container").length>0;g.html("");c.each(f.options,function(m){var o=m[0];var n=m[1];var l=m[2];g.append($("<option />",{text:o,val:n,selected:l}))});if(i){g.select2()}}});return{SwitchSelectView:d}});
define(["libs/underscore","mvc/tools"],function(c,b){var a=function(g,f){$("input[name='"+g+"'][type='checkbox']").attr("checked",!!f)};$(".tool-share-link").each(function(){var f=$(this).attr("href");var f=$(this).attr("data-link");$(this).click(function(){window.prompt("Copy to clipboard: Ctrl+C, Enter",f)})});$("div.checkUncheckAllPlaceholder").each(function(){var f=$(this).attr("checkbox_name");select_link=$("<a class='action-button'></a>").text("Select All").click(function(){a(f,true)});unselect_link=$("<a class='action-button'></a>").text("Unselect All").click(function(){a(f,false)});$(this).append(select_link).append(" ").append(unselect_link)});var e={select_single:{icon_class:"fa-file-o",select_by:"Run tool on single input",allow_remap:true},select_multiple:{icon_class:"fa-files-o",select_by:"Run tool in parallel across multiple datasets",allow_remap:false,min_option_count:2},select_collection:{icon_class:"fa-folder-o",select_by:"Run tool in parallel across dataset collection",allow_remap:false},multiselect_single:{icon_class:"fa-list-alt",select_by:"Run tool over multiple datasets",allow_remap:true},multiselect_collection:{icon_class:"fa-folder-o",select_by:"Run tool over dataset collection",allow_remap:false,},select_single_collection:{icon_class:"fa-file-o",select_by:"Run tool on single collection",allow_remap:true},select_map_over_collections:{icon_class:"fa-folder-o",select_by:"Map tool over compontents of nested collection",allow_remap:false,}};var d=Backbone.View.extend({initialize:function(l){var g=l.default_option;var m=null;var k=l.switch_options;this.switchOptions=k;this.prefix=l.prefix;var j=this.$el;var f=this;var h=0;var i=0;c.each(this.switchOptions,function(r,t){var n=c.size(r.options);var q=e[t];var p=h++;var s=false;if(g==t){m=p}else{if(n<(q.min_option_count||1)){s=true}}if(!s){i++;var o=$('<i class="fa '+q.icon_class+' runOptionIcon" style="padding-left: 5px; padding-right: 2px;"></i>').click(function(){f.enableSelectBy(p,t)}).attr("title",q.select_by).data("index",p);f.formRow().find("label").append(o)}});if(i<2){f.formRow().find("i.runOptionIcon").hide()}if(m!=null){f.enableSelectBy(m,g)}},formRow:function(){return this.$el.closest(".form-row")},render:function(){},enableSelectBy:function(k,j){var h=e[j];if(h.allow_remap){$("div#remap-row").css("display","inherit")}else{$("div#remap-row").css("display","none")}this.formRow().find("i").each(function(n,o){var l=$(o);var m=l.data("index");if(m==k){l.css("color","black")}else{l.css("color","Gray")}});var g=this.$("select");var f=this.switchOptions[j];g.attr("name",this.prefix+f.name);g.attr("multiple",f.multiple);var i=this.$(".select2-container").length>0;g.html("");c.each(f.options,function(m){var o=m[0];var n=m[1];var l=m[2];g.append($("<option />",{text:o,val:n,selected:l}))});if(i){g.select2()}}});return{SwitchSelectView:d}});
+1 -1
View File
@@ -1 +1 @@
define(["utils/add-logging"],function(d){var e={logger:null,_logNamespace:"?",log:function(){if(this.logger){var f=this.logger.log;if(typeof this.logger.log==="object"){f=Function.prototype.bind.call(this.logger.log,this.logger)}return f.apply(this.logger,arguments)}return undefined}};d(e);var b=Backbone.Model.extend({initialize:function(g){this._checkEnabledSessionStorage();if(!g.id){throw new Error("SessionStorageModel requires an id in the initial attributes")}this.id=g.id;var f=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,f,g),{silent:true});this.on("change",function(){this.save()})},_checkEnabledSessionStorage:function(){try{return sessionStorage.length}catch(f){alert("Please enable cookies in your browser for this Galaxy site");return false}},sync:function(i,g,f){if(!f.silent){g.trigger("request",g,{},f)}var h;switch(i){case"create":h=this._create(g);break;case"read":h=this._read(g);break;case"update":h=this._update(g);break;case"delete":h=this._delete(g);break}if(h!==undefined||h!==null){if(f.success){f.success()}}else{if(f.error){f.error()}}return h},_create:function(f){var g=f.toJSON(),h=sessionStorage.setItem(f.id,JSON.stringify(g));return(h===null)?(h):(g)},_read:function(f){return JSON.parse(sessionStorage.getItem(f.id))},_update:function(f){return f._create(f)},_delete:function(f){return sessionStorage.removeItem(f.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){b.prototype=_.omit(b.prototype,"url","urlRoot")}());var c={hiddenUntilActivated:function(f,h){h=h||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,h||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");this.hidden=this.isHidden();if(f){var g=this;f.on("click",function(i){g.toggle(g.HUAVOptions.showSpeed)})}},isHidden:function(){return(this.HUAVOptions.$elementShown.is(":hidden"))},toggle:function(){if(this.hidden){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this);this.trigger("hiddenUntilActivated:shown",this)}this.hidden=false}else{if(_.isFunction(this.HUAVOptions.onhide)){this.HUAVOptions.onhide.call(this);this.trigger("hiddenUntilActivated:hidden",this)}this.hidden=true}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};function a(i,h){var f=Array.prototype.slice.call(arguments,0),g=f.pop();f.unshift(g);return _.defaults.apply(_,f)}return{LoggableMixin:e,SessionStorageModel:b,HiddenUntilActivatedViewMixin:c,mixin:a}});
define(["utils/add-logging"],function(d){var f={logger:null,_logNamespace:"?",log:function(){if(this.logger){var g=this.logger.log;if(typeof this.logger.log==="object"){g=Function.prototype.bind.call(this.logger.log,this.logger)}return g.apply(this.logger,arguments)}return undefined}};d(f);var b=Backbone.Model.extend({initialize:function(h){this._checkEnabledSessionStorage();if(!h.id){throw new Error("SessionStorageModel requires an id in the initial attributes")}this.id=h.id;var g=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,g,h),{silent:true});this.on("change",function(){this.save()})},_checkEnabledSessionStorage:function(){try{return sessionStorage.length}catch(g){alert("Please enable cookies in your browser for this Galaxy site");return false}},sync:function(j,h,g){if(!g.silent){h.trigger("request",h,{},g)}var i;switch(j){case"create":i=this._create(h);break;case"read":i=this._read(h);break;case"update":i=this._update(h);break;case"delete":i=this._delete(h);break}if(i!==undefined||i!==null){if(g.success){g.success()}}else{if(g.error){g.error()}}return i},_create:function(g){var h=g.toJSON(),i=sessionStorage.setItem(g.id,JSON.stringify(h));return(i===null)?(i):(h)},_read:function(g){return JSON.parse(sessionStorage.getItem(g.id))},_update:function(g){return g._create(g)},_delete:function(g){return sessionStorage.removeItem(g.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){b.prototype=_.omit(b.prototype,"url","urlRoot")}());var c={hiddenUntilActivated:function(g,i){i=i||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,i||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");this.hidden=this.isHidden();if(g){var h=this;g.on("click",function(j){h.toggle(h.HUAVOptions.showSpeed)})}},isHidden:function(){return(this.HUAVOptions.$elementShown.is(":hidden"))},toggle:function(){if(this.hidden){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this);this.trigger("hiddenUntilActivated:shown",this)}this.hidden=false}else{if(_.isFunction(this.HUAVOptions.onhide)){this.HUAVOptions.onhide.call(this);this.trigger("hiddenUntilActivated:hidden",this)}this.hidden=true}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};function a(j,i){var g=Array.prototype.slice.call(arguments,0),h=g.pop();g.unshift(h);return _.defaults.apply(_,g)}var e=Backbone.View.extend(f).extend({initialize:function(g){this.expanded=g.expanded||false;this.log("\t expanded:",this.expanded)},fxSpeed:"fast",render:function(h){var g=this._buildNewRender();this._queueNewRender(g,h);return this},_buildNewRender:function(){var g=$(this.templates.skeleton(this.model.toJSON()));if(this.expanded){g.children(".details").replaceWith(this._renderDetails())}this._setUpBehaviors(g);return g},_queueNewRender:function(h,i){i=(i===undefined)?(this.fxSpeed):(i);var g=this;$(g).queue("fx",[function(j){this.$el.fadeOut(i,j)},function(j){g._swapNewRender(h);j()},function(j){this.$el.fadeIn(i,j)},function(j){this.trigger("rendered",g);j()}])},_swapNewRender:function(g){return this.$el.empty().attr("class",this.className).append(g.children())},_setUpBehaviors:function(g){g=g||this.$el;make_popup_menus(g);g.find("[title]").tooltip({placement:"bottom"})},_renderDetails:function(){return null},toggleExpanded:function(g){g=(g===undefined)?(!this.expanded):(g);if(g){this.expand()}else{this.collapse()}return this},expand:function(){var g=this;function h(){g.$(".details").replaceWith(g._renderDetails());g.expanded=true;g.$(".details").slideDown(g.fxSpeed,function(){g.trigger("expanded",g)})}if(!g.model.hasDetails()){g.model.fetch().always(function(i){h()})}else{h()}},collapse:function(){var g=this;g.expanded=false;this.$(".details").slideUp(g.fxSpeed,function(){g.trigger("collapsed",g)})}});return{LoggableMixin:f,SessionStorageModel:b,HiddenUntilActivatedViewMixin:c,mixin:a,ExpandableView:e}});
@@ -1 +1 @@
define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(g,i,c){var j=Backbone.Model.extend(i.LoggableMixin).extend({defaults:{id:null,model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},initialize:function(l,k){this.info(this+".initialize:",l,k);k=k||{};this.object=this._createObjectModel();this.on("change:object",function(){this.object=this._createObjectModel()})},_createObjectModel:function(){if(_.isUndefined(this.object)){this.object=null}if(!this.get("object")){return this.object}var k=this.get("object");this.unset("object",{silent:true});this.debug("DCE, element_type:",this.get("element_type"));switch(this.get("element_type")){case"dataset_collection":this.object=new f(k);break;case"hda":this.object=new g.HistoryDatasetAssociation(k);break;default:throw new TypeError("Unknown element_type: "+this.get("element_type"))}return this.object},toString:function(){var k=(this.object)?(""+this.object):(this.get("element_identifier"));return(["DatasetCollectionElement(",k,")"].join(""))}});var d=Backbone.Collection.extend(i.LoggableMixin).extend({model:j,initialize:function(l,k){k=k||{};this.info(this+".initialize:",l,k)},toString:function(){return(["DatasetCollectionElementCollection(",this.length,")"].join(""))}});var f=Backbone.Model.extend(i.LoggableMixin).extend({defaults:{collection_type:"list"},collectionClass:d,initialize:function(l,k){this.info("DatasetCollection.initialize:",l,k);this.elements=this._createElementsModel();this.on("change:elements",function(){this.log("change:elements");this.elements=this._createElementsModel()})},_createElementsModel:function(){this.log("_createElementsModel",this.get("elements"),this.elements);var k=this.get("elements")||[];this.info("elements:",k);this.unset("elements",{silent:true});this.elements=new this.collectionClass(k);return this.elements},hasDetails:function(){return this.elements.length!==0},toString:function(){var k=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+(k.join(","))+")"}});var h=Backbone.Collection.extend(i.LoggableMixin).extend({model:f,initialize:function(l,k){k=k||{};this.info("DatasetCollectionCollection.initialize:",l,k)},toString:function(){return(["DatasetCollectionCollection(",this.get("name"),")"].join(""))}});var e=f.extend({toString:function(){return(["ListDatasetCollection(",this.get("name"),")"].join(""))}});var b=f.extend({toString:function(){return(["PairDatasetCollection(",this.get("name"),")"].join(""))}});var a=f.extend({toString:function(){return(["ListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{DatasetCollectionElement:j,DatasetCollectionElementCollection:d,DatasetCollection:f,DatasetCollectionCollection:h,ListDatasetCollection:e,PairDatasetCollection:b,ListPairedDatasetCollection:a}});
define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(h,l,d){var m=Backbone.Model.extend(l.LoggableMixin).extend({defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},initialize:function(o,n){this.info(this+".initialize:",o,n);n=n||{};this.object=this._createObjectModel();this.on("change:object",function(){this.object=this._createObjectModel()})},_createObjectModel:function(){if(_.isUndefined(this.object)){this.object=null}if(!this.get("object")){return this.object}var n=this.get("object"),o=this._getObjectClass();this.unset("object",{silent:true});this.object=new o(n);return this.object},_getObjectClass:function(){this.debug("DCE, element_type:",this.get("element_type"));switch(this.get("element_type")){case"dataset_collection":return g;case"hda":return h.HistoryDatasetAssociation}throw new TypeError("Unknown element_type: "+this.get("element_type"))},toJSON:function(){var n=Backbone.Model.prototype.toJSON.call(this);if(this.object){n.object=this.object.toJSON()}return n},hasDetails:function(){return(this.object!==null&&this.object.hasDetails())},toString:function(){var n=(this.object)?(""+this.object):(this.get("element_identifier"));return(["DatasetCollectionElement(",n,")"].join(""))}});var i=m.extend({_getObjectClass:function(){return h.HistoryDatasetAssociation},toString:function(){var n=(this.object)?(""+this.object):(this.get("element_identifier"));return(["HDADCE(",n,")"].join(""))}});var a=m.extend({_getObjectClass:function(){return g},getVisibleContents:function(){return this.object?this.object.getVisibleContents():[]},toString:function(){var n=(this.object)?(""+this.object):(this.get("element_identifier"));return(["DCDCE(",n,")"].join(""))}});var k=Backbone.Collection.extend(l.LoggableMixin).extend({model:m,initialize:function(o,n){n=n||{};this.info(this+".initialize:",o,n)},toString:function(){return(["DatasetCollectionElementCollection(",this.length,")"].join(""))}});var j=k.extend({model:i,toString:function(){return(["HDADCECollection(",this.length,")"].join(""))}});var f=k.extend({model:a,toString:function(){return(["DCDCECollection(",this.length,")"].join(""))}});var g=Backbone.Model.extend(l.LoggableMixin).extend({defaults:{collection_type:"list"},collectionClass:k,initialize:function(o,n){this.info("DatasetCollection.initialize:",o,n);this.elements=this._createElementsModel();this.on("change:elements",function(){this.log("change:elements");this.elements=this._createElementsModel()})},_createElementsModel:function(){this.log("_createElementsModel",this.get("elements"),this.elements);var n=this.get("elements")||[];this.info("elements:",n);this.unset("elements",{silent:true});this.elements=new this.collectionClass(n);return this.elements},toJSON:function(){var n=Backbone.Model.prototype.toJSON.call(this);if(this.elements){n.elements=this.elements.toJSON()}return n},hasDetails:function(){this.debug("hasDetails:",this.elements.length);return this.elements.length!==0},getVisibleContents:function(n){return this.elements},toString:function(){var n=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+(n.join(","))+")"}});var e=g.extend({collectionClass:j,toString:function(){return(["ListDatasetCollection(",this.get("name"),")"].join(""))}});var c=e.extend({toString:function(){return(["PairDatasetCollection(",this.get("name"),")"].join(""))}});var b=g.extend({collectionClass:f,toString:function(){return(["ListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{ListDatasetCollection:e,PairDatasetCollection:c,ListPairedDatasetCollection:b}});
@@ -1 +1 @@
define(["mvc/collection/dataset-collection-base","mvc/dataset/hda-base","mvc/base-mvc","utils/localization"],function(f,a,b,e){var d=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",className:"history-panel",fxSpeed:"fast",initialize:function(g){g=g||{};if(g.logger){this.logger=g.logger}this.log(this+".initialize:",g);this.hasUser=g.hasUser;this.HDAViewClass=g.HDAViewClass||a.HDABaseView},_setUpListeners:function(){this.on("all",function(g){this.log(this+"",arguments)},this);return this},_setUpModelEventHandlers:function(){return this},render:function(i,j){this.log("render:",i,j);i=(i===undefined)?(this.fxSpeed):(i);var g=this,h;if(!this.model){return this}h=this.renderModel();$(g).queue("fx",[function(k){if(i&&g.$el.is(":visible")){g.$el.fadeOut(i,k)}else{k()}},function(k){g.$el.empty();if(h){g.$el.append(h.children())}k()},function(k){if(i&&!g.$el.is(":visible")){g.$el.fadeIn(i,k)}else{k()}},function(k){if(j){j.call(this)}g.trigger("rendered",this);k()}]);return this},renderModel:function(){var g=$("<div/>").append(d.templates.panel(this.model.toJSON()));this._setUpBehaviours(g);this.renderContents(g);return g},_setUpBehaviours:function(g){g=g||this.$el;g.find("[title]").tooltip({placement:"bottom"});return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(g){return(g||this.$el).find(".datasets-list")},renderContents:function(h){h=h||this.$el;var g=this,j={},i=this.model.elements||[];this.$datasetsList(h).empty();if(i&&i.length){i.each(function(l){var m=l.id,k=g._createContentView(l);j[m]=k;g.attachContentView(k.render(),h)})}this.contentViews=j;return this.contentViews},_createContentView:function(i){var h=null,g=this._getContentClass(i);h=new g({model:i.object,linkTarget:this.linkTarget,hasUser:this.hasUser,logger:this.logger});return h},_getContentClass:function(g){switch(g.get("element_type")){case"hda":return this.HDAViewClass;case"dataset_collection":return f.NestedDCEBaseView}throw new TypeError("Unknown element type:",g.get("element_type"))},attachContentView:function(i,h){h=h||this.$el;var g=this.$datasetsList(h);g.append(i.$el);return this},events:{"click .panel-navigation-back":"close"},close:function(g){this.$el.remove();this.trigger("collection-close")},toString:function(){return"CollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var c=['<div class="history-controls">','<div class="panel-navigation">','<a class="panel-navigation-back" href="javascript:void(0)">',e("Back"),"</a>","</div>",'<div class="history-title">',"<% if( collection.name ){ %>",'<div class="history-name"><%= collection.hid %> : <%= collection.name %></div>',"<% } %>","</div>","</div>",'<div class="datasets-list"></div>'].join("");d.templates={panel:function(g){return _.template(c,g,{variable:"collection"})}};return{CollectionPanel:d}});
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",DCEViewClass:f.DCEBaseView,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;window.collectionPanel=this},_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.object:",j.object);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);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.HDADCEBaseView,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.DCDCEBaseView,toString:function(){return"ListOfPairsCollectionPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CollectionPanel:d,ListCollectionPanel:b,PairCollectionPanel:c,ListOfPairsCollectionPanel:g}});
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
define(["mvc/base-mvc","mvc/collection/dataset-collection-base","mvc/history/history-content-base-view","utils/localization"],function(a,c,g,b){var f=g.HistoryContentViewMixin,d=c.DCBaseView;var e=d.extend(a.mixin(f,{className:"dataset hda history-panel-hda",initialize:function(h){if(h.logger){this.logger=this.model.logger=h.logger}this.log(this+".initialize:",h);d.prototype.initialize.call(this,h);f.initialize.call(this,h)},_template:function(){return e.templates.skeleton(this.model.toJSON())},events:_.extend(_.clone(f.events),{}),_renderBody:function(){var h=$(d.templates.body(this.model.toJSON()));if(this.expanded){h.show()}return h},toString:function(){var h=(this.model)?(this.model+""):("(no model)");return"HDCABaseView("+h+")"}}));e.templates=e.prototype.templates=(function(){var h=_.template(['<div class="dataset hda">','<div class="dataset-warnings">',"<% if ( collection.deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',b("This collection has been deleted."),"</div>","<% } %>","<% if ( !collection.visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',b("This collection has been hidden."),"</div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- collection.hid %></span> ','<span class="dataset-name"><%- collection.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join(""));var i=_.template(['<div class="dataset-body">','<div class="dataset-summary">',b("A dataset collection."),"</div>"].join(""));return{skeleton:function(j){return h({_l:b,collection:j})},body:function(j){return i({_l:b,collection:j})}}}());return{HDCABaseView:e}});
define(["mvc/base-mvc","mvc/collection/dataset-collection-base","mvc/history/history-content-base-view","utils/localization"],function(a,c,g,b){var f=g.HistoryContentViewMixin,d=c.DCBaseView;var e=d.extend(a.mixin(f,{className:"dataset hdca history-panel-hda",initialize:function(h){if(h.logger){this.logger=this.model.logger=h.logger}this.log(this+".initialize:",h);d.prototype.initialize.call(this,h);f.initialize.call(this,h)},_template:function(){return e.templates.skeleton(this.model.toJSON())},events:_.extend(_.clone(f.events),{}),_renderBody:function(){var h=$(d.templates.body(this.model.toJSON()));if(this.expanded){h.show()}return h},expand:function(){this.warn(this+".expand");var h=this;if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch().always(function(i){h.expanded=true;h.trigger("expanded",h)})}else{h.expanded=true;h.trigger("expanded",h)}},toString:function(){var h=(this.model)?(this.model+""):("(no model)");return"HDCABaseView("+h+")"}}));e.templates=e.prototype.templates=(function(){var h=_.template(['<div class="dataset hdca">','<div class="dataset-warnings">',"<% if ( collection.deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',b("This collection has been deleted."),"</div>","<% } %>","<% if ( !collection.visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',b("This collection has been hidden."),"</div>","<% } %>","</div>",'<div class="selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="primary-actions"></div>','<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">','<% if( collection.collection_type === "list" ){ %>',b("a list of datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',b("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',b("a list of paired datasets"),"<% } %>","</div>","</div>",'<div class="details"></div>',"</div>"].join(""));var i=_.template(['<div class="details">','<div class="summary">',b("A dataset collection."),"</div>"].join(""));return{skeleton:function(j){return h({_l:b,collection:j})},body:function(j){return i({_l:b,collection:j})}}}());return{HDCABaseView:e}});
@@ -1 +1 @@
define(["mvc/dataset/states","mvc/collection/hdca-base","utils/localization"],function(a,e,b){var d=e.HDCABaseView;var c=d.extend({initialize:function(f){d.prototype.initialize.call(this,f)},_render_titleButtons:function(){this.log(this+"._render_titleButtons");return d.prototype._render_titleButtons.call(this).concat([this._render_deleteButton()])},_render_deleteButton:function(){var f=this,g={title:b("Delete"),classes:"dataset-delete",onclick:function(){f.$el.find(".icon-btn.dataset-delete").trigger("mouseout");f.model["delete"]()}};if(f.model.get("deleted")){g={title:b("Dataset collection is already deleted"),disabled:true}}g.faIcon="fa-times";return faIconButton(g)},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDCAEditView("+f+")"}});return{HDCAEditView:c}});
define(["mvc/dataset/states","mvc/collection/hdca-base","utils/localization"],function(a,e,b){var d=e.HDCABaseView;var c=d.extend({initialize:function(f){d.prototype.initialize.call(this,f)},_render_primaryActions:function(){this.log(this+"._render_primaryActions");return d.prototype._render_primaryActions.call(this).concat([this._render_deleteButton()])},_render_deleteButton:function(){var f=this,g={title:b("Delete"),classes:"dataset-delete",onclick:function(){f.$el.find(".icon-btn.dataset-delete").trigger("mouseout");f.model["delete"]()}};if(f.model.get("deleted")){g={title:b("Dataset collection is already deleted"),disabled:true}}g.faIcon="fa-times";return faIconButton(g)},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDCAEditView("+f+")"}});return{HDCAEditView:c}});
@@ -1 +1 @@
define(["mvc/history/history-content-base","mvc/collection/collection-model","utils/localization"],function(j,d,a){var h=j.HistoryContentMixin,c=d.DatasetCollection.extend(h);var i=d.ListDatasetCollection,e=i.extend(h).extend({initialize:function(m,l){i.prototype.initialize.call(this,m,l);h.initialize.call(this,m,l);this.set("state","ok",{silent:true})},toString:function(){return(["HistoryListDatasetCollection(",this.get("name"),")"].join(""))}});var k=d.PairDatasetCollection,g=k.extend(h).extend({initialize:function(m,l){k.prototype.initialize.call(this,m,l);h.initialize.call(this,m,l);this.set("state","ok",{silent:true})},toString:function(){return(["HistoryPairDatasetCollection(",this.get("name"),")"].join(""))}});var f=d.ListPairedDatasetCollection,b=f.extend(h).extend({initialize:function(m,l){f.prototype.initialize.call(this,m,l);h.initialize.call(this,m,l);this.set("state","ok",{silent:true})},toString:function(){return(["HistoryListPairedDatasetCollection(",this.get("name"),")"].join(""))}});return{HistoryDatasetCollection:c,HistoryListDatasetCollection:e,HistoryPairDatasetCollection:g,HistoryListPairedDatasetCollection:b}});
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);this.set("state","ok",{silent:true})},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);this.set("state","ok",{silent:true})},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);this.set("state","ok",{silent:true})},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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
define(["mvc/base-mvc","utils/localization"],function(a,b){var d={initialize:function(e){this.debug("HistoryContentViewMixin",e);this.selectable=e.selectable||false;this.log("\t selectable:",this.selectable);this.selected=e.selected||false;this.log("\t selected:",this.selected);this.expanded=e.expanded||false;this.log("\t expanded:",this.expanded)},render:function(f){var e=this._buildNewRender();this._queueNewRender(e,f);return this},_buildNewRender:function(){var e=$(this.templates.skeleton(this.model.toJSON()));var f=this._render_titleButtons();e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._renderBody());this._setUpBehaviors(e);return e},_queueNewRender:function(f,g){g=(g===undefined)?(true):(g);var e=this;if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).append(f.children());if(this.model.has("state")){this.$el.addClass("state-"+e.model.get("state"))}if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()})},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[]},_renderBody:function(){return null},toggleExpanded:function(e){e=(e===undefined)?(!this.expanded):(e);this.warn(this+".toggleExpanded, expand:",e);if(e){this.expand()}else{this.collapse()}return this},expand:function(){this.warn(this+".expand");var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._renderBody());e.expanded=true;e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.trigger("expanded",e.model)})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch().always(function(g){f()})}else{f()}},collapse:function(){var e=this;e.expanded=false;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.trigger("collapsed",e.model.id)})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,e);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,e);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},events:{"click .dataset-title-bar":"_clickTitleBar","keydown .dataset-title-bar":"_keyDownTitleBar","click .dataset-selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation();this.toggleExpanded()},_keyDownTitleBar:function(g){var e=32,f=13;if(g&&(g.type==="keydown")&&(g.keyCode===e||g.keyCode===f)){this.toggleExpanded();g.stopPropagation();return false}return true}};var c=Backbone.View.extend(a.LoggableMixin).extend(d);return{HistoryContentViewMixin:d,HistoryContentBaseView:c}});
define(["mvc/base-mvc","utils/localization"],function(a,b){var d={initialize:function(e){this.debug("HistoryContentViewMixin",e);this.selectable=e.selectable||false;this.log("\t selectable:",this.selectable);this.selected=e.selected||false;this.log("\t selected:",this.selected);this.expanded=e.expanded||false;this.log("\t expanded:",this.expanded)},render:function(f){var e=this._buildNewRender();this._queueNewRender(e,f);return this},_buildNewRender:function(){var e=$(this.templates.skeleton(this.model.toJSON()));e.find(".primary-actions").append(this._render_primaryActions());e.children(".details").replaceWith(this._renderBody());this._setUpBehaviors(e);return e},_queueNewRender:function(f,g){g=(g===undefined)?(true):(g);var e=this;if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).append(f.children());if(this.model.has("state")){this.$el.addClass("state-"+e.model.get("state"))}if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()})},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_primaryActions:function(){return[]},_renderBody:function(){return null},toggleExpanded:function(e){e=(e===undefined)?(!this.expanded):(e);if(e){this.expand()}else{this.collapse()}return this},expand:function(){this.warn(this+".expand");var e=this;function f(){e.$(".details").replaceWith(e._renderBody());e.expanded=true;e.$(".details").slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch().always(function(g){f()})}else{f()}},collapse:function(){var e=this;e.expanded=false;this.$(".details").slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".primary-actions").hide();this.$(".selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".selector").hide();this.$(".primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(e){this.$el.find(".selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,e);this.selected=true}return false},deselect:function(e){this.$el.find(".selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,e);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation();this.toggleExpanded()},_keyDownTitleBar:function(g){var e=32,f=13;if(g&&(g.type==="keydown")&&(g.keyCode===e||g.keyCode===f)){this.toggleExpanded();g.stopPropagation();return false}return true}};var c=Backbone.View.extend(a.LoggableMixin).extend(d);return{HistoryContentViewMixin:d,HistoryContentBaseView:c}});
@@ -1 +1 @@
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=function e(i,j){return[i,j].join("-")};var d={defaults:{history_id:null,history_content_type:"dataset_collection",hid:0,name:"(unnamed content)",state:"new",deleted:false,visible:true,accessible:true,purged:false},idAttribute:"type_id",constructor:function(j,i){this.info("HistoryContentMixin.constructor:",this,j,i);j.type_id=f(j.history_content_type,j.id);Backbone.Model.apply(this,arguments)},_typeIdStr:function(){return f(this.get("history_content_type"),this.get("id"))},initialize:function(j,i){this.debug("HistoryContentMixin.initialize",j,i);this.on("change:id",this._createTypeId);this._setUpListeners()},_setUpListeners:function(){},_createTypeId:function(){this.set("type_id",this._typeIdStr())},hidden:function(){return !this.get("visible")},isVisible:function(j,k){var i=true;if((!j)&&(this.get("deleted")||this.get("purged"))){i=false}if((!k)&&(!this.get("visible"))){i=false}return i},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var i=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||i)},hasDetails:function(){return true},hasData:function(){return true},urlRoot:galaxy_config.root+"api/histories/",url:function(){var i=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return i},urls:function(){return{}},"delete":function(i){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},i)},undelete:function(i){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},i)},hide:function(i){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},i)},unhide:function(i){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},i)},purge:function h(i){return jQuery.when()},searchAttributes:["name"],searchAliases:{title:"name"},searchAttribute:function(k,i){var j=this.get(k);if(!i||(j===undefined||j===null)){return false}if(_.isArray(j)){return this._searchArrayAttribute(j,i)}return(j.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)},_searchArrayAttribute:function(j,i){i=i.toLowerCase();return _.any(j,function(k){return(k.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)})},search:function(i){var j=this;return _.filter(this.searchAttributes,function(k){return j.searchAttribute(k,i)})},matches:function(j){var l="=",i=j.split(l);if(i.length>=2){var k=i[0];k=this.searchAliases[k]||k;return this.searchAttribute(k,i[1])}return !!this.search(j).length},matchesAll:function(j){var i=this;j=j.match(/(".*"|\w*=".*"|\S*)/g).filter(function(k){return !!k});return _.all(j,function(k){k=k.replace(/"/g,"");return i.matches(k)})},toString:function(){var i=this.get("id")||"";if(this.get("name")){i=this.get("hid")+' :"'+this.get("name")+'",'+i}return"HistoryContent("+i+")"}};var g=Backbone.Model.extend(b.LoggableMixin).extend(d);g.typeIdStr=f;return{HistoryContentMixin:d,HistoryContent:g}});
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b,c){var f=function e(i,j){return[i,j].join("-")};var d={defaults:{history_id:null,history_content_type:"dataset_collection",hid:0,name:"(unnamed content)",state:"new",deleted:false,visible:true,accessible:true,purged:false},idAttribute:"type_id",constructor:function(j,i){this.info("HistoryContentMixin.constructor:",this,j,i);j.type_id=f(j.history_content_type,j.id);Backbone.Model.apply(this,arguments)},_typeIdStr:function(){return f(this.get("history_content_type"),this.get("id"))},initialize:function(j,i){this.debug("HistoryContentMixin.initialize",j,i);this.on("change:id",this._createTypeId);this._setUpListeners()},_setUpListeners:function(){},_createTypeId:function(){this.set("type_id",this._typeIdStr())},hidden:function(){return !this.get("visible")},isVisible:function(j,k){var i=true;if((!j)&&(this.get("deleted")||this.get("purged"))){i=false}if((!k)&&(!this.get("visible"))){i=false}return i},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var i=_.contains(a.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||i)},hasData:function(){return true},urlRoot:galaxy_config.root+"api/histories/",url:function(){var i=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return i},urls:function(){return{}},"delete":function(i){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},i)},undelete:function(i){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},i)},hide:function(i){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},i)},unhide:function(i){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},i)},purge:function h(i){return jQuery.when()},searchAttributes:["name"],searchAliases:{title:"name"},searchAttribute:function(k,i){var j=this.get(k);if(!i||(j===undefined||j===null)){return false}if(_.isArray(j)){return this._searchArrayAttribute(j,i)}return(j.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)},_searchArrayAttribute:function(j,i){i=i.toLowerCase();return _.any(j,function(k){return(k.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)})},search:function(i){var j=this;return _.filter(this.searchAttributes,function(k){return j.searchAttribute(k,i)})},matches:function(j){var l="=",i=j.split(l);if(i.length>=2){var k=i[0];k=this.searchAliases[k]||k;return this.searchAttribute(k,i[1])}return !!this.search(j).length},matchesAll:function(j){var i=this;j=j.match(/(".*"|\w*=".*"|\S*)/g).filter(function(k){return !!k});return _.all(j,function(k){k=k.replace(/"/g,"");return i.matches(k)})},toString:function(){var i=this.get("id")||"";if(this.get("name")){i=this.get("hid")+' :"'+this.get("name")+'",'+i}return"HistoryContent("+i+")"}};var g=Backbone.Model.extend(b.LoggableMixin).extend(d);g.typeIdStr=f;return{HistoryContentMixin:d,HistoryContent:g}});
File diff suppressed because one or more lines are too long
+61 -54
View File
@@ -1681,50 +1681,60 @@ div.permissionContainer{padding-left:20px}
.search-input .search-clear,.search-input .search-loading{position:relative;display:inline-block;float:right;margin-top:-24px;margin-right:4px;font-size:1.4em;line-height:23px;color:grey}
.search-input .search-clear:hover{color:#303030}
#history-refresh-button,#history-options-button{display:inline-block;height:22px;width:22px;text-align:center;line-height:19px;font-size:1.2em;padding:0px}
.hda.dataset{border:1px solid #bfbfbf}.hda.dataset .vertical-spacing{margin-bottom:8px}
.hda.dataset .info-section{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}
.hda.dataset .dataset-padding{padding:6px 10px 6px 8px}
.hda.dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%}
.hda.dataset .help-text{font-weight:normal;color:#555}
.hda.dataset .dataset-selector{float:left;display:none;width:32px;height:32px;margin:0 0 -6px 0;padding:8px 0 2px 7px;font-size:80%;color:#333;cursor:pointer;vertical-align:middle}
.hda.dataset .dataset-selector:hover{color:maroon}
.hda.dataset .dataset-title-bar{cursor:pointer;outline:none;padding:6px 10px 6px 8px}
.hda.dataset .dataset-title-bar .dataset-title{display:inline;font-weight:bold;text-decoration:underline;word-wrap:break-word;word-break:break-all;line-height:16px}
.hda.dataset .dataset-primary-actions{display:inline-block;float:right;margin:6px 10px 0}.hda.dataset .dataset-primary-actions .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.hda.dataset .dataset-primary-actions .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.hda.dataset .dataset-primary-actions .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.hda.dataset .dataset-primary-actions .icon-btn:only-child{margin:0px;border-radius:3px}
.hda.dataset .dataset-primary-actions .icon-btn{margin-left:2px}
.hda.dataset .dataset-body{display:none;padding:0 10px 6px 8px}.hda.dataset .dataset-body [class$=messagesmall]{margin:0px 0px 8px 0px}
.hda.dataset .dataset-body label{margin:0px;padding:0px;font-weight:normal}
.hda.dataset .dataset-body .prompt{font-weight:normal;color:#555}
.hda.dataset .dataset-body .prompt:after{content:':';margin-right:4px}
.hda.dataset .dataset-body .dataset-summary{margin-bottom:8px}.hda.dataset .dataset-body .dataset-summary .dataset-blurb{margin-bottom:2px}
.hda.dataset .dataset-body .dataset-summary .dataset-datatype,.hda.dataset .dataset-body .dataset-summary .dataset-dbkey{display:inline}.hda.dataset .dataset-body .dataset-summary .dataset-datatype .value,.hda.dataset .dataset-body .dataset-summary .dataset-dbkey .value{font-weight:bold}
.hda.dataset .dataset-body .dataset-summary .dataset-datatype .value:after{content:',';font-weight:normal;color:#555;margin-right:4px}
.hda.dataset .dataset-body .dataset-summary .dataset-dbkey:after{content:' ';display:block;margin-bottom:8px}
.hda.dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto}.hda.dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
.hda.dataset .dataset-body .dataset-summary .job-error-text{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto;white-space:pre}
.hda.dataset .dataset-body .dataset-actions .left{display:inline-block;float:left}.hda.dataset .dataset-body .dataset-actions .left .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.hda.dataset .dataset-body .dataset-actions .left .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.hda.dataset .dataset-body .dataset-actions .left .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.hda.dataset .dataset-body .dataset-actions .left .icon-btn:only-child{margin:0px;border-radius:3px}
.hda.dataset .dataset-body .dataset-actions .left .icon-btn{margin-right:2px}
.hda.dataset .dataset-body .dataset-actions .left:not(:empty){margin-bottom:8px}
.hda.dataset .dataset-body .dataset-actions .right{display:inline-block;float:right}.hda.dataset .dataset-body .dataset-actions .right .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.hda.dataset .dataset-body .dataset-actions .right .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.hda.dataset .dataset-body .dataset-actions .right .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.hda.dataset .dataset-body .dataset-actions .right .icon-btn:only-child{margin:0px;border-radius:3px}
.hda.dataset .dataset-body .dataset-actions .right .icon-btn{margin-left:2px}
.hda.dataset .dataset-body .tags-display{display:none;margin-bottom:8px}.hda.dataset .dataset-body .tags-display .select2-container{min-width:0px}.hda.dataset .dataset-body .tags-display .select2-container .select2-choices{border-radius:3px}
.hda.dataset .dataset-body .annotation-display{display:none;margin-bottom:8px}.hda.dataset .dataset-body .annotation-display .annotation{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;white-space:pre-line;overflow:auto}
.hda.dataset .dataset-body .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'}
.hda.dataset .dataset-body .annotation-display textarea{margin:0px 0px 2px 0px;display:block;border-radius:3px;width:100%}
.hda.dataset .dataset-body .dataset-display-applications .display-application:last-child{margin-bottom:8px}
.hda.dataset .dataset-body .dataset-peek{margin-bottom:8px}.hda.dataset .dataset-body .dataset-peek pre.peek{width:100%;margin:0px;border-radius:3px;background:white;color:black;font-size:10px;overflow:auto}.hda.dataset .dataset-body .dataset-peek pre.peek th{color:white;background:#5f6990}
.hda.dataset .dataset-body .dataset-peek pre.peek table,.hda.dataset .dataset-body .dataset-peek pre.peek th,.hda.dataset .dataset-body .dataset-peek pre.peek tr,.hda.dataset .dataset-body .dataset-peek pre.peek td{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:10px}
.hda.dataset .state-icon{font-family:FontAwesome;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:4px;vertical-align:middle;width:16px;height:16px;line-height:16px;text-align:center;font-size:16px}
.state-icon-running{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)} 100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)} 100%{transform:rotate(359deg)}}.state-icon-running:before{content:"\f110"}
.state-icon-upload{overflow:hidden}.state-icon-upload:before{display:inline-block;-webkit-animation:eclipse 2s infinite linear;-moz-animation:eclipse 2s infinite linear;-o-animation:eclipse 2s infinite linear;animation:eclipse 2s infinite linear;content:"\f062"}@-moz-keyframes eclipse{0%{-moz-transform:translate(0, 16px)} 100%{-moz-transform:translate(0, -16px)}}@-webkit-keyframes eclipse{0%{-webkit-transform:translate(0, 16px)} 100%{-webkit-transform:translate(0, -16px)}}@-o-keyframes eclipse{0%{-o-transform:translate(0, 16px)} 100%{-o-transform:translate(0, -16px)}}@-ms-keyframes eclipse{0%{-ms-transform:translate(0, 16px)} 100%{-ms-transform:translate(0, -16px)}}@keyframes eclipse{0%{transform:translate(0, 16px)} 100%{transform:translate(0, -16px)}}
.state-icon-error{background-color:white;border-radius:8px}.state-icon-error:before{font-size:20px;line-height:16px;color:red;content:"\f057"}
.dataset.state-ok,.dataset.state-failed_metadata{background:#aff1af}.dataset.state-ok .state-icon,.dataset.state-failed_metadata .state-icon{display:none}
.dataset.state-error,.dataset.state-empty{background:#f9c7c5}.dataset.state-error .state-icon,.dataset.state-empty .state-icon{background-color:white;border-radius:8px}.dataset.state-error .state-icon:before,.dataset.state-empty .state-icon:before{font-size:20px;line-height:16px;color:red;content:"\f057"}
.dataset.state-upload{background:#a6e4f7}.dataset.state-upload .state-icon{overflow:hidden}.dataset.state-upload .state-icon:before{display:inline-block;-webkit-animation:eclipse 2s infinite linear;-moz-animation:eclipse 2s infinite linear;-o-animation:eclipse 2s infinite linear;animation:eclipse 2s infinite linear;content:"\f062"}@-moz-keyframes eclipse{0%{-moz-transform:translate(0, 16px)} 100%{-moz-transform:translate(0, -16px)}}@-webkit-keyframes eclipse{0%{-webkit-transform:translate(0, 16px)} 100%{-webkit-transform:translate(0, -16px)}}@-o-keyframes eclipse{0%{-o-transform:translate(0, 16px)} 100%{-o-transform:translate(0, -16px)}}@-ms-keyframes eclipse{0%{-ms-transform:translate(0, 16px)} 100%{-ms-transform:translate(0, -16px)}}@keyframes eclipse{0%{transform:translate(0, 16px)} 100%{transform:translate(0, -16px)}}
.dataset.state-queued{background:#eee}.dataset.state-queued .state-icon:before{content:"\f017"}
.dataset.state-running,.dataset.state-setting_metadata{background:#ffc}.dataset.state-running .state-icon,.dataset.state-setting_metadata .state-icon{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)} 100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)} 100%{transform:rotate(359deg)}}.dataset.state-running .state-icon:before,.dataset.state-setting_metadata .state-icon:before{content:"\f110"}
.dataset.state-paused{background:#d9edf7}.dataset.state-paused .state-icon:before{content:"\f04c"}
.dataset.state-discarded{background:#eee}.dataset.state-discarded .state-icon:before{content:"\f014"}
.dataset.state-noPermission{background:#eee;filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60}.dataset.state-noPermission .state-icon{font-size:20px}.dataset.state-noPermission .state-icon:before{content:"\f023"}
.dataset.state-new{background:#eee}.dataset.state-new .state-icon:before{content:"\f06a"}
.dataset{border:1px solid #bfbfbf}.dataset .vertical-spacing{margin-bottom:8px}
.dataset .info-section{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}
.dataset .padded{padding:6px 10px 6px 8px}
.dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%}
.dataset .help-text{font-weight:normal;color:#555}
.dataset .selector{float:left;display:none;width:32px;height:32px;margin:0 0 -6px 0;padding:8px 0 2px 7px;font-size:80%;color:#333;cursor:pointer;vertical-align:middle}
.dataset .selector:hover{color:maroon}
.dataset .title-bar{cursor:pointer;outline:none;padding:6px 10px 6px 8px}.dataset .title-bar .title{display:inline;font-weight:bold;text-decoration:underline;word-wrap:break-word;word-break:break-all;line-height:16px}.dataset .title-bar .title .hid:after{content:':'}
.dataset .primary-actions{display:inline-block;float:right;margin:6px 10px 0}.dataset .primary-actions .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.dataset .primary-actions .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.dataset .primary-actions .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.dataset .primary-actions .icon-btn:only-child{margin:0px;border-radius:3px}
.dataset .primary-actions .icon-btn{margin-left:2px}
.dataset .details{display:none;padding:0 10px 6px 8px}.dataset .details [class$=messagesmall]{margin:0px 0px 8px 0px}
.dataset .details label{margin:0px;padding:0px;font-weight:normal}
.dataset .details .prompt{font-weight:normal;color:#555}
.dataset .details .prompt:after{content:':';margin-right:4px}
.dataset .details .summary{margin-bottom:8px}.dataset .details .summary .blurb{margin-bottom:2px}
.dataset .details .summary .datatype,.dataset .details .summary .dbkey{display:inline}.dataset .details .summary .datatype .value,.dataset .details .summary .dbkey .value{font-weight:bold}
.dataset .details .summary .datatype .value:after{content:',';font-weight:normal;color:#555;margin-right:4px}
.dataset .details .summary .dbkey:after{content:' ';display:block;margin-bottom:8px}
.dataset .details .summary .info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto}.dataset .details .summary .info .value{white-space:pre-line}
.dataset .details .summary .job-error-text{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto;white-space:pre}
.dataset .details .actions .left{display:inline-block;float:left}.dataset .details .actions .left .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.dataset .details .actions .left .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.dataset .details .actions .left .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.dataset .details .actions .left .icon-btn:only-child{margin:0px;border-radius:3px}
.dataset .details .actions .left .icon-btn{margin-right:2px}
.dataset .details .actions .left:not(:empty){margin-bottom:8px}
.dataset .details .actions .right{display:inline-block;float:right}.dataset .details .actions .right .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.dataset .details .actions .right .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
.dataset .details .actions .right .icon-btn:last-child{margin-left:0px;border-radius:0px 3px 3px 0px}
.dataset .details .actions .right .icon-btn:only-child{margin:0px;border-radius:3px}
.dataset .details .actions .right .icon-btn{margin-left:2px}
.dataset .details .tags-display{display:none;margin-bottom:8px}.dataset .details .tags-display .select2-container{min-width:0px}.dataset .details .tags-display .select2-container .select2-choices{border-radius:3px}
.dataset .details .annotation-display{display:none;margin-bottom:8px}.dataset .details .annotation-display .annotation{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;white-space:pre-line;overflow:auto}
.dataset .details .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'}
.dataset .details .annotation-display textarea{margin:0px 0px 2px 0px;display:block;border-radius:3px;width:100%}
.dataset .details .display-applications .display-application:last-child{margin-bottom:8px}
.dataset .details .dataset-peek{margin-bottom:8px;width:100%;margin:0px;border-radius:3px;background:white;color:black;font-size:10px;overflow:auto}.dataset .details .dataset-peek th{color:white;background:#5f6990}
.dataset .details .dataset-peek table,.dataset .details .dataset-peek th,.dataset .details .dataset-peek tr,.dataset .details .dataset-peek td{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:10px}
.history-panel [class$="messagesmall"]{margin:0px}
.history-panel .editable-text{border:solid transparent 1px}
.history-panel .editable-text:hover{cursor:pointer;border:1px dotted #999999}
@@ -1759,17 +1769,6 @@ div.permissionContainer{padding-left:20px}
.history-panel .dataset:last-child{border-width:1px 0px 1px 0px}
.history-panel .empty-history-message{display:none;margin:0px 10px 0px 10px}
.history-panel .tag-button{display:inline-block;height:20px;margin:2px 2px 0px 0px;border:1px solid grey;border-radius:3px 10px 10px 3px;padding:2px 4px 2px 4px;background-color:#EEE;line-height:13px}.history-panel .tag-button .tag-name{margin-right:2px}
.state-icon-running{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)} 100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)} 100%{transform:rotate(359deg)}}.state-icon-running:before{content:"\f110"}
.state-icon-upload{overflow:hidden}.state-icon-upload:before{display:inline-block;-webkit-animation:eclipse 2s infinite linear;-moz-animation:eclipse 2s infinite linear;-o-animation:eclipse 2s infinite linear;animation:eclipse 2s infinite linear;content:"\f062"}@-moz-keyframes eclipse{0%{-moz-transform:translate(0, 16px)} 100%{-moz-transform:translate(0, -16px)}}@-webkit-keyframes eclipse{0%{-webkit-transform:translate(0, 16px)} 100%{-webkit-transform:translate(0, -16px)}}@-o-keyframes eclipse{0%{-o-transform:translate(0, 16px)} 100%{-o-transform:translate(0, -16px)}}@-ms-keyframes eclipse{0%{-ms-transform:translate(0, 16px)} 100%{-ms-transform:translate(0, -16px)}}@keyframes eclipse{0%{transform:translate(0, 16px)} 100%{transform:translate(0, -16px)}}
.dataset.state-ok,.dataset.state-failed_metadata{background:#aff1af}.dataset.state-ok .state-icon,.dataset.state-failed_metadata .state-icon{display:none}
.dataset.state-error,.dataset.state-empty{background:#f9c7c5}.dataset.state-error .state-icon,.dataset.state-empty .state-icon{background-color:white;border-radius:8px}.dataset.state-error .state-icon:before,.dataset.state-empty .state-icon:before{font-size:20px;line-height:16px;color:red;content:"\f057"}
.dataset.state-upload{background:#a6e4f7}.dataset.state-upload .state-icon{overflow:hidden}.dataset.state-upload .state-icon:before{display:inline-block;-webkit-animation:eclipse 2s infinite linear;-moz-animation:eclipse 2s infinite linear;-o-animation:eclipse 2s infinite linear;animation:eclipse 2s infinite linear;content:"\f062"}@-moz-keyframes eclipse{0%{-moz-transform:translate(0, 16px)} 100%{-moz-transform:translate(0, -16px)}}@-webkit-keyframes eclipse{0%{-webkit-transform:translate(0, 16px)} 100%{-webkit-transform:translate(0, -16px)}}@-o-keyframes eclipse{0%{-o-transform:translate(0, 16px)} 100%{-o-transform:translate(0, -16px)}}@-ms-keyframes eclipse{0%{-ms-transform:translate(0, 16px)} 100%{-ms-transform:translate(0, -16px)}}@keyframes eclipse{0%{transform:translate(0, 16px)} 100%{transform:translate(0, -16px)}}
.dataset.state-queued{background:#eee}.dataset.state-queued .state-icon:before{content:"\f017"}
.dataset.state-running,.dataset.state-setting_metadata{background:#ffc}.dataset.state-running .state-icon,.dataset.state-setting_metadata .state-icon{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)} 100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)} 100%{transform:rotate(359deg)}}.dataset.state-running .state-icon:before,.dataset.state-setting_metadata .state-icon:before{content:"\f110"}
.dataset.state-paused{background:#d9edf7}.dataset.state-paused .state-icon:before{content:"\f04c"}
.dataset.state-discarded{background:#eee}.dataset.state-discarded .state-icon:before{content:"\f014"}
.dataset.state-noPermission{background:#eee;filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60}.dataset.state-noPermission .state-icon{font-size:20px}.dataset.state-noPermission .state-icon:before{content:"\f023"}
.dataset.state-new{background:#eee}.dataset.state-new .state-icon:before{content:"\f06a"}
.annotated-history-panel [class$=messagesmall]{margin:8px 0px 8px 0px}
.annotated-history-panel .history-controls{margin:0px 0px 16px 4px;padding:0px}.annotated-history-panel .history-controls .history-name{font-size:150%;margin-bottom:4px}
.annotated-history-panel .history-controls .history-subtitle{margin:0px;padding:0px 0px 0px 4px;padding-left:4px}
@@ -1783,7 +1782,6 @@ div.permissionContainer{padding-left:20px}
.annotated-history-panel table.datasets-list .dataset-row>td:nth-child(1){width:50%}
.annotated-history-panel table.datasets-list .dataset-row>td:nth-child(2){padding:8px 16px 8px 16px;white-space:pre-wrap}
.annotated-history-panel table.datasets-list .dataset-row .dataset{border:0px}
.hda .hda-hid:after{content:':'}
body.historyPage{background:#dfe5f9;color:#000;margin:5px;border:0;padding:0}
div.historyLinks{margin:5px 5px}
div.historyItem{margin:0 -5px;padding:8px 10px;border-top:solid #bfbfbf 1px;border-right:none;word-wrap:break-word;background:#eee}div.historyItem .state-icon{display:inline-block;vertical-align:middle;width:16px;height:16px;background-position:0 1px;background-repeat:no-repeat}
@@ -1813,6 +1811,15 @@ div.historyItemButtons .icon-button.edit_disabled{background-image:url(sprite-hi
div.historyItemBody div{padding-top:2px}
pre.peek{background:white;color:black;width:100%;font-size:10px;overflow:auto}pre.peek th{color:white;background:#5f6990}
pre.peek table,pre.peek th,pre.peek tr,pre.peek td{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:10px}
.dataset-collection-element{border:1px solid #bfbfbf;background-color:white}.dataset-collection-element .title-bar{padding:8px}.dataset-collection-element .title-bar .subtitle{margin-top:2px;font-size:90%;color:grey}
.dataset-collection-element .details{display:none;padding:6px}
.dataset-collection-panel{margin:0px;padding:0px}.dataset-collection-panel .vertically-spaced{margin-top:4px}
.dataset-collection-panel .controls{padding:8px}.dataset-collection-panel .controls .navigation{margin-top:4px}.dataset-collection-panel .controls .navigation .back .fa-icon{font-weight:bold;text-decoration:none;margin-right:4px}
.dataset-collection-panel .controls .title{margin-top:12px}.dataset-collection-panel .controls .title .name{font-weight:bold}
.dataset-collection-panel .controls .subtitle{color:grey}
.dataset-collection-panel .datasets-list{margin-top:8px}.dataset-collection-panel .datasets-list .dataset-collection-element{border-width:1px 0px 0px 0px}.dataset-collection-panel .datasets-list .dataset-collection-element:last-child{border-bottom-width:1px}
.history-panel .dataset-collection .subtitle,.history-panel .hdca .subtitle{margin-top:2px;font-size:90%;color:grey}
.history-panel .dataset-collection-panel .dataset-collection-element{background-color:#aff1af}
.toolMenuContainer{color:#000;background:#dfe5f9;min-height:100%;padding:5px 10px}
div.toolSectionPad{margin:0;padding:0;height:5px;font-size:0px}
div.toolSectionWrapper{margin-bottom:5px}
+1 -192
View File
@@ -1558,198 +1558,7 @@ div.permissionContainer {
@import "sprite-history-states.less";
@import "sprite-history-buttons.less";
@import "history.less";
body.historyPage {
background: @side-panel-bg;
color: @base-text-color;
margin: 5px;
border: 0;
padding: 0;
}
// Control links at top of history
div.historyLinks {
margin: 5px 5px;
}
// Default history item appearance
div.historyItem {
margin: 0px -5px;
padding: 8px 10px;
border-top: solid @border-default-color 1px;
// border-left: solid @state-queued-border 5px;
border-right: none;
word-wrap: break-word;
background: @state-default-bg;
.state-icon {
display: inline-block;
vertical-align: middle;
width: 16px;
height: 16px;
background-position: 0 1px;
background-repeat: no-repeat;
}
.historyItemTitle {
font-weight: bold;
line-height: 16px;
}
}
.historyItemContainer:last-child div.historyItem {
border-bottom: solid @border-default-color 1px;
}
// Nested history items
div.historyItem div.historyItem {
margin-right: -11px;
}
// Change background/border color depending on state
div.historyItem-ok,
div.historyItem-failed_metadata {
background: @state-success-bg;
.state-icon {
display: none;
}
}
//@import "sprite-history-states.less";
div.historyItem-error {
background: @state-danger-bg;
.state-icon {
.sprite(@data_error);
}
}
div.historyItem-empty {
background: @state-danger-bg;
.state-icon {
.sprite(@data_empty);
}
}
div.historyItem-running {
background: @state-running-bg;
.state-icon {
background-image: url(data_running.gif);
}
}
div.historyItem-setting_metadata {
background: @state-running-bg;
.state-icon {
background-image: url(data_running.gif);
}
}
div.historyItem-upload {
background: @state-info-bg;
.state-icon {
background-image: url(data_upload.gif);
}
}
div.historyItem-queued {
background: @state-default-bg;
.state-icon {
.sprite(@data_queued);
}
}
div.historyItem-noPermission {
filter: alpha(opacity=60);
-moz-opacity: .60;
opacity: .60;
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f05e";
}
}
}
div.historyItem-paused {
background: @state-paused-bg;
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f04c";
}
}
}
div.historyItem-new {
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f071";
}
}
}
// Special case for showing the spinner but not changing the background
div.historyItemTitleBar.spinner .state-icon {
background: url(data_running.gif) 0 1px no-repeat !important;
}
// Buttons
div.historyItemButtons {
float: right;
@import "sprite-history-buttons.less";
.icon-button.display {
.sprite(@eye_icon);
}
.icon-button.display:hover {
.sprite(@eye_icon_dark);
}
.icon-button.display_disabled {
.sprite(@eye_icon_grey);
}
.icon-button.delete {
.sprite(@delete_icon);
}
.icon-button.delete:hover {
.sprite(@delete_icon_dark);
}
.icon-button.delete_disabled {
.sprite(@delete_icon_grey);
}
.icon-button.edit {
.sprite(@pencil_icon);
}
.icon-button.edit:hover {
.sprite(@pencil_icon_dark);
}
.icon-button.edit_disabled {
.sprite(@pencil_icon_grey);
}
}
div.historyItemBody div {
padding-top: 2px;
}
pre.peek {
background: white;
color: black;
width: 100%;
font-size: 10px;
overflow: auto;
th {
color: white;
background: @panel-primary-heading-bg;
}
table, th, tr, td {
font-family: @font-family-monospace;
font-size: 10px;
}
}
@import "collections.less";
// ==== Tool menu styles
+87 -2
View File
@@ -1,4 +1,89 @@
.dataset-collections-panel {
//============================================================================= collection element
.dataset-collection-element {
border: 1px solid @border-default-color;
background-color: white;
.title-bar {
padding: 8px;
.subtitle {
margin-top: 2px;
font-size: 90%;
color: grey;
}
}
.details {
display: none;
padding: 6px;
}
}
//.dataset-collection-element.dataset {
//}
//
//.dataset-collection-element.dataset-collection {
//}
//============================================================================= collection
//.dataset-collection {
//}
//============================================================================= collection panel
.dataset-collection-panel {
margin: 0px;
padding: 0px;
.vertically-spaced {
margin-top: 4px;
}
.controls {
padding: 8px;
.navigation {
margin-top: 4px;
.back {
//TODO: to more generic less class
.fa-icon {
font-weight: bold;
text-decoration: none;
margin-right: 4px;
}
}
}
.title {
margin-top: 12px;
.name {
font-weight: bold;
}
}
.subtitle {
color: grey;
}
}
.datasets-list {
margin-top: 8px;
.dataset-collection-element {
border-width: 1px 0px 0px 0px;
&:last-child {
border-bottom-width: 1px;
}
}
}
}
//============================================================================= collection inside history panel
.history-panel .dataset-collection,
.history-panel .hdca {
.subtitle {
margin-top: 2px;
font-size: 90%;
color: grey;
}
}
//============================================================================= collection panel inside history panel
.history-panel .dataset-collection-panel {
.dataset-collection-element {
//TODO: collections are currently stateless
background-color: @state-success-bg;
}
}
+405 -226
View File
@@ -124,8 +124,183 @@
}
// ---------------------------------------------------------------------------- datasets
.hda.dataset {
// ---------------------------------------------------------------------------- dataset states
.hda.dataset .state-icon {
.fa-icon;
display: inline-block;
margin-right: 4px;
vertical-align: middle;
width: 16px;
height: 16px;
line-height: 16px;
text-align: center;
font-size: 16px;
}
// ............................................................................ animated or composite state icons
.state-icon-running {
//TODO: couldn't find a way to do this with fa/spinning.less as mixin
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
@-moz-keyframes spin {
0% { -moz-transform: rotate(0deg); }
100% { -moz-transform: rotate(359deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@-o-keyframes spin {
0% { -o-transform: rotate(0deg); }
100% { -o-transform: rotate(359deg); }
}
@-ms-keyframes spin {
0% { -ms-transform: rotate(0deg); }
100% { -ms-transform: rotate(359deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
&:before {
content: @fa-var-spinner;
}
}
.state-icon-upload {
overflow: hidden;
&:before {
display: inline-block;
-webkit-animation: eclipse 2s infinite linear;
-moz-animation: eclipse 2s infinite linear;
-o-animation: eclipse 2s infinite linear;
animation: eclipse 2s infinite linear;
@-moz-keyframes eclipse {
0% { -moz-transform: translate(0px,16px); }
100% { -moz-transform: translate(0px,-16px); }
}
@-webkit-keyframes eclipse {
0% { -webkit-transform: translate(0px,16px); }
100% { -webkit-transform: translate(0px,-16px); }
}
@-o-keyframes eclipse {
0% { -o-transform: translate(0px,16px); }
100% { -o-transform: translate(0px,-16px); }
}
@-ms-keyframes eclipse {
0% { -ms-transform: translate(0px,16px); }
100% { -ms-transform: translate(0px,-16px); }
}
@keyframes eclipse {
0% { transform: translate(0px,16px); }
100% { transform: translate(0px,-16px); }
}
content: @fa-var-arrow-up;
}
}
.state-icon-error {
background-color: white;
border-radius: 8px;
&:before {
font-size: 20px;
line-height: 16px;
color: red;
content: @fa-var-times-circle;
}
}
// ............................................................................ state bgs and icons
.dataset {
// Change background/border color depending on state
&.state-ok,
&.state-failed_metadata {
background: @state-success-bg;
.state-icon {
display: none;
}
}
&.state-error,
&.state-empty {
background: @state-danger-bg;
.state-icon {
.state-icon-error;
}
}
&.state-upload {
background: @state-info-bg;
.state-icon {
.state-icon-upload;
}
}
&.state-queued {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-clock-o;
}
}
}
&.state-running,
&.state-setting_metadata {
background: @state-running-bg;
.state-icon {
.state-icon-running;
}
}
&.state-paused {
background: @state-paused-bg;
.state-icon {
&:before {
content: @fa-var-pause;
}
}
}
&.state-discarded {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-trash-o;
}
}
}
&.state-noPermission {
background: @state-default-bg;
filter: alpha(opacity=60);
-moz-opacity: .60;
opacity: .60;
.state-icon {
font-size: 20px;
&:before {
content: @fa-var-lock;
}
}
}
&.state-new {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-exclamation-circle;
}
}
}
}
// ---------------------------------------------------------------------------- datasets within the history panel
.dataset {
border: 1px solid @border-default-color;
// body mixins
@@ -136,14 +311,13 @@
.info-section {
border-radius: 3px;
border: 1px solid fadeout( @layout-border-color, 70% );
//background-color: fadeout( white, 60% );
padding: 4px;
}
@spacing-top : 6px;
@spacing-right : 10px;
@spacing-bottom : 6px;
@spacing-left : 8px;
.dataset-padding {
.padded {
padding: @spacing-top @spacing-right @spacing-bottom @spacing-left;
}
@@ -154,12 +328,10 @@
.help-text {
font-weight: normal;
// font-style: italic;
// font-size: 90%;
color: #555;
}
.dataset-selector {
.selector {
float: left;
// always initially hidden and zero width
display: none;
@@ -173,28 +345,29 @@
cursor: pointer;
vertical-align: middle;
}
.dataset-selector:hover {
.selector:hover {
color: maroon;
}
.dataset-title-bar {
.title-bar {
cursor: pointer;
outline: none;
.dataset-padding;
.padded;
.dataset-state-icon {
}
.dataset-title {
.title {
display: inline;
font-weight: bold;
text-decoration: underline;
word-wrap: break-word;
word-break: break-all;
line-height: 16px;
.hid:after {
content: ':';
}
}
}
.dataset-primary-actions {
.primary-actions {
.icon-btn-group();
float: right;
margin: @spacing-top @spacing-right 0;
@@ -203,10 +376,8 @@
}
}
.dataset-body {
.details {
display: none;
// background-color: fadeout( white, 70% );
//.dataset-padding;
padding: 0px @spacing-right @spacing-bottom @spacing-left;
[class$=messagesmall] {
@@ -226,57 +397,49 @@
margin-right: 4px;
}
.dataset-summary {
.dataset-blurb {
.summary {
.blurb {
margin-bottom: 2px;
}
.dataset-datatype, .dataset-dbkey {
.datatype, .dbkey {
display: inline;
.value {
font-weight: bold;
}
}
.dataset-datatype .value:after {
.datatype .value:after {
content: ',';
.help-text;
margin-right: 4px;
}
.dataset-dbkey:after {
.dbkey:after {
content: ' ';
display: block;
.vertical-spacing;
}
.dataset-info {
.info {
.info-section;
overflow: auto;
.value {
white-space: pre-line;
}
}
.job-error-text {
.info-section;
overflow: auto;
white-space: pre;
}
// handle the last vertical gap in the parent as summary is used in other states as well (w/o info)
.vertical-spacing;
}
.dataset-actions {
.actions {
.left {
.icon-btn-group();
float: left;
.icon-btn {
margin-right: @icon-btn-margin;
}
//.icon-btn-group {
// margin-right: @icon-btn-margin;
// .icon-btn {
// margin-right: 0;
// }
//}
&:not(:empty) {
// can't use :empty on dataset-actions - will always have left & right, so
// add gap to left (more likely to have children)
@@ -318,6 +481,7 @@
font-size: 10px;
font-style: italic;
color: grey;
//TODO: move out for localization
content : 'Click here to edit annotation';
}
textarea {
@@ -328,7 +492,7 @@
}
}
.dataset-display-applications {
.display-applications {
.display-application:last-child {
.vertical-spacing;
}
@@ -336,50 +500,27 @@
.dataset-peek {
.vertical-spacing;
pre.peek {
width: 100%;
margin: 0px;
border-radius: 3px;
background: white;
color: black;
width: 100%;
margin: 0px;
border-radius: 3px;
background: white;
color: black;
font-size: 10px;
overflow: auto;
th {
color: white;
background: @panel-primary-heading-bg;
}
table, th, tr, td {
font-family: @font-family-monospace;
font-size: 10px;
overflow: auto;
th {
color: white;
background: @panel-primary-heading-bg;
}
table, th, tr, td {
font-family: @font-family-monospace;
font-size: 10px;
}
}
}
}
}
.hda.dataset .state-icon {
.fa-icon;
display: inline-block;
margin-right: 4px;
vertical-align: middle;
width: 16px;
height: 16px;
line-height: 16px;
text-align: center;
font-size: 16px;
}
.state-icon-error {
background-color: white;
border-radius: 8px;
&:before {
font-size: 20px;
line-height: 16px;
color: red;
content: @fa-var-times-circle;
}
}
// ---------------------------------------------------------------------------- history
.history-panel {
@@ -409,13 +550,6 @@
padding: 0px;
.history-search-controls {
.history-search-input {
//margin-right: 22px;
}
//.history-search-advanced {
// margin-top : -21px;
// float : right;
//}
display: none;
padding: 0px 0px 8px 0px;
}
@@ -494,6 +628,7 @@
font-size: 10px;
font-style: italic;
color: grey;
//TODO: move out for localization
content : 'Click here to edit annotation';
}
textarea {
@@ -550,153 +685,6 @@
}
}
.state-icon-running {
//TODO: couldn't find a way to do this with fa/spinning.less as mixin
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
@-moz-keyframes spin {
0% { -moz-transform: rotate(0deg); }
100% { -moz-transform: rotate(359deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@-o-keyframes spin {
0% { -o-transform: rotate(0deg); }
100% { -o-transform: rotate(359deg); }
}
@-ms-keyframes spin {
0% { -ms-transform: rotate(0deg); }
100% { -ms-transform: rotate(359deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
&:before {
content: @fa-var-spinner;
}
}
.state-icon-upload {
overflow: hidden;
&:before {
display: inline-block;
-webkit-animation: eclipse 2s infinite linear;
-moz-animation: eclipse 2s infinite linear;
-o-animation: eclipse 2s infinite linear;
animation: eclipse 2s infinite linear;
@-moz-keyframes eclipse {
0% { -moz-transform: translate(0px,16px); }
100% { -moz-transform: translate(0px,-16px); }
}
@-webkit-keyframes eclipse {
0% { -webkit-transform: translate(0px,16px); }
100% { -webkit-transform: translate(0px,-16px); }
}
@-o-keyframes eclipse {
0% { -o-transform: translate(0px,16px); }
100% { -o-transform: translate(0px,-16px); }
}
@-ms-keyframes eclipse {
0% { -ms-transform: translate(0px,16px); }
100% { -ms-transform: translate(0px,-16px); }
}
@keyframes eclipse {
0% { transform: translate(0px,16px); }
100% { transform: translate(0px,-16px); }
}
content: @fa-var-arrow-up;
}
}
// Change background/border color depending on state
.dataset.state-ok, .dataset.state-failed_metadata {
background: @state-success-bg;
.state-icon {
display: none;
}
}
.dataset.state-error,
.dataset.state-empty {
background: @state-danger-bg;
.state-icon {
.state-icon-error;
}
}
.dataset.state-upload {
background: @state-info-bg;
.state-icon {
.state-icon-upload;
}
}
.dataset.state-queued {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-clock-o;
}
}
}
.dataset.state-running,
.dataset.state-setting_metadata {
background: @state-running-bg;
.state-icon {
.state-icon-running;
}
}
.dataset.state-paused {
background: @state-paused-bg;
.state-icon {
&:before {
content: @fa-var-pause;
}
}
}
.dataset.state-discarded {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-trash-o;
}
}
}
.dataset.state-noPermission {
background: @state-default-bg;
filter: alpha(opacity=60);
-moz-opacity: .60;
opacity: .60;
.state-icon {
font-size: 20px;
&:before {
content: @fa-var-lock;
}
}
}
.dataset.state-new {
background: @state-default-bg;
.state-icon {
&:before {
content: @fa-var-exclamation-circle;
}
}
}
// ---------------------------------------------------------------------------- annotated-history-panel
.annotated-history-panel {
//TODO: most of these styles are specific to history/display.mako and not to this type of panel in general
@@ -769,7 +757,198 @@
}
}
// ---------------------------------------------------------------------------- hdas
.hda .hda-hid:after {
content: ':';
// ---------------------------------------------------------------------------- older styles
//TODO: these may still apply in mobile display, workflow stuff
body.historyPage {
background: @side-panel-bg;
color: @base-text-color;
margin: 5px;
border: 0;
padding: 0;
}
// Control links at top of history
div.historyLinks {
margin: 5px 5px;
}
// Default history item appearance
div.historyItem {
margin: 0px -5px;
padding: 8px 10px;
border-top: solid @border-default-color 1px;
// border-left: solid @state-queued-border 5px;
border-right: none;
word-wrap: break-word;
background: @state-default-bg;
.state-icon {
display: inline-block;
vertical-align: middle;
width: 16px;
height: 16px;
background-position: 0 1px;
background-repeat: no-repeat;
}
.historyItemTitle {
font-weight: bold;
line-height: 16px;
}
}
.historyItemContainer:last-child div.historyItem {
border-bottom: solid @border-default-color 1px;
}
// Nested history items
div.historyItem div.historyItem {
margin-right: -11px;
}
// Change background/border color depending on state
div.historyItem-ok,
div.historyItem-failed_metadata {
background: @state-success-bg;
.state-icon {
display: none;
}
}
//@import "sprite-history-states.less";
div.historyItem-error {
background: @state-danger-bg;
.state-icon {
.sprite(@data_error);
}
}
div.historyItem-empty {
background: @state-danger-bg;
.state-icon {
.sprite(@data_empty);
}
}
div.historyItem-running {
background: @state-running-bg;
.state-icon {
background-image: url(data_running.gif);
}
}
div.historyItem-setting_metadata {
background: @state-running-bg;
.state-icon {
background-image: url(data_running.gif);
}
}
div.historyItem-upload {
background: @state-info-bg;
.state-icon {
background-image: url(data_upload.gif);
}
}
div.historyItem-queued {
background: @state-default-bg;
.state-icon {
.sprite(@data_queued);
}
}
div.historyItem-noPermission {
filter: alpha(opacity=60);
-moz-opacity: .60;
opacity: .60;
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f05e";
}
}
}
div.historyItem-paused {
background: @state-paused-bg;
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f04c";
}
}
}
div.historyItem-new {
.state-icon {
line-height: 16px;
.fa-icon;
&:before {
content: "\f071";
}
}
}
// Special case for showing the spinner but not changing the background
div.historyItemTitleBar.spinner .state-icon {
background: url(data_running.gif) 0 1px no-repeat !important;
}
// Buttons
div.historyItemButtons {
float: right;
@import "sprite-history-buttons.less";
.icon-button.display {
.sprite(@eye_icon);
}
.icon-button.display:hover {
.sprite(@eye_icon_dark);
}
.icon-button.display_disabled {
.sprite(@eye_icon_grey);
}
.icon-button.delete {
.sprite(@delete_icon);
}
.icon-button.delete:hover {
.sprite(@delete_icon_dark);
}
.icon-button.delete_disabled {
.sprite(@delete_icon_grey);
}
.icon-button.edit {
.sprite(@pencil_icon);
}
.icon-button.edit:hover {
.sprite(@pencil_icon_dark);
}
.icon-button.edit_disabled {
.sprite(@pencil_icon_grey);
}
}
div.historyItemBody div {
padding-top: 2px;
}
pre.peek {
background: white;
color: black;
width: 100%;
font-size: 10px;
overflow: auto;
th {
color: white;
background: @panel-primary-heading-bg;
}
table, th, tr, td {
font-family: @font-family-monospace;
font-size: 10px;
}
}
-3
View File
@@ -93,9 +93,6 @@
});
});
// Init history boxes.
//init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
// Init user item rating.
$('.user_rating_star').rating({
callback: function(rating, link) {
@@ -29,14 +29,6 @@
container.find(".toggle-expand").hide();
container.find(".toggle").show();
// Init needed for history items.
init_history_items( container.find("div.historyItemWrapper"), "noinit", "nochanges" );
container.find( "div.historyItemBody:visible" ).each( function() {
if ( $.browser.mozilla ) {
$(this).find( "pre.peek" ).css( "overflow", "hidden" );
}
$(this).hide();
});
make_popup_menus();
}
});