1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f18fd1851269/ Changeset: f18fd1851269 User: carlfeberhard Date: 2013-12-06 18:53:31 Summary: History panel: allow operations on multiple datasets (disabled) Affected #: 13 files diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -42,9 +42,9 @@ /** is the view currently in selection mode? */ //this.selectable = attributes.selectable || false; - this.selectable = false; + this.selectable = attributes.selectable || false; /** is the view currently selected? */ - this.selected = false; + this.selected = attributes.selected || false; /** is the body of this hda view expanded/not. */ this.expanded = attributes.expanded || false; this._setUpListeners(); @@ -105,6 +105,7 @@ this.$el.empty() .attr( 'class', view.className ).addClass( 'state-' + view.model.get( 'state' ) ) .append( $newRender.children() ); + if( this.selectable ){ this.showSelector( 0 ); } next(); }); // fade the new in @@ -117,7 +118,6 @@ if( this.model.inReadyState() ){ this.trigger( 'rendered:ready', view ); } - if( this.selectable ){ this.showSelect(); } next(); }); return this; @@ -398,7 +398,7 @@ // expand the body when the title is clicked 'click .dataset-title-bar' : 'toggleBodyVisibility', // toggle selected state - 'click .dataset-selector' : 'select' + 'click .dataset-selector' : 'toggleSelect' }, /** Show or hide the body/details of an HDA. @@ -462,61 +462,109 @@ /** display a (fa-icon) checkbox on the left of the hda that fires events when checked * Note: this also hides the primary actions */ - showSelect : function( speed ){ + showSelector : function( speed ){ // if already shown, do nothing if( this.$el.find( '.dataset-selector' ).css( 'display' ) !== 'none' ){ return; } speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); + // make sure selected state is represented properly + if( this.selected ){ + this.select( null, true ); + } + // create a jq fx queue to do this sequentially: fadeout the buttons, embiggen the selector var hdaView = this, SELECTOR_WIDTH = 32; - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-primary-actions' ).fadeOut( speed, next ); - }); - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-selector' ).show() - // height is height of titlebar, width will animate from 0 to WIDTH - .css({ - height: $( this ).find( '.dataset-title-bar' ).innerHeight() - }) - .animate({ width: SELECTOR_WIDTH }, speed, next ); + if( speed ){ + this.$el.queue( 'fx', function( next ){ + $( this ).find( '.dataset-primary-actions' ).fadeOut( speed, next ); + }); + this.$el.queue( 'fx', function( next ){ + $( this ).find( '.dataset-selector' ).show().animate({ width: SELECTOR_WIDTH }, speed, next ); + $( this ).find( '.dataset-title-bar' ).animate({ 'margin-left': SELECTOR_WIDTH }, speed, next ); + hdaView.selectable = true; + hdaView.trigger( 'selectable', true, hdaView ); + }); + // no animation + } else { + this.$el.find( '.dataset-primary-actions' ).hide(); + this.$el.find( '.dataset-selector' ).show().css({ width : SELECTOR_WIDTH }); + this.$el.find( '.dataset-title-bar' ).show().css({ 'margin-left' : SELECTOR_WIDTH }); hdaView.selectable = true; hdaView.trigger( 'selectable', true, hdaView ); - }); + } }, /** remove the selection checkbox */ - hideSelect : function( speed ){ + hideSelector : function( speed ){ speed = ( speed !== undefined )?( speed ):( this.fxSpeed ); // reverse the process from showSelect this.selectable = false; this.trigger( 'selectable', false, this ); - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-selector' ).animate({ width: '0px' }, speed, function(){ - $( this ).hide(); - next(); + + if( speed ){ + this.$el.queue( 'fx', function( next ){ + $( this ).find( '.dataset-title-bar' ).show().css({ 'margin-left' : '0' }); + $( this ).find( '.dataset-selector' ).animate({ width: '0px' }, speed, function(){ + $( this ).hide(); + next(); + }); }); - }); - this.$el.queue( 'fx', function( next ){ - $( this ).find( '.dataset-primary-actions' ).fadeIn( speed, next ); - }); + this.$el.queue( 'fx', function( next ){ + $( this ).find( '.dataset-primary-actions' ).fadeIn( speed, next ); + }); + + // no animation + } else { + $( this ).find( '.dataset-selector' ).css({ width : '0px' }).hide(); + $( this ).find( '.dataset-primary-actions' ).show(); + } + }, + + toggleSelector : function( speed ){ + if( !this.$el.find( '.dataset-selector' ).is( ':visible' ) ){ + this.showSelector( speed ); + } else { + this.hideSelector( speed ); + } }, /** event handler for selection (also programmatic selection) - * @param {boolean} selected T/F select/de-select this hda */ - select : function( event, selected ){ - // do nothing if selected is passed and selector already in desired state - if( selected !== undefined && selected === this.selected ){ return false; } + select : function( event ){ // switch icon, set selected, and trigger event - this.$el.find( '.dataset-selector span' ).toggleClass( 'fa-square-o fa-check-square-o' ); - this.selected = !this.selected; - this.trigger( ( this.selected )?( 'selected' ):( 'de-selected' ), this ); + this.$el.find( '.dataset-selector span' ) + .removeClass( 'fa-square-o' ).addClass( 'fa-check-square-o' ); + if( !this.selected ){ + this.trigger( 'selected', this ); + this.selected = true; + } return false; }, + /** event handler for clearing selection (also programmatic deselection) + */ + deselect : function( event ){ + // switch icon, set selected, and trigger event + this.$el.find( '.dataset-selector span' ) + .removeClass( 'fa-check-square-o' ).addClass( 'fa-square-o' ); + if( this.selected ){ + this.trigger( 'de-selected', this ); + this.selected = false; + } + return false; + }, + + toggleSelect : function( event ){ + if( this.selected ){ + this.deselect( event ); + } else { + this.select( event ); + } + }, + // ......................................................................... removal /** Remove this view's html from the DOM and remove all event listeners. * @param {Function} callback an optional function called when removal is done diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -111,6 +111,9 @@ this.trigger( 'state:ready', currModel, newState, this.previous( 'state' ) ); } }); + this.on( 'change', function(){ + console.debug( 'change', arguments ); + }); }, // ........................................................................ common queries @@ -172,26 +175,70 @@ /** save this HDA, _Mark_ing it as deleted (just a flag) */ 'delete' : function _delete( options ){ + if( this.get( 'deleted' ) ){ return jQuery.when(); } return this.save( { deleted: true }, options ); }, /** save this HDA, _Mark_ing it as undeleted */ undelete : function _undelete( options ){ + if( !this.get( 'deleted' ) || this.get( 'purged' ) ){ return jQuery.when(); } return this.save( { deleted: false }, options ); }, /** save this HDA as not visible */ hide : function _hide( options ){ + if( !this.get( 'visible' ) ){ return jQuery.when(); } return this.save( { visible: false }, options ); }, /** save this HDA as visible */ unhide : function _uhide( options ){ + if( this.get( 'visible' ) ){ return jQuery.when(); } return this.save( { visible: true }, options ); }, /** purge this HDA and remove the underlying dataset file from the server's fs */ //TODO: use, override model.destroy, HDA.delete({ purge: true }) purge : function _purge( options ){ + if( this.get( 'purged' ) ){ return jQuery.when(); } options = options || {}; + //var hda = this, + // //xhr = jQuery.ajax( this.url() + '?' + jQuery.param({ purge: true }), _.extend({ + // xhr = jQuery.ajax( this.url(), _.extend({ + // type : 'DELETE', + // data : { + // purge : true + // } + // }, options )); + // + //xhr.done( function( response ){ + // console.debug( 'response', response ); + // //hda.set({ deleted: true, purged: true }); + // hda.set( response ); + //}); + //return xhr; + + ////TODO: ideally this would be a DELETE call to the api + //// using purge async for now + //var hda = this, + // xhr = jQuery.ajax( options ); + //xhr.done( function( message, status, responseObj ){ + // hda.set( 'purged', true ); + //}); + //xhr.fail( function( xhr, status, message ){ + // // Exception messages are hidden within error page including: '...not allowed in this Galaxy instance.' + // // unbury and re-add to xhr + // var error = _l( "Unable to purge this dataset" ); + // var messageBuriedInUnfortunatelyFormattedError = ( 'Removal of datasets by users ' + // + 'is not allowed in this Galaxy instance' ); + // if( xhr.responseJSON && xhr.responseJSON.error ){ + // error = xhr.responseJSON.error; + // } else if( xhr.responseText.indexOf( messageBuriedInUnfortunatelyFormattedError ) !== -1 ){ + // error = messageBuriedInUnfortunatelyFormattedError; + // } + // xhr.responseText = error; + // hda.trigger( 'error', hda, xhr, options, _l( error ), { error: error } ); + //}); + //return xhr; + options.url = galaxy_config.root + 'datasets/' + this.get( 'id' ) + '/purge_async'; //TODO: ideally this would be a DELETE call to the api @@ -199,12 +246,12 @@ var hda = this, xhr = jQuery.ajax( options ); xhr.done( function( message, status, responseObj ){ - hda.set( 'purged', true ); + hda.set({ deleted: true, purged: true }); }); xhr.fail( function( xhr, status, message ){ // Exception messages are hidden within error page including: '...not allowed in this Galaxy instance.' // unbury and re-add to xhr - var error = _l( "Unable to purge this dataset" ); + var error = _l( "Unable to purge dataset" ); var messageBuriedInUnfortunatelyFormattedError = ( 'Removal of datasets by users ' + 'is not allowed in this Galaxy instance' ); if( xhr.responseJSON && xhr.responseJSON.error ){ @@ -215,6 +262,7 @@ xhr.responseText = error; hda.trigger( 'error', hda, xhr, options, _l( error ), { error: error } ); }); + return xhr; }, // ........................................................................ sorting/filtering @@ -489,6 +537,45 @@ return this.fetch( options ); }, + /** using a queue, perform hdaModelAjaxFn on each of the hdas in this collection */ + ajaxQueue : function( hdaAjaxFn, options ){ + var deferred = jQuery.Deferred(), + startingLength = this.length, + responses = []; + + if( !startingLength ){ + console.debug( 'no hdas in collection' ); + deferred.resolve([]); + return deferred; + } + + // use reverse order (stylistic choice) + var ajaxFns = this.chain().reverse().map( function( hda, i ){ + console.debug( 'adding:', hda, i, hdaAjaxFn ); + return function(){ + var xhr = hdaAjaxFn.call( hda, options ); + // if successful, notify using the deferred to allow tracking progress + xhr.done( function( response ){ + deferred.notify({ curr: i, total: startingLength, response: response, model: hda }); + }); + // (regardless of previous error or success) if not last ajax call, shift and call the next + // if last fn, resolve deferred + xhr.always( function( response ){ + responses.push( response ); + if( ajaxFns.length ){ + ajaxFns.shift()(); + } else { + deferred.resolve( responses ); + } + }); + }; + }).value(); + // start the queue + ajaxFns.shift()(); + + return deferred; + }, + // ........................................................................ sorting/filtering /** return a new collection of HDAs whose attributes contain the substring matchesWhat */ matches : function( matchesWhat ){ diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/mvc/history/history-panel.js --- a/static/scripts/mvc/history/history-panel.js +++ b/static/scripts/mvc/history/history-panel.js @@ -1,8 +1,9 @@ define([ "mvc/history/history-model", + "mvc/dataset/hda-model", "mvc/dataset/hda-base", "mvc/dataset/hda-edit" -], function( historyModel, hdaBase, hdaEdit ){ +], function( historyModel, hdaModel, hdaBase, hdaEdit ){ // ============================================================================ @@ -119,6 +120,12 @@ /** filters for displaying hdas */ this.filters = []; +//TODO: move to storage and persist + /** is the panel currently showing the search/filter controls? */ + this.searching = attributes.searching || false; + /** is the panel currently showing the dataset selection controls? */ + this.selecting = attributes.selecting || false; + // ---- handle models passed on init if( this.model ){ this._setUpWebStorage( attributes.initiallyExpanded, attributes.show_deleted, attributes.show_hidden ); @@ -372,15 +379,6 @@ return this; }, - /** alias to the model. Updates the hda list only (not the history) */ - refreshHdas : function( detailIds, options ){ - if( this.model ){ - return this.model.refresh( detailIds, options ); - } - // may have callbacks - so return an empty promise - return $.when(); - }, - // ------------------------------------------------------------------------ browser stored prefs /** Set up client side storage. Currently PersistanStorage keyed under 'HistoryPanel.<id>' * @param {Object} initiallyExpanded @@ -485,110 +483,6 @@ }, - // ------------------------------------------------------------------------ adding/removing hda sub-views - /** Add an hda view to the panel for the given hda - * @param {HistoryDatasetAssociation} hda - */ - addHdaView : function( hda ){ - this.log( 'add.' + this, hda ); - var panel = this; - - // don't add the view if it wouldn't be visible accrd. to current settings - if( !hda.isVisible( this.storage.get( 'show_deleted' ), this.storage.get( 'show_hidden' ) ) ){ - return; - } - - // create and prepend to current el, if it was empty fadeout the emptyMsg first - $({}).queue([ - function fadeOutEmptyMsg( next ){ - var $emptyMsg = panel.$el.find( panel.emptyMsgSelector ); - if( $emptyMsg.is( ':visible' ) ){ - $emptyMsg.fadeOut( panel.fxSpeed, next ); - } else { - next(); - } - }, - function createAndPrepend( next ){ - panel.scrollToTop(); - var $whereTo = panel.$el.find( panel.datasetsSelector ); - panel.createHdaView( hda ).$el.hide().prependTo( $whereTo ).slideDown( panel.fxSpeed ); - } - ]); - }, - - /** Create an HDA view for the given HDA (but leave attachment for addHdaView above) - * @param {HistoryDatasetAssociation} hda - */ - createHdaView : function( hda ){ - var hdaId = hda.get( 'id' ), - expanded = this.storage.get( 'expandedHdas' )[ hdaId ], - hdaView = new this.HDAView({ - model : hda, - expanded : expanded, - hasUser : this.model.hasUser(), - logger : this.logger - }); - this._setUpHdaListeners( hdaView ); - this.hdaViews[ hdaId ] = hdaView; - return hdaView.render(); - }, - - /** Set up HistoryPanel listeners for HDAView events. Currently binds: - * HDAView#body-visible, HDAView#body-hidden to store expanded states - * @param {HDAView} hdaView HDAView (base or edit) to listen to - */ - _setUpHdaListeners : function( hdaView ){ - var historyView = this; - // maintain a list of hdas whose bodies are expanded - hdaView.on( 'body-expanded', function( id ){ - historyView.storage.addExpandedHda( id ); - }); - hdaView.on( 'body-collapsed', function( id ){ - historyView.storage.removeExpandedHda( id ); - }); -//TODO: remove? - hdaView.on( 'error', function( model, xhr, options, msg ){ - historyView.errorHandler( model, xhr, options, msg ); - }); - }, - - /** If this hda is deleted and we're not showing deleted hdas, remove the view - * @param {HistoryDataAssociation} the hda to check - */ - handleHdaDeletionChange : function( hda ){ - if( hda.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){ - this.removeHdaView( this.hdaViews[ hda.id ] ); - } // otherwise, the hdaView rendering should handle it - }, - - /** If this hda is hidden and we're not showing hidden hdas, remove the view - * @param {HistoryDataAssociation} the hda to check - */ - handleHdaVisibleChange : function( hda ){ - if( hda.hidden() && !this.storage.get( 'show_hidden' ) ){ - this.removeHdaView( this.hdaViews[ hda.id ] ); - } // otherwise, the hdaView rendering should handle it - }, - - /** Remove a view from the panel and if the panel is now empty, re-render - * @param {Int} the id of the hdaView to remove - */ - removeHdaView : function( hdaView ){ - if( !hdaView ){ return; } - - var panel = this; - hdaView.$el.fadeOut( panel.fxSpeed, function(){ - hdaView.off(); - hdaView.remove(); - delete panel.hdaViews[ hdaView.model.id ]; - if( _.isEmpty( panel.hdaViews ) ){ - panel.$el.find( panel.emptyMsgSelector ).fadeIn( panel.fxSpeed, function(){ - panel.trigger( 'empty-history', panel ); - }); - } - }); - }, - // ------------------------------------------------------------------------ panel rendering /** Render urls, historyPanel body, and hdas (if any are shown) * @fires: rendered when the panel is attached and fully visible @@ -664,12 +558,10 @@ this._renderTags( $newRender ); this._renderAnnotation( $newRender ); } - // button for opening search - faIconButton({ - title : _l( 'Search datasets' ), - classes : 'history-search-btn', - faIcon : 'fa-search' - }).prependTo( $newRender.find( '.history-secondary-actions' ) ); + // search and select available to both anon/logged-in users + //$newRender.find( '.history-secondary-actions' ).prepend( this._renderSelectButton() ); + //$newRender.find( '.history-dataset-actions' ).toggle( this.selecting ); + $newRender.find( '.history-secondary-actions' ).prepend( this._renderSearchButton() ); this._setUpBehaviours( $newRender ); @@ -702,6 +594,22 @@ }).appendTo( $where.find( '.history-secondary-actions' ) ) }); }, + /** button for opening search */ + _renderSearchButton : function( $where ){ + return faIconButton({ + title : _l( 'Search datasets' ), + classes : 'history-search-btn', + faIcon : 'fa-search' + }); + }, + /** button for starting select mode */ + _renderSelectButton : function( $where ){ + return faIconButton({ + title : _l( 'Operations on multiple datasets' ), + classes : 'history-select-btn', + faIcon : 'fa-check-square-o' + }); + }, /** Set up HistoryPanel js/widget behaviours */ _setUpBehaviours : function( $where ){ @@ -722,6 +630,159 @@ }); } }); + this._setUpDatasetActionsPopup( $where ); + }, + + _setUpDatasetActionsPopup : function( $where ){ + var panel = this; + ( new PopupMenu( $where.find( '.history-dataset-action-popup-btn' ), [ + { + html: _l( 'Hide datasets' ), func: function(){ + var action = hdaModel.HistoryDatasetAssociation.prototype.hide; + panel.getSelectedHdaCollection().ajaxQueue( action ); + } + }, + { + html: _l( 'Unhide datasets' ), func: function(){ + var action = hdaModel.HistoryDatasetAssociation.prototype.unhide; + panel.getSelectedHdaCollection().ajaxQueue( action ); + } + }, + { + html: _l( 'Delete datasets' ), func: function(){ + var action = hdaModel.HistoryDatasetAssociation.prototype['delete']; + panel.getSelectedHdaCollection().ajaxQueue( action ); + } + }, + { + html: _l( 'Undelete datasets' ), func: function(){ + var action = hdaModel.HistoryDatasetAssociation.prototype.undelete; + panel.getSelectedHdaCollection().ajaxQueue( action ); + } + }, + { + html: _l( 'Permanently delete datasets' ), func: function(){ + if( confirm( _l( 'This will permanently remove the data in your datasets. Are you sure?' ) ) ){ + var action = hdaModel.HistoryDatasetAssociation.prototype.purge; + panel.getSelectedHdaCollection().ajaxQueue( action ); + } + } + } + ])); + }, + + // ------------------------------------------------------------------------ hda sub-views + /** alias to the model. Updates the hda list only (not the history) */ + refreshHdas : function( detailIds, options ){ + if( this.model ){ + return this.model.refresh( detailIds, options ); + } + // may have callbacks - so return an empty promise + return $.when(); + }, + + /** Add an hda view to the panel for the given hda + * @param {HistoryDatasetAssociation} hda + */ + addHdaView : function( hda ){ + this.log( 'add.' + this, hda ); + var panel = this; + + // don't add the view if it wouldn't be visible accrd. to current settings + if( !hda.isVisible( this.storage.get( 'show_deleted' ), this.storage.get( 'show_hidden' ) ) ){ + return; + } + + // create and prepend to current el, if it was empty fadeout the emptyMsg first + $({}).queue([ + function fadeOutEmptyMsg( next ){ + var $emptyMsg = panel.$el.find( panel.emptyMsgSelector ); + if( $emptyMsg.is( ':visible' ) ){ + $emptyMsg.fadeOut( panel.fxSpeed, next ); + } else { + next(); + } + }, + function createAndPrepend( next ){ + panel.scrollToTop(); + var $whereTo = panel.$el.find( panel.datasetsSelector ); + panel.createHdaView( hda ).$el.hide().prependTo( $whereTo ).slideDown( panel.fxSpeed ); + } + ]); + }, + + /** Create an HDA view for the given HDA (but leave attachment for addHdaView above) + * @param {HistoryDatasetAssociation} hda + */ + createHdaView : function( hda ){ + var hdaId = hda.get( 'id' ), + expanded = this.storage.get( 'expandedHdas' )[ hdaId ], + hdaView = new this.HDAView({ + model : hda, + expanded : expanded, + selectable : this.selecting, + hasUser : this.model.hasUser(), + logger : this.logger + }); + this._setUpHdaListeners( hdaView ); + this.hdaViews[ hdaId ] = hdaView; + return hdaView.render(); + }, + + /** Set up HistoryPanel listeners for HDAView events. Currently binds: + * HDAView#body-visible, HDAView#body-hidden to store expanded states + * @param {HDAView} hdaView HDAView (base or edit) to listen to + */ + _setUpHdaListeners : function( hdaView ){ + var historyView = this; + // maintain a list of hdas whose bodies are expanded + hdaView.on( 'body-expanded', function( id ){ + historyView.storage.addExpandedHda( id ); + }); + hdaView.on( 'body-collapsed', function( id ){ + historyView.storage.removeExpandedHda( id ); + }); +//TODO: remove? + hdaView.on( 'error', function( model, xhr, options, msg ){ + historyView.errorHandler( model, xhr, options, msg ); + }); + }, + + /** If this hda is deleted and we're not showing deleted hdas, remove the view + * @param {HistoryDataAssociation} the hda to check + */ + handleHdaDeletionChange : function( hda ){ + if( hda.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){ + this.removeHdaView( this.hdaViews[ hda.id ] ); + } // otherwise, the hdaView rendering should handle it + }, + + /** If this hda is hidden and we're not showing hidden hdas, remove the view + * @param {HistoryDataAssociation} the hda to check + */ + handleHdaVisibleChange : function( hda ){ + if( hda.hidden() && !this.storage.get( 'show_hidden' ) ){ + this.removeHdaView( this.hdaViews[ hda.id ] ); + } // otherwise, the hdaView rendering should handle it + }, + + /** Remove a view from the panel and if the panel is now empty, re-render + * @param {Int} the id of the hdaView to remove + */ + removeHdaView : function( hdaView ){ + if( !hdaView ){ return; } + + var panel = this; + hdaView.$el.fadeOut( panel.fxSpeed, function(){ + hdaView.off(); + hdaView.remove(); + delete panel.hdaViews[ hdaView.model.id ]; + if( _.isEmpty( panel.hdaViews ) ){ + panel.$el.find( panel.emptyMsgSelector ).fadeIn( panel.fxSpeed, function(){ + panel.trigger( 'empty-history', panel ); + }); + } + }); }, /** Set up/render a view for each HDA to be shown, init with model and listeners. @@ -764,7 +825,9 @@ // allow (error) messages to be clicked away //TODO: switch to common close (X) idiom 'click .message-container' : 'clearMessages', - 'click .history-search-btn' : 'toggleSearchControls' + 'click .history-search-btn' : 'toggleSearchControls', + 'click .history-select-btn' : function( e ){ this.toggleSelect( this.fxSpeed ); }, + 'click .history-select-all-datasets-btn' : 'selectAllDatasets' }, /** Update the history size display (curr. upper right of panel). @@ -789,7 +852,7 @@ */ toggleShowDeleted : function(){ this.storage.set( 'show_deleted', !this.storage.get( 'show_deleted' ) ); - this.render(); + this.renderHdas(); return this.storage.get( 'show_deleted' ); }, @@ -800,7 +863,7 @@ */ toggleShowHidden : function(){ this.storage.set( 'show_hidden', !this.storage.get( 'show_hidden' ) ); - this.render(); + this.renderHdas(); return this.storage.get( 'show_hidden' ); }, @@ -852,30 +915,70 @@ } $searchInput.slideToggle( this.fxSpeed, function(){ if( $( this ).is( ':visible' ) ){ + this.searching = true; $( this ).find( 'input' ).focus(); + } else { + this.searching = false; } }); }, // ........................................................................ multi-select of hdas - showSelect : function( speed ){ + showSelectors : function( speed ){ + this.selecting = true; + this.$el.find( '.history-dataset-actions' ).slideDown( speed ); _.each( this.hdaViews, function( view ){ - view.showSelect( speed ); + view.showSelector( speed ); }); }, - hideSelect : function( speed ){ + hideSelectors : function( speed ){ + this.selecting = false; + this.$el.find( '.history-dataset-actions' ).slideUp( speed ); _.each( this.hdaViews, function( view ){ - view.hideSelect( speed ); + view.hideSelector( speed ); }); }, + toggleSelect : function( speed ){ + if( !this.selecting ){ + this.showSelectors( speed ); + } else { + this.hideSelectors( speed ); + } + }, + + selectAllDatasets : function( event ){ + var $selectBtn = this.$el.find( '.history-select-all-datasets-btn' ); + currMode = $selectBtn.data( 'mode' ); + if( currMode === 'select' ){ + _.each( this.hdaViews, function( view ){ + view.select( event ); + }); + $selectBtn.data( 'mode', 'deselect' ); + $selectBtn.text( _l( 'De-select all' ) ); + + } else if( currMode === 'deselect' ){ + _.each( this.hdaViews, function( view ){ + view.deselect( event ); + }); + $selectBtn.data( 'mode', 'select' ); + $selectBtn.text( _l( 'Select all' ) ); + } + }, + getSelectedHdaViews : function(){ return _.filter( this.hdaViews, function( v ){ return v.selected; }); }, + getSelectedHdaCollection : function(){ + return new hdaModel.HDACollection( _.map( this.getSelectedHdaViews(), function( hdaView ){ + return hdaView.model; + }), { historyId: this.model.id }); + }, + // ........................................................................ loading indicator /** hide the panel and display a loading indicator (in the panel's parent) when history model's are switched */ showLoadingIndicator : function( msg, speed, callback ){ diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/packed/mvc/dataset/hda-base.js --- a/static/scripts/packed/mvc/dataset/hda-base.js +++ b/static/scripts/packed/mvc/dataset/hda-base.js @@ -1,1 +1,1 @@ -define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.selectable=false;this.selected=false;this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}if(this.selectable){this.showSelect()}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:"galaxy_main",classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"select"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelect:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);var d=this,c=32;this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().css({height:$(this).find(".dataset-title-bar").innerHeight()}).animate({width:c},e,f);d.selectable=true;d.trigger("selectable",true,d)})},hideSelect:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);this.$el.queue("fx",function(d){$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})},select:function(d,c){if(c!==undefined&&c===this.selected){return false}this.$el.find(".dataset-selector span").toggleClass("fa-square-o fa-check-square-o");this.selected=!this.selected;this.trigger((this.selected)?("selected"):("de-selected"),this);return false},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}}); \ No newline at end of file +define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.selectable=c.selectable||false;this.selected=c.selected||false;this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());if(this.selectable){this.showSelector(0)}f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:"galaxy_main",classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelector:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);if(this.selected){this.select(null,true)}var d=this,c=32;if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().animate({width:c},e,f);$(this).find(".dataset-title-bar").animate({"margin-left":c},e,f);d.selectable=true;d.trigger("selectable",true,d)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:c});this.$el.find(".dataset-title-bar").show().css({"margin-left":c});d.selectable=true;d.trigger("selectable",true,d)}},hideSelector:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(c){this.$el.queue("fx",function(d){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(c){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(c)}else{this.hideSelector(c)}},select:function(c){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(c){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(c){if(this.selected){this.deselect(c)}else{this.select(c)}},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}}); \ No newline at end of file diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/packed/mvc/dataset/hda-model.js --- a/static/scripts/packed/mvc/dataset/hda-model.js +++ b/static/scripts/packed/mvc/dataset/hda-model.js @@ -1,1 +1,1 @@ -define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:null},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){return this.save({deleted:true},h)},undelete:function a(h){return this.save({deleted:false},h)},hide:function b(h){return this.save({visible:false},h)},unhide:function g(h){return this.save({visible:true},h)},purge:function f(h){h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set("purged",true)});j.fail(function(o,k,n){var l=_l("Unable to purge this dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})})},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}}); \ No newline at end of file +define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:null},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}});this.on("change",function(){console.debug("change",arguments)})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){console.debug("no hdas in collection");i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){console.debug("adding:",o,n,k);return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}}); \ No newline at end of file diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/packed/mvc/history/history-panel.js --- a/static/scripts/packed/mvc/history/history-panel.js +++ b/static/scripts/packed/mvc/history/history-panel.js @@ -1,1 +1,1 @@ -define(["mvc/history/history-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(f,b,a){var c=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(g){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([g],[true])))},removeExpandedHda:function(g){this.save("expandedHdas",_.omit(this.get("expandedHdas"),g))},toString:function(){return"HistoryPanelPrefs("+this.id+")"}});c.historyStorageKey=function e(g){if(!g){throw new Error("HistoryPanelPrefs.historyStorageKey needs valid id: "+g)}return("history:"+g)};var d=Backbone.View.extend(LoggableMixin).extend({HDAView:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(g){g=g||{};if(g.logger){this.logger=g.logger}this.log(this+".initialize:",g);this._setUpListeners();this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];if(this.model){this._setUpWebStorage(g.initiallyExpanded,g.show_deleted,g.show_hidden);this._setUpModelEventHandlers()}if(g.onready){g.onready.call(this)}},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(g){this.log(this+"",arguments)},this)}},errorHandler:function(i,l,h,k,j){var g=this._parseErrorMessage(i,l,h,k,j);if(l&&l.status===0&&l.readyState===0){}else{if(l&&l.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",g.message,g.details)})}else{this.displayMessage("error",g.message,g.details)}}}},_parseErrorMessage:function(j,n,i,m,l){var h=Galaxy.currUser,g={message:this._bePolite(m),details:{user:(h instanceof User)?(h.toJSON()):(h+""),source:(j instanceof Backbone.Model)?(j.toJSON()):(j+""),xhr:n,options:(n)?(_.omit(i,"xhr")):(i)}};_.extend(g.details,l||{});if(n&&_.isFunction(n.getAllResponseHeaders)){var k=n.getAllResponseHeaders();k=_.compact(k.split("\n"));k=_.map(k,function(o){return o.split(": ")});g.details.xhr.responseHeaders=_.object(k)}return g},_bePolite:function(g){g=g||_l("An error occurred while getting updates from the server");return g+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(h){var g=this;return this.loadHistoryWithHDADetails("current",h).then(function(j,i){g.trigger("current-history",g)})},switchToHistory:function(j,i){var g=this,h=function(){return jQuery.post(galaxy_config.root+"api/histories/"+j+"/set_as_current")};return this.loadHistoryWithHDADetails(j,i,h).then(function(l,k){g.trigger("switched-history",g)})},createNewHistory:function(i){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var g=this,h=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,i,h).then(function(k,j){g.trigger("new-history",g)})},loadHistoryWithHDADetails:function(j,i,h,l){var g=this,k=function(m){return g.getExpandedHdaIds(m.id)};return this.loadHistory(j,i,h,l,k)},loadHistory:function(j,i,h,m,k){this.trigger("loading-history",this);i=i||{};var g=this;var l=f.History.getHistoryData(j,{historyFn:h,hdaFn:m,hdaDetailIds:i.initiallyExpanded||k});return this._loadHistoryFromXHR(l,i).fail(function(p,n,o){g.trigger("error",g,p,i,_l("An error was encountered while "+n),{historyId:j,history:o||{}})}).always(function(){g.trigger("loading-done",g)})},_loadHistoryFromXHR:function(i,h){var g=this;i.then(function(j,k){g.setModel(j,k,h)});i.fail(function(k,j){g.render()});return i},setModel:function(i,g,h){h=h||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){i.user=Galaxy.currUser.toJSON()}this.model=new f.History(i,g,h);this._setUpWebStorage(h.initiallyExpanded,h.show_deleted,h.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},refreshHdas:function(h,g){if(this.model){return this.model.refresh(h,g)}return $.when()},_setUpWebStorage:function(h,g,i){this.storage=new c({id:c.historyStorageKey(this.model.get("id"))});if(_.isObject(h)){this.storage.set("exandedHdas",h)}if(_.isBoolean(g)){this.storage.set("show_deleted",g)}if(_.isBoolean(i)){this.storage.set("show_hidden",i)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var g in sessionStorage){if(g.indexOf("history:")===0){sessionStorage.removeItem(g)}}},getStoredOptions:function(h){if(!h||h==="current"){return(this.storage)?(this.storage.get()):({})}var g=sessionStorage.getItem(c.historyStorageKey(h));return(g===null)?({}):(JSON.parse(g))},getExpandedHdaIds:function(g){var h=this.getStoredOptions(g).expandedHdas;return((_.isEmpty(h))?([]):(_.keys(h)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(h,j,g,i){this.errorHandler(h,j,g,i)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this);this.model.hdas.on("state:ready",function(h,i,g){if((!h.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[h.id])}},this)},addHdaView:function(j){this.log("add."+this,j);var h=this;if(!j.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function i(l){var k=h.$el.find(h.emptyMsgSelector);if(k.is(":visible")){k.fadeOut(h.fxSpeed,l)}else{l()}},function g(l){h.scrollToTop();var k=h.$el.find(h.datasetsSelector);h.createHdaView(j).$el.hide().prependTo(k).slideDown(h.fxSpeed)}])},createHdaView:function(i){var h=i.get("id"),g=this.storage.get("expandedHdas")[h],j=new this.HDAView({model:i,expanded:g,hasUser:this.model.hasUser(),logger:this.logger});this._setUpHdaListeners(j);this.hdaViews[h]=j;return j.render()},_setUpHdaListeners:function(h){var g=this;h.on("body-expanded",function(i){g.storage.addExpandedHda(i)});h.on("body-collapsed",function(i){g.storage.removeExpandedHda(i)});h.on("error",function(j,l,i,k){g.errorHandler(j,l,i,k)})},handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$el.find(g.emptyMsgSelector).fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},render:function(i,j){i=(i===undefined)?(this.fxSpeed):(i);var g=this,h;if(this.model){h=this.renderModel()}else{h=this.renderWithoutModel()}$(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},renderWithoutModel:function(){var g=$("<div/>"),h=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return g.append(h)},renderModel:function(){var g=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){g.append(d.templates.anonHistoryPanel(this.model.toJSON()))}else{g.append(d.templates.historyPanel(this.model.toJSON()));this._renderTags(g);this._renderAnnotation(g)}faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"}).prependTo(g.find(".history-secondary-actions"));this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_setUpBehaviours:function(g){g=g||this.$el;g.find("[title]").tooltip({placement:"bottom"});if(!this.model||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){return}var h=this;g.find(".history-name").make_text_editable({on_finish:function(i){g.find(".history-name").text(i);h.model.save({name:i}).fail(function(){g.find(".history-name").text(h.model.previous("name"))})}})},renderHdas:function(i){i=i||this.$el;this.hdaViews={};var h=this,g=i.find(this.datasetsSelector),j=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);g.empty();if(j.length){j.each(function(k){g.prepend(h.createHdaView(k).$el)});i.find(this.emptyMsgSelector).hide()}else{i.find(this.emptyMsgSelector).show()}return this.hdaViews},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(g){g.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.render();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.render();return this.storage.get("show_hidden")},renderSearchControls:function(){var g=this;g.model.hdas.fetchAllDetails({silent:true});function i(j){g.searchFor=j;g.filters=[function(k){return k.matchesAll(g.searchFor)}];g.trigger("search:searching",j,g);g.renderHdas()}function h(){g.searchFor="";g.filters=[];g.trigger("search:clear",g);g.renderHdas()}return searchInput({initialVal:g.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onsearch:i,onclear:h}).addClass("history-search-controls").css("padding","0px 0px 8px 0px")},toggleSearchControls:function(){var g=this.$el.find(".history-search-controls");if(!g.size()){g=this.renderSearchControls().hide();this.$el.find(".history-title").before(g)}g.slideToggle(this.fxSpeed,function(){if($(this).is(":visible")){$(this).find("input").focus()}})},showSelect:function(g){_.each(this.hdaViews,function(h){h.showSelect(g)})},hideSelect:function(g){_.each(this.hdaViews,function(h){h.hideSelect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},showLoadingIndicator:function(h,g,i){g=(g!==undefined)?(g):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,i)}else{this.$el.fadeOut(g);this.indicator.show(h,g,i)}},hideLoadingIndicator:function(g,h){g=(g!==undefined)?(g):(this.fxSpeed);if(this.indicator){this.indicator.hide(g,h)}},displayMessage:function(l,m,k){var i=this;this.scrollToTop();var j=this.$el.find(this.msgsSelector),g=$("<div/>").addClass(l+"message").html(m);if(!_.isEmpty(k)){var h=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(i.messageToModalOptions(l,m,k));return false});g.append(" ",h)}return j.html(g)},messageToModalOptions:function(k,m,j){var g=this,l=$("<div/>"),i={title:"Details"};function h(n){n=_.omit(n,_.functions(n));return["<table>",_.map(n,function(p,o){p=(_.isObject(p))?(h(p)):(p);return'<tr><td style="vertical-align: top; color: grey">'+o+'</td><td style="padding-left: 8px">'+p+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(j)){i.body=l.append(h(j))}else{i.body=l.html(j)}i.buttons={Ok:function(){Galaxy.modal.hide();g.clearMessages()}};return i},clearMessages:function(){var g=this.$el.find(this.msgsSelector);g.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(g){this.$el.parent().scrollTop(g)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(h,i){if(!i){this.$el.parent().parent().scrollTop(h);return this}var g=window,j=this.$el.parent().parent(),l=$(g).innerHeight(),k=(l/2)-(i/2);$(j).scrollTop(h-k);return this},scrollToId:function(h){if((!h)||(!this.hdaViews[h])){return this}var g=this.hdaViews[h].$el;this.scrollIntoView(g.offset().top,g.outerHeight());return this},scrollToHid:function(g){var h=this.model.hdas.getByHid(g);if(!h){return this}return this.scrollToId(h.id)},connectToQuotaMeter:function(g){if(!g){return this}this.listenTo(g,"quota:over",this.showQuotaMessage);this.listenTo(g,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(g&&g.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var g=this.$el.find(".quota-message");if(g.is(":hidden")){g.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var g=this.$el.find(".quota-message");if(!g.is(":hidden")){g.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(g){if(!g){return this}this.on("new-storage",function(i,h){if(g&&i){g.findItemByHtml(_l("Include Deleted Datasets")).checked=i.get("show_deleted");g.findItemByHtml(_l("Include Hidden Datasets")).checked=i.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});d.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:d}}); \ No newline at end of file +define(["mvc/history/history-model","mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(g,d,b,a){var c=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(h){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([h],[true])))},removeExpandedHda:function(h){this.save("expandedHdas",_.omit(this.get("expandedHdas"),h))},toString:function(){return"HistoryPanelPrefs("+this.id+")"}});c.historyStorageKey=function f(h){if(!h){throw new Error("HistoryPanelPrefs.historyStorageKey needs valid id: "+h)}return("history:"+h)};var e=Backbone.View.extend(LoggableMixin).extend({HDAView:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(h){h=h||{};if(h.logger){this.logger=h.logger}this.log(this+".initialize:",h);this._setUpListeners();this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searching=h.searching||false;this.selecting=h.selecting||false;if(this.model){this._setUpWebStorage(h.initiallyExpanded,h.show_deleted,h.show_hidden);this._setUpModelEventHandlers()}if(h.onready){h.onready.call(this)}},_setUpListeners:function(){this.on("error",function(i,l,h,k,j){this.errorHandler(i,l,h,k,j)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(h){this.log(this+"",arguments)},this)}},errorHandler:function(j,m,i,l,k){var h=this._parseErrorMessage(j,m,i,l,k);if(m&&m.status===0&&m.readyState===0){}else{if(m&&m.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",h.message,h.details)})}else{this.displayMessage("error",h.message,h.details)}}}},_parseErrorMessage:function(k,o,j,n,m){var i=Galaxy.currUser,h={message:this._bePolite(n),details:{user:(i instanceof User)?(i.toJSON()):(i+""),source:(k instanceof Backbone.Model)?(k.toJSON()):(k+""),xhr:o,options:(o)?(_.omit(j,"xhr")):(j)}};_.extend(h.details,m||{});if(o&&_.isFunction(o.getAllResponseHeaders)){var l=o.getAllResponseHeaders();l=_.compact(l.split("\n"));l=_.map(l,function(p){return p.split(": ")});h.details.xhr.responseHeaders=_.object(l)}return h},_bePolite:function(h){h=h||_l("An error occurred while getting updates from the server");return h+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(i){var h=this;return this.loadHistoryWithHDADetails("current",i).then(function(k,j){h.trigger("current-history",h)})},switchToHistory:function(k,j){var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories/"+k+"/set_as_current")};return this.loadHistoryWithHDADetails(k,j,i).then(function(m,l){h.trigger("switched-history",h)})},createNewHistory:function(j){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,j,i).then(function(l,k){h.trigger("new-history",h)})},loadHistoryWithHDADetails:function(k,j,i,m){var h=this,l=function(n){return h.getExpandedHdaIds(n.id)};return this.loadHistory(k,j,i,m,l)},loadHistory:function(k,j,i,n,l){this.trigger("loading-history",this);j=j||{};var h=this;var m=g.History.getHistoryData(k,{historyFn:i,hdaFn:n,hdaDetailIds:j.initiallyExpanded||l});return this._loadHistoryFromXHR(m,j).fail(function(q,o,p){h.trigger("error",h,q,j,_l("An error was encountered while "+o),{historyId:k,history:p||{}})}).always(function(){h.trigger("loading-done",h)})},_loadHistoryFromXHR:function(j,i){var h=this;j.then(function(k,l){h.setModel(k,l,i)});j.fail(function(l,k){h.render()});return j},setModel:function(j,h,i){i=i||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){j.user=Galaxy.currUser.toJSON()}this.model=new g.History(j,h,i);this._setUpWebStorage(i.initiallyExpanded,i.show_deleted,i.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(i,h,j){this.storage=new c({id:c.historyStorageKey(this.model.get("id"))});if(_.isObject(i)){this.storage.set("exandedHdas",i)}if(_.isBoolean(h)){this.storage.set("show_deleted",h)}if(_.isBoolean(j)){this.storage.set("show_hidden",j)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var h in sessionStorage){if(h.indexOf("history:")===0){sessionStorage.removeItem(h)}}},getStoredOptions:function(i){if(!i||i==="current"){return(this.storage)?(this.storage.get()):({})}var h=sessionStorage.getItem(c.historyStorageKey(i));return(h===null)?({}):(JSON.parse(h))},getExpandedHdaIds:function(h){var i=this.getStoredOptions(h).expandedHdas;return((_.isEmpty(i))?([]):(_.keys(i)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(i,k,h,j){this.errorHandler(i,k,h,j)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(h){this.model.fetch()},this);this.model.hdas.on("state:ready",function(i,j,h){if((!i.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[i.id])}},this)},render:function(j,k){j=(j===undefined)?(this.fxSpeed):(j);var h=this,i;if(this.model){i=this.renderModel()}else{i=this.renderWithoutModel()}$(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},renderWithoutModel:function(){var h=$("<div/>"),i=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return h.append(i)},renderModel:function(){var h=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){h.append(e.templates.anonHistoryPanel(this.model.toJSON()))}else{h.append(e.templates.historyPanel(this.model.toJSON()));this._renderTags(h);this._renderAnnotation(h)}h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){this.tagsEditor=new TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){this.annotationEditor=new AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSearchButton:function(h){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_renderSelectButton:function(h){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;h.find("[title]").tooltip({placement:"bottom"});if(!this.model||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){return}var i=this;h.find(".history-name").make_text_editable({on_finish:function(j){h.find(".history-name").text(j);i.model.save({name:j}).fail(function(){h.find(".history-name").text(i.model.previous("name"))})}});this._setUpDatasetActionsPopup(h)},_setUpDatasetActionsPopup:function(h){var i=this;(new PopupMenu(h.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Unhide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Delete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Undelete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var j=d.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(j)}}}]))},refreshHdas:function(i,h){if(this.model){return this.model.refresh(i,h)}return $.when()},addHdaView:function(k){this.log("add."+this,k);var i=this;if(!k.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function j(m){var l=i.$el.find(i.emptyMsgSelector);if(l.is(":visible")){l.fadeOut(i.fxSpeed,m)}else{m()}},function h(m){i.scrollToTop();var l=i.$el.find(i.datasetsSelector);i.createHdaView(k).$el.hide().prependTo(l).slideDown(i.fxSpeed)}])},createHdaView:function(j){var i=j.get("id"),h=this.storage.get("expandedHdas")[i],k=new this.HDAView({model:j,expanded:h,selectable:this.selecting,hasUser:this.model.hasUser(),logger:this.logger});this._setUpHdaListeners(k);this.hdaViews[i]=k;return k.render()},_setUpHdaListeners:function(i){var h=this;i.on("body-expanded",function(j){h.storage.addExpandedHda(j)});i.on("body-collapsed",function(j){h.storage.removeExpandedHda(j)});i.on("error",function(k,m,j,l){h.errorHandler(k,m,j,l)})},handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.$el.find(h.emptyMsgSelector).fadeIn(h.fxSpeed,function(){h.trigger("empty-history",h)})}})},renderHdas:function(j){j=j||this.$el;this.hdaViews={};var i=this,h=j.find(this.datasetsSelector),k=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);h.empty();if(k.length){k.each(function(l){h.prepend(i.createHdaView(l).$el)});j.find(this.emptyMsgSelector).hide()}else{j.find(this.emptyMsgSelector).show()}return this.hdaViews},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls","click .history-select-btn":function(h){this.toggleSelect(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(h){h.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},renderSearchControls:function(){var h=this;h.model.hdas.fetchAllDetails({silent:true});function j(k){h.searchFor=k;h.filters=[function(l){return l.matchesAll(h.searchFor)}];h.trigger("search:searching",k,h);h.renderHdas()}function i(){h.searchFor="";h.filters=[];h.trigger("search:clear",h);h.renderHdas()}return searchInput({initialVal:h.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onsearch:j,onclear:i}).addClass("history-search-controls").css("padding","0px 0px 8px 0px")},toggleSearchControls:function(){var h=this.$el.find(".history-search-controls");if(!h.size()){h=this.renderSearchControls().hide();this.$el.find(".history-title").before(h)}h.slideToggle(this.fxSpeed,function(){if($(this).is(":visible")){this.searching=true;$(this).find("input").focus()}else{this.searching=false}})},showSelectors:function(h){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector(h)})},hideSelectors:function(h){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector(h)})},toggleSelect:function(h){if(!this.selecting){this.showSelectors(h)}else{this.hideSelectors(h)}},selectAllDatasets:function(i){var h=this.$el.find(".history-select-all-datasets-btn");currMode=h.data("mode");if(currMode==="select"){_.each(this.hdaViews,function(j){j.select(i)});h.data("mode","deselect");h.text(_l("De-select all"))}else{if(currMode==="deselect"){_.each(this.hdaViews,function(j){j.deselect(i)});h.data("mode","select");h.text(_l("Select all"))}}},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new d.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},showLoadingIndicator:function(i,h,j){h=(h!==undefined)?(h):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,j)}else{this.$el.fadeOut(h);this.indicator.show(i,h,j)}},hideLoadingIndicator:function(h,i){h=(h!==undefined)?(h):(this.fxSpeed);if(this.indicator){this.indicator.hide(h,i)}},displayMessage:function(m,n,l){var j=this;this.scrollToTop();var k=this.$el.find(this.msgsSelector),h=$("<div/>").addClass(m+"message").html(n);if(!_.isEmpty(l)){var i=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(j.messageToModalOptions(m,n,l));return false});h.append(" ",i)}return k.html(h)},messageToModalOptions:function(l,n,k){var h=this,m=$("<div/>"),j={title:"Details"};function i(o){o=_.omit(o,_.functions(o));return["<table>",_.map(o,function(q,p){q=(_.isObject(q))?(i(q)):(q);return'<tr><td style="vertical-align: top; color: grey">'+p+'</td><td style="padding-left: 8px">'+q+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(k)){j.body=m.append(i(k))}else{j.body=m.html(k)}j.buttons={Ok:function(){Galaxy.modal.hide();h.clearMessages()}};return j},clearMessages:function(){var h=this.$el.find(this.msgsSelector);h.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(h){this.$el.parent().scrollTop(h)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(i,j){if(!j){this.$el.parent().parent().scrollTop(i);return this}var h=window,k=this.$el.parent().parent(),m=$(h).innerHeight(),l=(m/2)-(j/2);$(k).scrollTop(i-l);return this},scrollToId:function(i){if((!i)||(!this.hdaViews[i])){return this}var h=this.hdaViews[i].$el;this.scrollIntoView(h.offset().top,h.outerHeight());return this},scrollToHid:function(h){var i=this.model.hdas.getByHid(h);if(!i){return this}return this.scrollToId(i.id)},connectToQuotaMeter:function(h){if(!h){return this}this.listenTo(h,"quota:over",this.showQuotaMessage);this.listenTo(h,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(h&&h.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var h=this.$el.find(".quota-message");if(h.is(":hidden")){h.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var h=this.$el.find(".quota-message");if(!h.is(":hidden")){h.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(h){if(!h){return this}this.on("new-storage",function(j,i){if(h&&j){h.findItemByHtml(_l("Include Deleted Datasets")).checked=j.get("show_deleted");h.findItemByHtml(_l("Include Hidden Datasets")).checked=j.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});e.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:e}}); \ No newline at end of file diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/packed/templates/compiled/history-templates.js --- a/static/scripts/packed/templates/compiled/history-templates.js +++ b/static/scripts/packed/templates/compiled/history-templates.js @@ -1,1 +1,1 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(g,r,p,k,z){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);z=z||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';if(B=p.body){B=B.call(D,{hash:{},data:C})}else{B=D.body;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return A}function m(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';B=p["if"].call(D,D.misc_blurb,{hash:{},inverse:o.noop,fn:o.program(4,l,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.data_type,{hash:{},inverse:o.noop,fn:o.program(6,j,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.metadata_dbkey,{hash:{},inverse:o.noop,fn:o.program(9,f,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.misc_info,{hash:{},inverse:o.noop,fn:o.program(12,x,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';B=p.unless.call(D,D.deleted,{hash:{},inverse:o.noop,fn:o.program(14,w,C),data:C});if(B||B===0){A+=B}A+="\n\n ";return A}function l(D,C){var A="",B;A+='\n <div class="dataset-blurb">\n <span class="value">';if(B=p.misc_blurb){B=B.call(D,{hash:{},data:C})}else{B=D.misc_blurb;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function j(E,D){var A="",C,B;A+='\n <div class="dataset-datatype">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(7,i,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">';if(C=p.data_type){C=C.call(E,{hash:{},data:D})}else{C=E.data_type;C=typeof C===e?C.apply(E):C}A+=d(C)+"</span>\n </div>\n ";return A}function i(B,A){return"format"}function f(E,D){var A="",C,B;A+='\n <div class="dataset-dbkey">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(10,y,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">\n ';if(C=p.metadata_dbkey){C=C.call(E,{hash:{},data:D})}else{C=E.metadata_dbkey;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </span>\n </div>\n ";return A}function y(B,A){return"database"}function x(D,C){var A="",B;A+='\n <div class="dataset-info">\n <span class="value">';if(B=p.misc_info){B=B.call(D,{hash:{},data:C})}else{B=D.misc_info;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function w(D,C){var A="",B;A+='\n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="dataset-display-applications">\n ';B=p.each.call(D,D.display_apps,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p.each.call(D,D.display_types,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-peek">\n ';B=p["if"].call(D,D.peek,{hash:{},inverse:o.noop,fn:o.program(19,s,C),data:C});if(B||B===0){A+=B}A+="\n </div>\n\n ";return A}function v(D,C){var A="",B;A+='\n <div class="display-application">\n <span class="display-application-location">';if(B=p.label){B=B.call(D,{hash:{},data:C})}else{B=D.label;B=typeof B===e?B.apply(D):B}A+=d(B)+'</span>\n <span class="display-application-links">\n ';B=p.each.call(D,D.links,{hash:{},inverse:o.noop,fn:o.program(16,u,C),data:C});if(B||B===0){A+=B}A+="\n </span>\n </div>\n ";return A}function u(E,D){var A="",C,B;A+='\n <a target="';if(C=p.target){C=C.call(E,{hash:{},data:D})}else{C=E.target;C=typeof C===e?C.apply(E):C}A+=d(C)+'" href="';if(C=p.href){C=C.call(E,{hash:{},data:D})}else{C=E.href;C=typeof C===e?C.apply(E):C}A+=d(C)+'">';B={hash:{},inverse:o.noop,fn:o.program(17,t,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="</a>\n ";return A}function t(C,B){var A;if(A=p.text){A=A.call(C,{hash:{},data:B})}else{A=C.text;A=typeof A===e?A.apply(C):A}return d(A)}function s(D,C){var A="",B;A+='\n <pre class="peek">';if(B=p.peek){B=B.call(D,{hash:{},data:C})}else{B=D.peek;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+="</pre>\n ";return A}q+='<div class="dataset-body">\n ';h=p["if"].call(r,r.body,{hash:{},inverse:o.program(3,m,z),fn:o.program(1,n,z),data:z});if(h||h===0){q+=h}q+="\n</div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-skeleton"]=b(function(f,r,p,k,w){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,f.helpers);w=w||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(B,A){var x="",z,y;x+='\n <div class="errormessagesmall">\n ';y={hash:{},inverse:o.noop,fn:o.program(2,m,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+=":\n ";y={hash:{},inverse:o.noop,fn:o.program(4,l,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </div>\n ";return x}function m(y,x){return"There was an error getting the data for this dataset"}function l(z,y){var x;if(x=p.error){x=x.call(z,{hash:{},data:y})}else{x=z.error;x=typeof x===e?x.apply(z):x}return d(x)}function j(A,z){var x="",y;x+="\n ";y=p["if"].call(A,A.purged,{hash:{},inverse:o.program(10,v,z),fn:o.program(7,i,z),data:z});if(y||y===0){x+=y}x+="\n ";return x}function i(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(8,g,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n\n ";return x}function g(y,x){return"This dataset has been deleted and removed from disk."}function v(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(11,u,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n \n Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it\n or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk\n </strong></div>\n ';return x}function u(y,x){return"This dataset has been deleted."}function t(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(14,s,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it\n </strong></div>\n ';return x}function s(y,x){return"This dataset has been hidden."}q+='<div class="dataset hda">\n <div class="dataset-warnings">\n ';h=p["if"].call(r,r.error,{hash:{},inverse:o.noop,fn:o.program(1,n,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p["if"].call(r,r.deleted,{hash:{},inverse:o.noop,fn:o.program(6,j,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p.unless.call(r,r.visible,{hash:{},inverse:o.noop,fn:o.program(13,t,w),data:w});if(h||h===0){q+=h}q+='\n </div>\n\n <div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>\n <div class="dataset-primary-actions"></div>\n <div class="dataset-title-bar clear">\n <span class="dataset-state-icon state-icon"></span>\n <div class="dataset-title">\n <span class="hda-hid">';if(h=p.hid){h=h.call(r,{hash:{},data:w})}else{h=r.hid;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n <span class="dataset-name">';if(h=p.name){h=h.call(r,{hash:{},data:w})}else{h=r.name;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n </div>\n </div>\n\n <div class="dataset-body"></div>\n</div>';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel-anon"]=b(function(g,r,p,k,u){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);u=u||{};var q="",i,f,o=this,e="function",c=p.blockHelperMissing,d=this.escapeExpression;function n(z,y){var v="",x,w;v+='\n <div class="history-name" title="';w={hash:{},inverse:o.noop,fn:o.program(2,m,y),data:y};if(x=p.local){x=x.call(z,w)}else{x=z.local;x=typeof x===e?x.apply(z):x}if(!p.local){x=c.call(z,x,w)}if(x||x===0){v+=x}v+='">\n ';if(x=p.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===e?x.apply(z):x}v+=d(x)+"\n </div>\n ";return v}function m(w,v){return"You must be logged in to edit your history name"}function l(y,x){var v="",w;v+='\n <div class="history-size">';if(w=p.nice_size){w=w.call(y,{hash:{},data:x})}else{w=y.nice_size;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function j(y,x){var v="",w;v+='\n \n <div class="';if(w=p.status){w=w.call(y,{hash:{},data:x})}else{w=y.status;w=typeof w===e?w.apply(y):w}v+=d(w)+'message">';if(w=p.message){w=w.call(y,{hash:{},data:x})}else{w=y.message;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function h(w,v){return"You are over your disk quota"}function t(w,v){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function s(w,v){return"Your history is empty. Click 'Get Data' on the left pane to start"}q+='<div class="history-controls">\n\n <div class="history-title">\n \n ';i=p["if"].call(r,r.name,{hash:{},inverse:o.noop,fn:o.program(1,n,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=p["if"].call(r,r.nice_size,{hash:{},inverse:o.noop,fn:o.program(4,l,u),data:u});if(i||i===0){q+=i}q+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n <div class="message-container">\n ';i=p["if"].call(r,r.message,{hash:{},inverse:o.noop,fn:o.program(6,j,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:o.noop,fn:o.program(8,h,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+=".\n ";f={hash:{},inverse:o.noop,fn:o.program(10,t,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+='.\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:o.noop,fn:o.program(12,s,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+="\n </div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,w){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);w=w||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(B,A){var x="",z,y;x+='\n <div class="history-name" title="';y={hash:{},inverse:p.noop,fn:p.program(2,n,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='">\n ';if(z=q.name){z=z.call(B,{hash:{},data:A})}else{z=B.name;z=typeof z===e?z.apply(B):z}x+=d(z)+"\n </div>\n ";return x}function n(y,x){return"Click to rename history"}function m(A,z){var x="",y;x+='\n <div class="history-size">';if(y=q.nice_size){y=y.call(A,{hash:{},data:z})}else{y=A.nice_size;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function k(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:p.noop,fn:p.program(7,j,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n ";return x}function j(y,x){return"You are currently viewing a deleted history!"}function g(A,z){var x="",y;x+='\n \n <div class="';if(y=q.status){y=y.call(A,{hash:{},data:z})}else{y=A.status;y=typeof y===e?y.apply(A):y}x+=d(y)+'message">';if(y=q.message){y=y.call(A,{hash:{},data:z})}else{y=A.message;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function v(y,x){return"You are over your disk quota"}function u(y,x){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function t(y,x){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,v,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,u,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(15,t,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})(); \ No newline at end of file +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-body"]=b(function(g,r,p,k,z){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);z=z||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';if(B=p.body){B=B.call(D,{hash:{},data:C})}else{B=D.body;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+='\n </div>\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';return A}function m(D,C){var A="",B;A+='\n <div class="dataset-summary">\n ';B=p["if"].call(D,D.misc_blurb,{hash:{},inverse:o.noop,fn:o.program(4,l,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.data_type,{hash:{},inverse:o.noop,fn:o.program(6,j,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.metadata_dbkey,{hash:{},inverse:o.noop,fn:o.program(9,f,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p["if"].call(D,D.misc_info,{hash:{},inverse:o.noop,fn:o.program(12,x,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-actions clear">\n <div class="left"></div>\n <div class="right"></div>\n </div>\n\n ';B=p.unless.call(D,D.deleted,{hash:{},inverse:o.noop,fn:o.program(14,w,C),data:C});if(B||B===0){A+=B}A+="\n\n ";return A}function l(D,C){var A="",B;A+='\n <div class="dataset-blurb">\n <span class="value">';if(B=p.misc_blurb){B=B.call(D,{hash:{},data:C})}else{B=D.misc_blurb;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function j(E,D){var A="",C,B;A+='\n <div class="dataset-datatype">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(7,i,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">';if(C=p.data_type){C=C.call(E,{hash:{},data:D})}else{C=E.data_type;C=typeof C===e?C.apply(E):C}A+=d(C)+"</span>\n </div>\n ";return A}function i(B,A){return"format"}function f(E,D){var A="",C,B;A+='\n <div class="dataset-dbkey">\n <label class="prompt">';B={hash:{},inverse:o.noop,fn:o.program(10,y,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+='</label>\n <span class="value">\n ';if(C=p.metadata_dbkey){C=C.call(E,{hash:{},data:D})}else{C=E.metadata_dbkey;C=typeof C===e?C.apply(E):C}A+=d(C)+"\n </span>\n </div>\n ";return A}function y(B,A){return"database"}function x(D,C){var A="",B;A+='\n <div class="dataset-info">\n <span class="value">';if(B=p.misc_info){B=B.call(D,{hash:{},data:C})}else{B=D.misc_info;B=typeof B===e?B.apply(D):B}A+=d(B)+"</span>\n </div>\n ";return A}function w(D,C){var A="",B;A+='\n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="dataset-display-applications">\n ';B=p.each.call(D,D.display_apps,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+="\n\n ";B=p.each.call(D,D.display_types,{hash:{},inverse:o.noop,fn:o.program(15,v,C),data:C});if(B||B===0){A+=B}A+='\n </div>\n\n <div class="dataset-peek">\n ';B=p["if"].call(D,D.peek,{hash:{},inverse:o.noop,fn:o.program(19,s,C),data:C});if(B||B===0){A+=B}A+="\n </div>\n\n ";return A}function v(D,C){var A="",B;A+='\n <div class="display-application">\n <span class="display-application-location">';if(B=p.label){B=B.call(D,{hash:{},data:C})}else{B=D.label;B=typeof B===e?B.apply(D):B}A+=d(B)+'</span>\n <span class="display-application-links">\n ';B=p.each.call(D,D.links,{hash:{},inverse:o.noop,fn:o.program(16,u,C),data:C});if(B||B===0){A+=B}A+="\n </span>\n </div>\n ";return A}function u(E,D){var A="",C,B;A+='\n <a target="';if(C=p.target){C=C.call(E,{hash:{},data:D})}else{C=E.target;C=typeof C===e?C.apply(E):C}A+=d(C)+'" href="';if(C=p.href){C=C.call(E,{hash:{},data:D})}else{C=E.href;C=typeof C===e?C.apply(E):C}A+=d(C)+'">';B={hash:{},inverse:o.noop,fn:o.program(17,t,D),data:D};if(C=p.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!p.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="</a>\n ";return A}function t(C,B){var A;if(A=p.text){A=A.call(C,{hash:{},data:B})}else{A=C.text;A=typeof A===e?A.apply(C):A}return d(A)}function s(D,C){var A="",B;A+='\n <pre class="peek">';if(B=p.peek){B=B.call(D,{hash:{},data:C})}else{B=D.peek;B=typeof B===e?B.apply(D):B}if(B||B===0){A+=B}A+="</pre>\n ";return A}q+='<div class="dataset-body">\n ';h=p["if"].call(r,r.body,{hash:{},inverse:o.program(3,m,z),fn:o.program(1,n,z),data:z});if(h||h===0){q+=h}q+="\n</div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-skeleton"]=b(function(f,r,p,k,w){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,f.helpers);w=w||{};var q="",h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(B,A){var x="",z,y;x+='\n <div class="errormessagesmall">\n ';y={hash:{},inverse:o.noop,fn:o.program(2,m,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+=":\n ";y={hash:{},inverse:o.noop,fn:o.program(4,l,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </div>\n ";return x}function m(y,x){return"There was an error getting the data for this dataset"}function l(z,y){var x;if(x=p.error){x=x.call(z,{hash:{},data:y})}else{x=z.error;x=typeof x===e?x.apply(z):x}return d(x)}function j(A,z){var x="",y;x+="\n ";y=p["if"].call(A,A.purged,{hash:{},inverse:o.program(10,v,z),fn:o.program(7,i,z),data:z});if(y||y===0){x+=y}x+="\n ";return x}function i(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(8,g,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n\n ";return x}function g(y,x){return"This dataset has been deleted and removed from disk."}function v(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(11,u,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n \n Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it\n or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk\n </strong></div>\n ';return x}function u(y,x){return"This dataset has been deleted."}function t(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:o.noop,fn:o.program(14,s,A),data:A};if(z=p.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!p.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='\n \n Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it\n </strong></div>\n ';return x}function s(y,x){return"This dataset has been hidden."}q+='<div class="dataset hda">\n <div class="dataset-warnings">\n ';h=p["if"].call(r,r.error,{hash:{},inverse:o.noop,fn:o.program(1,n,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p["if"].call(r,r.deleted,{hash:{},inverse:o.noop,fn:o.program(6,j,w),data:w});if(h||h===0){q+=h}q+="\n\n ";h=p.unless.call(r,r.visible,{hash:{},inverse:o.noop,fn:o.program(13,t,w),data:w});if(h||h===0){q+=h}q+='\n </div>\n\n <div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>\n <div class="dataset-primary-actions"></div>\n <div class="dataset-title-bar clear">\n <span class="dataset-state-icon state-icon"></span>\n <div class="dataset-title">\n <span class="hda-hid">';if(h=p.hid){h=h.call(r,{hash:{},data:w})}else{h=r.hid;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n <span class="dataset-name">';if(h=p.name){h=h.call(r,{hash:{},data:w})}else{h=r.name;h=typeof h===e?h.apply(r):h}q+=d(h)+'</span>\n </div>\n </div>\n\n <div class="dataset-body"></div>\n</div>';return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel-anon"]=b(function(g,r,p,k,u){this.compilerInfo=[4,">= 1.0.0"];p=this.merge(p,g.helpers);u=u||{};var q="",i,f,o=this,e="function",c=p.blockHelperMissing,d=this.escapeExpression;function n(z,y){var v="",x,w;v+='\n <div class="history-name" title="';w={hash:{},inverse:o.noop,fn:o.program(2,m,y),data:y};if(x=p.local){x=x.call(z,w)}else{x=z.local;x=typeof x===e?x.apply(z):x}if(!p.local){x=c.call(z,x,w)}if(x||x===0){v+=x}v+='">\n ';if(x=p.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===e?x.apply(z):x}v+=d(x)+"\n </div>\n ";return v}function m(w,v){return"You must be logged in to edit your history name"}function l(y,x){var v="",w;v+='\n <div class="history-size">';if(w=p.nice_size){w=w.call(y,{hash:{},data:x})}else{w=y.nice_size;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function j(y,x){var v="",w;v+='\n \n <div class="';if(w=p.status){w=w.call(y,{hash:{},data:x})}else{w=y.status;w=typeof w===e?w.apply(y):w}v+=d(w)+'message">';if(w=p.message){w=w.call(y,{hash:{},data:x})}else{w=y.message;w=typeof w===e?w.apply(y):w}v+=d(w)+"</div>\n ";return v}function h(w,v){return"You are over your disk quota"}function t(w,v){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function s(w,v){return"Your history is empty. Click 'Get Data' on the left pane to start"}q+='<div class="history-controls">\n\n <div class="history-title">\n \n ';i=p["if"].call(r,r.name,{hash:{},inverse:o.noop,fn:o.program(1,n,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=p["if"].call(r,r.nice_size,{hash:{},inverse:o.noop,fn:o.program(4,l,u),data:u});if(i||i===0){q+=i}q+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n <div class="message-container">\n ';i=p["if"].call(r,r.message,{hash:{},inverse:o.noop,fn:o.program(6,j,u),data:u});if(i||i===0){q+=i}q+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:o.noop,fn:o.program(8,h,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+=".\n ";f={hash:{},inverse:o.noop,fn:o.program(10,t,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+='.\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:o.noop,fn:o.program(12,s,u),data:u};if(i=p.local){i=i.call(r,f)}else{i=r.local;i=typeof i===e?i.apply(r):i}if(!p.local){i=c.call(r,i,f)}if(i||i===0){q+=i}q+="\n </div>";return q})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,y){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);y=y||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(D,C){var z="",B,A;z+='\n <div class="history-name" title="';A={hash:{},inverse:p.noop,fn:p.program(2,n,C),data:C};if(B=q.local){B=B.call(D,A)}else{B=D.local;B=typeof B===e?B.apply(D):B}if(!q.local){B=c.call(D,B,A)}if(B||B===0){z+=B}z+='">\n ';if(B=q.name){B=B.call(D,{hash:{},data:C})}else{B=D.name;B=typeof B===e?B.apply(D):B}z+=d(B)+"\n </div>\n ";return z}function n(A,z){return"Click to rename history"}function m(C,B){var z="",A;z+='\n <div class="history-size">';if(A=q.nice_size){A=A.call(C,{hash:{},data:B})}else{A=C.nice_size;A=typeof A===e?A.apply(C):A}z+=d(A)+"</div>\n ";return z}function k(D,C){var z="",B,A;z+='\n <div class="warningmessagesmall"><strong>\n ';A={hash:{},inverse:p.noop,fn:p.program(7,j,C),data:C};if(B=q.local){B=B.call(D,A)}else{B=D.local;B=typeof B===e?B.apply(D):B}if(!q.local){B=c.call(D,B,A)}if(B||B===0){z+=B}z+="\n </strong></div>\n ";return z}function j(A,z){return"You are currently viewing a deleted history!"}function g(C,B){var z="",A;z+='\n \n <div class="';if(A=q.status){A=A.call(C,{hash:{},data:B})}else{A=C.status;A=typeof A===e?A.apply(C):A}z+=d(A)+'message">';if(A=q.message){A=A.call(C,{hash:{},data:B})}else{A=C.message;A=typeof A===e?A.apply(C):A}z+=d(A)+"</div>\n ";return z}function x(A,z){return"You are over your disk quota"}function w(A,z){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function v(A,z){return"Select all"}function u(A,z){return"For all selected"}function t(A,z){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,y),data:y});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,y),data:y});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,y),data:y});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,x,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="history-dataset-actions">\n <button class="history-select-all-datasets-btn btn btn-default"\n data-mode="select">';f={hash:{},inverse:p.noop,fn:p.program(15,v,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='</button>\n <button class="history-dataset-action-popup-btn btn btn-default"\n >';f={hash:{},inverse:p.noop,fn:p.program(17,u,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='...</button>\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(19,t,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})(); \ No newline at end of file diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/packed/templates/compiled/template-history-historyPanel.js --- a/static/scripts/packed/templates/compiled/template-history-historyPanel.js +++ b/static/scripts/packed/templates/compiled/template-history-historyPanel.js @@ -1,1 +1,1 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,w){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);w=w||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(B,A){var x="",z,y;x+='\n <div class="history-name" title="';y={hash:{},inverse:p.noop,fn:p.program(2,n,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+='">\n ';if(z=q.name){z=z.call(B,{hash:{},data:A})}else{z=B.name;z=typeof z===e?z.apply(B):z}x+=d(z)+"\n </div>\n ";return x}function n(y,x){return"Click to rename history"}function m(A,z){var x="",y;x+='\n <div class="history-size">';if(y=q.nice_size){y=y.call(A,{hash:{},data:z})}else{y=A.nice_size;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function k(B,A){var x="",z,y;x+='\n <div class="warningmessagesmall"><strong>\n ';y={hash:{},inverse:p.noop,fn:p.program(7,j,A),data:A};if(z=q.local){z=z.call(B,y)}else{z=B.local;z=typeof z===e?z.apply(B):z}if(!q.local){z=c.call(B,z,y)}if(z||z===0){x+=z}x+="\n </strong></div>\n ";return x}function j(y,x){return"You are currently viewing a deleted history!"}function g(A,z){var x="",y;x+='\n \n <div class="';if(y=q.status){y=y.call(A,{hash:{},data:z})}else{y=A.status;y=typeof y===e?y.apply(A):y}x+=d(y)+'message">';if(y=q.message){y=y.call(A,{hash:{},data:z})}else{y=A.message;y=typeof y===e?y.apply(A):y}x+=d(y)+"</div>\n ";return x}function v(y,x){return"You are over your disk quota"}function u(y,x){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function t(y,x){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,w),data:w});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,w),data:w});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,v,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,u,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(15,t,w),data:w};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})(); \ No newline at end of file +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(h,s,q,l,y){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,h.helpers);y=y||{};var r="",i,f,p=this,e="function",c=q.blockHelperMissing,d=this.escapeExpression;function o(D,C){var z="",B,A;z+='\n <div class="history-name" title="';A={hash:{},inverse:p.noop,fn:p.program(2,n,C),data:C};if(B=q.local){B=B.call(D,A)}else{B=D.local;B=typeof B===e?B.apply(D):B}if(!q.local){B=c.call(D,B,A)}if(B||B===0){z+=B}z+='">\n ';if(B=q.name){B=B.call(D,{hash:{},data:C})}else{B=D.name;B=typeof B===e?B.apply(D):B}z+=d(B)+"\n </div>\n ";return z}function n(A,z){return"Click to rename history"}function m(C,B){var z="",A;z+='\n <div class="history-size">';if(A=q.nice_size){A=A.call(C,{hash:{},data:B})}else{A=C.nice_size;A=typeof A===e?A.apply(C):A}z+=d(A)+"</div>\n ";return z}function k(D,C){var z="",B,A;z+='\n <div class="warningmessagesmall"><strong>\n ';A={hash:{},inverse:p.noop,fn:p.program(7,j,C),data:C};if(B=q.local){B=B.call(D,A)}else{B=D.local;B=typeof B===e?B.apply(D):B}if(!q.local){B=c.call(D,B,A)}if(B||B===0){z+=B}z+="\n </strong></div>\n ";return z}function j(A,z){return"You are currently viewing a deleted history!"}function g(C,B){var z="",A;z+='\n \n <div class="';if(A=q.status){A=A.call(C,{hash:{},data:B})}else{A=C.status;A=typeof A===e?A.apply(C):A}z+=d(A)+'message">';if(A=q.message){A=A.call(C,{hash:{},data:B})}else{A=C.message;A=typeof A===e?A.apply(C):A}z+=d(A)+"</div>\n ";return z}function x(A,z){return"You are over your disk quota"}function w(A,z){return"Tool execution is on hold until your disk usage drops below your allocated quota"}function v(A,z){return"Select all"}function u(A,z){return"For all selected"}function t(A,z){return"Your history is empty. Click 'Get Data' on the left pane to start"}r+='<div class="history-controls">\n\n <div class="history-title">\n ';i=q["if"].call(s,s.name,{hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="history-subtitle clear">\n ';i=q["if"].call(s,s.nice_size,{hash:{},inverse:p.noop,fn:p.program(4,m,y),data:y});if(i||i===0){r+=i}r+='\n\n <div class="history-secondary-actions"></div>\n </div>\n\n ';i=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(6,k,y),data:y});if(i||i===0){r+=i}r+='\n\n <div class="message-container">\n ';i=q["if"].call(s,s.message,{hash:{},inverse:p.noop,fn:p.program(9,g,y),data:y});if(i||i===0){r+=i}r+='\n </div>\n\n <div class="quota-message errormessage">\n ';f={hash:{},inverse:p.noop,fn:p.program(11,x,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+=".\n ";f={hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='.\n </div>\n \n <div class="tags-display"></div>\n <div class="annotation-display"></div>\n\n <div class="history-dataset-actions">\n <button class="history-select-all-datasets-btn btn btn-default"\n data-mode="select">';f={hash:{},inverse:p.noop,fn:p.program(15,v,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='</button>\n <button class="history-dataset-action-popup-btn btn btn-default"\n >';f={hash:{},inverse:p.noop,fn:p.program(17,u,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+='...</button>\n </div>\n\n </div>\n\n \n <div class="datasets-list"></div>\n\n <div class="empty-history-message infomessagesmall">\n ';f={hash:{},inverse:p.noop,fn:p.program(19,t,y),data:y};if(i=q.local){i=i.call(s,f)}else{i=s.local;i=typeof i===e?i.apply(s):i}if(!q.local){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n </div>";return r})})(); \ No newline at end of file diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/templates/compiled/history-templates.js --- a/static/scripts/templates/compiled/history-templates.js +++ b/static/scripts/templates/compiled/history-templates.js @@ -498,6 +498,18 @@ function program15(depth0,data) { + return "Select all"; + } + +function program17(depth0,data) { + + + return "For all selected"; + } + +function program19(depth0,data) { + + return "Your history is empty. Click 'Get Data' on the left pane to start"; } @@ -525,10 +537,22 @@ else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n </div>" + buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n <div class=\"history-dataset-actions\">\n <button class=\"history-select-all-datasets-btn btn btn-default\"\n data-mode=\"select\">"; + options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</button>\n <button class=\"history-dataset-action-popup-btn btn btn-default\"\n >"; + options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "...</button>\n </div>\n\n </div>" + "\n\n " + "\n <div class=\"datasets-list\"></div>\n\n <div class=\"empty-history-message infomessagesmall\">\n "; - options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/templates/compiled/template-history-historyPanel.js --- a/static/scripts/templates/compiled/template-history-historyPanel.js +++ b/static/scripts/templates/compiled/template-history-historyPanel.js @@ -87,6 +87,18 @@ function program15(depth0,data) { + return "Select all"; + } + +function program17(depth0,data) { + + + return "For all selected"; + } + +function program19(depth0,data) { + + return "Your history is empty. Click 'Get Data' on the left pane to start"; } @@ -114,10 +126,22 @@ else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n </div>" + buffer += ".\n </div>\n \n <div class=\"tags-display\"></div>\n <div class=\"annotation-display\"></div>\n\n <div class=\"history-dataset-actions\">\n <button class=\"history-select-all-datasets-btn btn btn-default\"\n data-mode=\"select\">"; + options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "</button>\n <button class=\"history-dataset-action-popup-btn btn btn-default\"\n >"; + options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "...</button>\n </div>\n\n </div>" + "\n\n " + "\n <div class=\"datasets-list\"></div>\n\n <div class=\"empty-history-message infomessagesmall\">\n "; - options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/scripts/templates/history-templates.html --- a/static/scripts/templates/history-templates.html +++ b/static/scripts/templates/history-templates.html @@ -40,6 +40,13 @@ <div class="tags-display"></div><div class="annotation-display"></div> + <div class="history-dataset-actions"> + <button class="history-select-all-datasets-btn btn btn-default" + data-mode="select">{{#local}}Select all{{/local}}</button> + <button class="history-dataset-action-popup-btn btn btn-default" + >{{#local}}For all selected{{/local}}...</button> + </div> + </div>{{! end history-controls }} {{! where the datasets/hdas are added }} diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1515,7 +1515,7 @@ .history-panel .editable-text{border:solid transparent 1px} .history-panel .editable-text:hover{cursor:pointer;border:1px dotted #999999} .history-panel .message-container{cursor:pointer} -.history-panel .message-container [class$=message]{margin:0px} +.history-panel .message-container [class$=message]{margin:0px;margin-bottom:8px} .history-panel .history-controls{margin:10px;padding:0px}.history-panel .history-controls .history-title{margin-bottom:4px} .history-panel .history-controls .history-name{word-wrap:break-word;font-weight:bold} .history-panel .history-controls .history-title input{font-weight:bold;width:100%;margin:-2px 0 -2px -4px} @@ -1531,6 +1531,12 @@ .history-panel .history-controls .annotation-display .annotation:empty{height:20px} .history-panel .history-controls .annotation-display .annotation:empty:after{position:relative;top:-4px;font-size:10px;font-style:italic;color:grey;content:'Click here to edit annotation'} .history-panel .history-controls .annotation-display textarea{margin:0px 0px 2px 0px;display:block;border-radius:3px;width:100%} +.history-panel .history-controls .history-dataset-actions{display:none}.history-panel .history-controls .history-dataset-actions:before,.history-panel .history-controls .history-dataset-actions:after{content:" ";display:table;} +.history-panel .history-controls .history-dataset-actions:after{clear:both} +.history-panel .history-controls .history-dataset-actions:before,.history-panel .history-controls .history-dataset-actions:after{content:" ";display:table;} +.history-panel .history-controls .history-dataset-actions:after{clear:both} +.history-panel .history-controls .history-dataset-actions .btn{padding-top:2px;padding-bottom:2px;font-size:90%} +.history-panel .history-controls .history-dataset-actions .history-dataset-action-popup-btn{float:right} .history-panel .dataset{border-width:1px 0px 0px 0px} .history-panel .dataset:last-child{border-width:1px 0px 1px 0px} .history-panel .empty-history-message{display:none;margin:0px 10px 0px 10px} @@ -1540,7 +1546,7 @@ .dataset .dataset-padding{padding:6px 10px 6px 8px} .dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%} .dataset .help-text{font-weight:normal;font-style:italic;font-size:90%;color:#555} -.dataset .dataset-selector{float:left;display:none;width:0px;margin:0 8px -6px 0;padding:5px 0 2px 8px;cursor:pointer;vertical-align:middle} +.dataset .dataset-selector{float:left;display:none;width:0px;margin:0 0 -6px 0;padding:5px 0 2px 8px;cursor:pointer;vertical-align:middle} .dataset .dataset-title-bar{cursor:pointer;padding:6px 10px 6px 8px} .dataset .dataset-title-bar .dataset-title{display:inline;font-weight:bold;text-decoration:underline;word-wrap:break-word;word-break:break-all;line-height:16px} .dataset .dataset-primary-actions{float:right;margin:6px 10px 0}.dataset .dataset-primary-actions .icon-btn{margin-left:2px} diff -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee -r f18fd1851269dbe8935c82a156374b8e6f73269d static/style/src/less/history.less --- a/static/style/src/less/history.less +++ b/static/style/src/less/history.less @@ -94,6 +94,7 @@ } .message-container [class$=message] { margin: 0px; + margin-bottom: 8px; } .history-controls { @@ -186,6 +187,19 @@ width: 100%; } } + + .history-dataset-actions { + display: none; + .clear; + .btn { + padding-top: 2px; + padding-bottom: 2px; + font-size: 90%; + } + .history-dataset-action-popup-btn { + float: right; + } + } } // display only a top border on all @@ -256,13 +270,12 @@ } .dataset-selector { - //background-color: red; float: left; // always initially hidden and zero width display: none; width: 0px; //HACK: neg. on the bottom due to padding-bottom in title-bar - very tweakish - margin: 0px 8px -@spacing-bottom 0px; + margin: 0px 0px -@spacing-bottom 0px; padding: ( @spacing-top - 1 ) 0px 2px @spacing-left; cursor: pointer; //text-align: center; Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.