Merge pull request #1407 from guerler/revise_masthead_000

Masthead/Scratchbook revision and test cases
This commit is contained in:
Björn Grüning
2016-01-04 01:31:44 +01:00
38 changed files with 1057 additions and 1922 deletions
+56 -141
View File
@@ -3,176 +3,91 @@ define([
'layout/menu',
'layout/scratchbook',
'mvc/user/user-quotameter',
], function(Utils, Menu, Scratchbook, QuotaMeter) {
], function( Utils, Menu, Scratchbook, QuotaMeter ) {
/** Masthead **/
var GalaxyMasthead = Backbone.View.extend({
// base element
el_masthead: '#everything',
// options
options : null,
// background
$background: null,
// list
list: [],
// initialize
initialize : function(options) {
// update options
var View = Backbone.View.extend({
initialize : function( options ) {
var self = this;
this.options = options;
this.setElement( this._template() );
this.$navbarBrandLink = this.$( '.navbar-brand-link' );
this.$navbarBrandImage = this.$( '.navbar-brand-image' );
this.$navbarBrandTitle = this.$( '.navbar-brand-title' );
this.$navbarTabs = this.$( '.navbar-tabs' );
this.$quoteMeter = this.$( '.quota-meter-container' );
// HACK: due to body events defined in panel.js
$("body").off();
// build tabs
this.collection = new Menu.Collection();
this.collection.on( 'add', function( model ) {
self.$navbarTabs.append( new Menu.Tab( { model : model } ).render().$el );
}).on( 'reset', function() {
self.$navbarTabs.empty();
}).on( 'dispatch', function( callback ) {
self.collection.each( function ( m ) { callback( m ) });
}).fetch( this.options );
// define this element
this.setElement($(this._template(options)));
// add to page
$( '#masthead' ).replaceWith( this.$el );
// scratchbook
Galaxy.frame = this.frame = new Scratchbook( { collection: this.collection } );
$( 'body' ).append( this.frame.$el );
// assign background
this.$background = $(this.el).find('#masthead-background');
// set up the quota meter (And fetch the current user data from trans)
// add quota meter to masthead
Galaxy.quotaMeter = this.quotaMeter = new QuotaMeter.UserQuotaMeter({
model : Galaxy.user,
el : this.$quoteMeter
});
// loop through beforeunload functions if the user attempts to unload the page
var self = this;
$(window).on('click', function( e ) {
$( window ).on( 'click', function( e ) {
var $download_link = $( e.target ).closest( 'a[download]' );
if ( $download_link.length == 1 ) {
if( $( 'iframe[id=download]' ).length === 0 ){
$( 'body' ).append( $( '<iframe id="download" style="display: none;" />' ) );
if( $( 'iframe[id=download]' ).length === 0 ) {
$( 'body' ).append( $( '<iframe/>' ).attr( 'id', 'download' ).hide() );
}
$( 'iframe[id=download]' ).attr( 'src', $download_link.attr( 'href' ) );
e.preventDefault();
}
}).on('beforeunload', function() {
var text = "";
for (var key in self.list) {
if (self.list[key].options.onbeforeunload) {
var q = self.list[key].options.onbeforeunload();
if (q) text += q + " ";
}
}
if (text !== "") {
}).on( 'beforeunload', function() {
var text = '';
self.collection.each( function( model ) {
var q = model.get( 'onbeforeunload' ) && model.get( 'onbeforeunload' )();
q && ( text += q + ' ' );
});
if ( text !== '' ) {
return text;
}
});
// construct default menu options
this.menu = Galaxy.menu = new Menu.GalaxyMenu({
masthead : this,
config : this.options
});
// scratchpad
this.frame = Galaxy.frame = new Scratchbook.GalaxyFrame({
masthead : this,
});
// set up the quota meter (And fetch the current user data from trans)
// add quota meter to masthead
this.quotaMeter = Galaxy.quotaMeter = new QuotaMeter.UserQuotaMeter({
model : Galaxy.user,
el : this.$( '.quota-meter-container' )
}).render();
},
// configure events
events: {
'click' : '_click',
'mousedown' : function(e) { e.preventDefault() }
render: function() {
this.$navbarBrandTitle.html( 'Galaxy ' + ( this.options.brand && '/ ' + this.options.brand || '' ) );
this.$navbarBrandLink.attr( 'href', this.options.logo_url );
this.$navbarBrandImage.attr( 'src', Galaxy.root + 'static/images/galaxyIcon_noText.png' );
this.quotaMeter.render();
return this;
},
// adds a new item to the masthead
append : function(item) {
return this._add(item, true);
},
// adds a new item to the masthead
prepend : function(item) {
return this._add(item, false);
},
// activate
highlight: function(id) {
var current = $(this.el).find('#' + id + '> li');
if (current) {
current.addClass('active');
}
},
// adds a new item to the masthead
_add : function(item, append) {
var $loc = $(this.el).find('#' + item.location);
if ($loc){
// create frame for new item
var $current = $(item.el);
// configure class in order to mark new items
$current.addClass('masthead-item');
// append to masthead
if (append) {
$loc.append($current);
} else {
$loc.prepend($current);
}
// add to list
this.list.push(item);
}
// location not found
return null;
},
// handle click event
_click: function(e) {
// close all popups
var $all = $(this.el).find('.popup');
if ($all) {
$all.hide();
}
// open current item
var $current = $(e.target).closest('.masthead-item').find('.popup');
if ($(e.target).hasClass('head')) {
$current.show();
this.$background.show();
} else {
this.$background.hide();
}
},
/*
HTML TEMPLATES
*/
// fill template
_template: function(options) {
var brand_text = options.brand ? ("/ " + options.brand) : "" ;
return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
'<div style="position: relative; right: -50%; float: left;">' +
'<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
/** body template */
_template: function() {
return '<div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
'<div class="navbar-header">' +
'<div class="navbar-tabs"/>' +
'</div>' +
'<div class="navbar-brand">' +
'<a href="' + options.logo_url + '">' +
'<img style="margin-left: 0.35em;" border="0" src="' + Galaxy.root + 'static/images/galaxyIcon_noText.png">' +
'<span id="brand"> Galaxy ' + brand_text + '</span>' +
'<div class="navbar-brand">' +
'<a class="navbar-brand-link">' +
'<img class="navbar-brand-image"/>' +
'<span class="navbar-brand-title"/>' +
'</a>' +
'</div>' +
'<div class="quota-meter-container"></div>' +
'<div id="iconbar" class="iconbar"></div>' +
'</div>' +
'<div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
'<div class="quota-meter-container"/>' +
'<div class="navbar-icons"/>' +
'</div>';
}
});
// return
return {
GalaxyMasthead: GalaxyMasthead
View: View
};
});
+305 -429
View File
@@ -1,513 +1,389 @@
// dependencies
/** Masthead Collection **/
define([], function() {
var Collection = Backbone.Collection.extend({
model: Backbone.Model.extend({
defaults: {
visible : true,
target : '_parent'
}
}),
fetch: function( options ){
options = options || {};
this.reset();
/** GalaxyMenu uses the GalaxyMasthead class in order to add menu items and icons to the Masthead **/
var GalaxyMenu = Backbone.Model.extend({
initialize: function( options ) {
this.options = options.config;
this.masthead = options.masthead;
this.create();
},
// default menu
create: function() {
//
// Analyze data tab.
//
var tab_analysis = new GalaxyMastheadTab({
this.add({
id : 'analysis',
title : 'Analyze Data',
content : '',
title_attribute : 'Analysis home view'
url : '',
tooltip : 'Analysis home view'
});
this.masthead.append( tab_analysis );
//
// Workflow tab.
//
var workflow_options = {
this.add({
id : 'workflow',
title : 'Workflow',
content : 'workflow',
title_attribute : 'Chain tools into workflows'
}
if ( !Galaxy.user.id ) {
workflow_options.disabled = true; // disable workflows for anonymous users
}
var tab_workflow = new GalaxyMastheadTab( workflow_options );
this.masthead.append( tab_workflow );
url : 'workflow',
tooltip : 'Chain tools into workflows',
disabled : !Galaxy.user.id
});
//
// 'Shared Items' or Libraries tab.
//
var tab_shared = new GalaxyMastheadTab({
this.add({
id : 'shared',
title : 'Shared Data',
content : 'library/index',
title_attribute : 'Access published resources'
url : 'library/index',
tooltip : 'Access published resources',
menu : [{
title : 'Data Libraries deprecated',
url : 'library/index'
},{
title : 'Data Libraries',
url : 'library/list',
divider : true
},{
title : 'Published Histories',
url : 'history/list_published'
},{
title : 'Published Workflows',
url : 'workflow/list_published'
},{
title : 'Published Visualizations',
url : 'visualization/list_published'
},{
title : 'Published Pages',
url : 'page/list_published'
}]
});
tab_shared.add({
title : 'Data Libraries deprecated',
content : 'library/index'
});
tab_shared.add({
title : 'Data Libraries',
content : 'library/list',
divider : true
});
tab_shared.add({
title : 'Published Histories',
content : 'history/list_published'
});
tab_shared.add({
title : 'Published Workflows',
content : 'workflow/list_published'
});
tab_shared.add({
title : 'Published Visualizations',
content : 'visualization/list_published'
});
tab_shared.add({
title : 'Published Pages',
content : 'page/list_published'
});
this.masthead.append(tab_shared);
//
// Lab menu.
//
if ( this.options.user_requests ) {
var tab_lab = new GalaxyMastheadTab({
id : 'lab',
title : 'Lab'
});
tab_lab.add({
title : 'Sequencing Requests',
content : 'requests/index'
});
tab_lab.add({
title : 'Find Samples',
content : 'requests/find_samples_index'
});
tab_lab.add({
title : 'Help',
content : this.options.lims_doc_url
});
this.masthead.append( tab_lab );
}
options.user_requests && this.add({
id : 'lab',
title : 'Lab',
menu : [{
title : 'Sequencing Requests',
url : 'requests/index'
},{
title : 'Find Samples',
url : 'requests/find_samples_index'
},{
title : 'Help',
url : options.lims_doc_url
}]
});
//
// Visualization tab.
//
var visualization_options = {
this.add({
id : 'visualization',
title : 'Visualization',
content : 'visualization/list',
title_attribute : 'Visualize datasets'
}
// disable visualizations for anonymous users
if ( !Galaxy.user.id ) {
visualization_options.disabled = true;
}
var tab_visualization = new GalaxyMastheadTab( visualization_options );
// add submenu only when user is logged in
if ( Galaxy.user.id ) {
tab_visualization.add({
title : 'New Track Browser',
content : 'visualization/trackster',
target : '_frame'
});
tab_visualization.add({
title : 'Saved Visualizations',
content : 'visualization/list',
target : '_frame'
});
}
this.masthead.append( tab_visualization );
url : 'visualization/list',
tooltip : 'Visualize datasets',
disabled : !Galaxy.user.id,
menu : [{
title : 'New Track Browser',
url : 'visualization/trackster',
target : '_frame'
},{
title : 'Saved Visualizations',
url : 'visualization/list',
target : '_frame'
}]
});
//
// Admin.
//
if ( Galaxy.user.get( 'is_admin' ) ) {
var tab_admin = new GalaxyMastheadTab({
id : 'admin',
title : 'Admin',
content : 'admin',
extra_class : 'admin-only',
title_attribute : 'Administer this Galaxy'
});
this.masthead.append( tab_admin );
}
Galaxy.user.get( 'is_admin' ) && this.add({
id : 'admin',
title : 'Admin',
url : 'admin',
tooltip : 'Administer this Galaxy',
cls : 'admin-only'
});
//
// Help tab.
//
var tab_help = new GalaxyMastheadTab({
var helpTab = {
id : 'help',
title : 'Help',
title_attribute : 'Support, contact, and community hubs'
});
if ( this.options.biostar_url ){
tab_help.add({
title : 'Galaxy Biostar',
content : this.options.biostar_url_redirect,
target : '_blank'
});
tab_help.add({
title : 'Ask a question',
content : 'biostar/biostar_question_redirect',
target : '_blank'
});
}
tab_help.add({
title : 'Support',
content : this.options.support_url,
tooltip : 'Support, contact, and community hubs',
menu : [{
title : 'Support',
url : options.support_url,
target : '_blank'
},{
title : 'Search',
url : options.search_url,
target : '_blank'
},{
title : 'Mailing Lists',
url : options.mailing_lists,
target : '_blank'
},{
title : 'Videos',
url : options.screencasts_url,
target : '_blank'
},{
title : 'Wiki',
url : options.wiki_url,
target : '_blank'
},{
title : 'How to Cite Galaxy',
url : options.citation_url,
target : '_blank'
}]
};
options.terms_url && helpTab.menu.push({
title : 'Terms and Conditions',
url : options.terms_url,
target : '_blank'
});
tab_help.add({
title : 'Search',
content : this.options.search_url,
options.biostar_url && helpTab.menu.unshift({
title : 'Ask a question',
url : 'biostar/biostar_question_redirect',
target : '_blank'
});
tab_help.add({
title : 'Mailing Lists',
content : this.options.mailing_lists,
options.biostar_url && helpTab.menu.unshift({
title : 'Galaxy Biostar',
url : options.biostar_url_redirect,
target : '_blank'
});
tab_help.add({
title : 'Videos',
content : this.options.screencasts_url,
target : '_blank'
});
tab_help.add({
title : 'Wiki',
content : this.options.wiki_url,
target : '_blank'
});
tab_help.add({
title : 'How to Cite Galaxy',
content : this.options.citation_url,
target : '_blank'
});
if (this.options.terms_url){
tab_help.add({
title : 'Terms and Conditions',
content : this.options.terms_url,
target : '_blank'
});
}
this.masthead.append( tab_help );
this.add( helpTab );
//
// User tab.
//
if ( !Galaxy.user.id ){
var tab_user = new GalaxyMastheadTab({
var userTab = {
id : 'user',
title : 'User',
extra_class : 'loggedout-only',
title_attribute : 'Account registration or login'
});
// login
tab_user.add({
title : 'Login',
content : 'user/login',
icon : 'fa-user',
cls : 'loggedout-only',
tooltip : 'Account registration or login',
menu : [{
title : 'Login',
url : 'user/login',
target : 'galaxy_main'
}]
};
options.allow_user_creation && userTab.menu.push({
title : 'Register',
url : 'user/create',
target : 'galaxy_main'
});
// register
if ( this.options.allow_user_creation ){
tab_user.add({
title : 'Register',
content : 'user/create',
target : 'galaxy_main'
});
}
// add to masthead
this.masthead.append( tab_user );
this.add( userTab );
} else {
var tab_user = new GalaxyMastheadTab({
var userTab = {
id : 'user',
title : 'User',
extra_class : 'loggedin-only',
title_attribute : 'Account preferences and saved data'
});
// show user logged in info
tab_user.add({
title : 'Logged in as ' + Galaxy.user.get( 'email' )
});
tab_user.add({
title : 'Preferences',
content : 'user?cntrller=user',
icon : 'fa-user',
cls : 'loggedin-only',
tooltip : 'Account preferences and saved data',
menu : [{
title : 'Logged in as ' + Galaxy.user.get( 'email' )
},{
title : 'Preferences',
url : 'user?cntrller=user',
target : 'galaxy_main'
},{
title : 'Custom Builds',
url : 'user/dbkeys',
target : 'galaxy_main'
},{
title : 'Logout',
url : 'user/logout',
target : '_top',
divider : true
},{
title : 'Saved Histories',
url : 'history/list',
target : 'galaxy_main'
},{
title : 'Saved Datasets',
url : 'dataset/list',
target : 'galaxy_main'
},{
title : 'Saved Pages',
url : 'page/list',
target : '_top'
},{
title : 'API Keys',
url : 'user/api_keys?cntrller=user',
target : 'galaxy_main'
}]
};
options.use_remote_user && userTab.menu.push({
title : 'Public Name',
url : 'user/edit_username?cntrller=user',
target : 'galaxy_main'
});
tab_user.add({
title : 'Custom Builds',
content : 'user/dbkeys',
target : 'galaxy_main'
});
tab_user.add({
title : 'Logout',
content : 'user/logout',
target : '_top',
divider : true
});
// default tabs
tab_user.add({
title : 'Saved Histories',
content : 'history/list',
target : 'galaxy_main'
});
tab_user.add({
title : 'Saved Datasets',
content : 'dataset/list',
target : 'galaxy_main'
});
tab_user.add({
title : 'Saved Pages',
content : 'page/list',
target : '_top'
});
tab_user.add({
title : 'API Keys',
content : 'user/api_keys?cntrller=user',
target : 'galaxy_main'
});
if ( this.options.use_remote_user ){
tab_user.add({
title : 'Public Name',
content : 'user/edit_username?cntrller=user',
target : 'galaxy_main'
});
}
// add to masthead
this.masthead.append( tab_user );
}
// identify active tab
if ( this.options.active_view ) {
this.masthead.highlight( this.options.active_view );
this.add( userTab );
}
var activeView = this.get( options.active_view );
activeView && activeView.set( 'active', true );
return new jQuery.Deferred().resolve().promise();
}
});
/** Masthead tab **/
var GalaxyMastheadTab = Backbone.View.extend({
// main options
options:{
id : '',
title : '',
target : '_parent',
content : '',
type : 'url',
scratchbook : false,
onunload : null,
visible : true,
disabled : false,
title_attribute : ''
},
// location
location: 'navbar',
// optional sub menu
$menu: null,
// events
events:{
'click .head' : '_head'
},
// initialize
initialize: function ( options ){
// read in defaults
if ( options ){
this.options = _.defaults( options, this.options );
}
// update url
if ( this.options.content !== undefined && this.options.content.indexOf( '//' ) === -1 ){
this.options.content = Galaxy.root + this.options.content;
}
// add template for tab
this.setElement( $( this._template( this.options ) ) );
// disable menu items that are not available to anonymous user
// also show title to explain why they are disabled
if ( this.options.disabled ){
$( this.el ).find( '.root' ).addClass( 'disabled' );
this._attachPopover();
}
// visiblity
if ( !this.options.visible ){
this.hide();
}
},
// show
show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// add menu item
add: function (options){
// menu option defaults
var menuOptions = {
title : 'Title',
content : '',
type : 'url',
target : '_parent',
scratchbook : false,
divider : false,
onclick : undefined
}
// read in defaults
if (options)
menuOptions = _.defaults(options, menuOptions);
// update url
if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
menuOptions.content = Galaxy.root + menuOptions.content;
// check if submenu element is available
if (!this.$menu){
// insert submenu element into root
$(this.el).find('.root').append(this._templateMenu());
// show caret
$(this.el).find('.symbol').addClass('caret');
// update element link
this.$menu = $(this.el).find('.popup');
}
// create
var $item = $(this._templateMenuItem(menuOptions));
// append menu
this.$menu.append($item);
// add events
var Tab = Backbone.View.extend({
initialize: function ( options ) {
var self = this;
if (menuOptions.onclick !== undefined){
$item.on('click', function(e){
e.preventDefault();
menuOptions.onclick();
});
} else {
$item.on('click', function(e){
// prevent default
e.preventDefault();
// no modifications if new tab is requested
if (self.options.target === '_blank')
return true;
// load into frame
Galaxy.frame.add(options);
});
}
// append divider
if (menuOptions.divider)
this.$menu.append($(this._templateDivider()));
this.setElement( this._template() );
this.$dropdown = this.$( '.dropdown' );
this.$toggle = this.$( '.dropdown-toggle' );
this.$menu = this.$( '.dropdown-menu' );
this.$note = this.$( '.dropdown-note' );
this.model = options.model;
this.model.on( 'init change:title', function() {
this.get( 'title' ) && self.$toggle.html( this.get( 'title' ) );
}).on( 'init change:visible', function() {
self.$el.css( { visibility : this.get( 'visible' ) && 'visible' || 'hidden' } );
}).on( 'init change:note', function() {
self.$note.html( this.get( 'note' ) );
}).on( 'init change:note_cls', function() {
this._prevNoteCls && self.$note.removeClass( this._prevNoteCls );
this.get( 'note_cls' ) && self.$note.addClass( this._prevNoteCls = this.get( 'note_cls' ) );
}).on( 'init change:show_note', function() {
self.$note.css( { 'display' : this.get( 'show_note' ) && 'block' || 'none' } );
}).on( 'init change:target', function() {
self.$toggle.attr( 'target', this.get( 'target' ) );
}).on( 'init change:url', function() {
this.set( 'url', self._formatUrl( this.get( 'url' ) ) );
self.$toggle.attr( 'href', this.get( 'url' ) );
}).on( 'init change:tooltip', function() {
$( '.tooltip' ).remove();
self.$toggle.tooltip( 'destroy' ).attr( 'title', this.get( 'tooltip' ) );
this.get( 'tooltip' ) && self.$toggle.tooltip( { placement: 'bottom' } );
}).on( 'init change:cls', function() {
this._prevCls && self.$toggle.removeClass( this._prevCls );
this.get( 'cls' ) && self.$toggle.addClass( this._prevCls = this.get( 'cls' ) );
}).on( 'init change:icon', function() {
this._prevIcon && self.$toggle.removeClass( this._prevIcon );
this.get( 'icon' ) && self.$toggle.addClass( this._prevIcon = 'fa fa-2x ' + this.get( 'icon' ) );
}).on( 'init change:toggle', function() {
self.$toggle[ this.get( 'toggle' ) && 'addClass' || 'removeClass' ]( 'toggle' );
}).on( 'init change:disabled', function() {
self.$toggle[ this.get( 'disabled' ) && 'addClass' || 'removeClass' ]( 'disabled' );
self._configurePopover();
}).on( 'init change:active', function() {
self.$dropdown[ this.get( 'active' ) && 'addClass' || 'removeClass' ]( 'active' );
}).on( 'init change:show_menu', function() {
if ( this.get( 'menu' ) && this.get( 'show_menu' ) ) {
self.$menu.show();
$( '#dd-helper' ).show().off().on( 'click', function() {
$( '#dd-helper' ).hide();
self.model.set( 'show_menu', false );
});
} else {
self.$menu.hide();
$( '#dd-helper' ).hide();
}
}).on( 'init change:menu', function() {
self.$menu.empty().removeClass( 'dropdown-menu' );
self.$toggle.find( 'b' ).remove();
if ( this.get( 'menu' ) ) {
_.each( this.get( 'menu' ), function( menuItem ) {
self.$menu.append( self._buildMenuItem( menuItem ) );
menuItem.divider && self.$menu.append( $( '<li/>' ).addClass( 'divider' ) );
});
self.$menu.addClass( 'dropdown-menu' );
self.$toggle.append( $( '<b/>' ).addClass( 'caret' ) );
}
}).trigger( 'init' );
},
// show menu on header click
_head: function(e){
// prevent default
e.preventDefault();
if (this.options.disabled){
return // prevent link following if menu item is disabled
}
// check for menu options
if (!this.$menu) {
Galaxy.frame.add(this.options);
}
/** Attach events */
events: {
'click .dropdown-toggle' : '_toggleClick'
},
_attachPopover : function(){
var $popover_element = $(this.el).find('.head');
$popover_element.popover({
html: true,
content: 'Please <a href="' + Galaxy.root + 'user/login?use_panels=True">log in</a> or <a href="' + Galaxy.root + 'user/create?use_panels=True">register</a> to use this feature.',
placement: 'bottom'
}).on('shown.bs.popover', function() { // hooking on bootstrap event to automatically hide popovers after delay
setTimeout(function() {
$popover_element.popover('hide');
}, 5000);
/** Add new menu item */
_buildMenuItem: function ( options ) {
var self = this;
options = _.defaults( options || {}, {
title : '',
url : '',
target : '_parent'
});
},
// fill template header
_templateMenuItem: function (options){
return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
options.url = self._formatUrl( options.url );
return $( '<li/>' ).append(
$( '<a/>' ).attr( 'href', options.url )
.attr( 'target', options.target )
.html( options.title )
.on( 'click', function( e ) {
e.preventDefault();
self.model.set( 'show_menu', false );
options.onclick && options.onclick();
Galaxy.frame.add( options );
})
);
},
// fill template header
_templateMenu: function (){
return '<ul class="popup dropdown-menu"></ul>';
/** Handle click event */
_toggleClick: function( e ) {
var self = this;
var model = this.model;
e.preventDefault();
$( '.tooltip' ).hide();
model.trigger( 'dispatch', function( m ) {
model.id !== m.id && m.get( 'menu' ) && m.set( 'show_menu', false );
});
if ( !model.get( 'disabled' ) ) {
if ( !model.get( 'menu' ) ) {
model.get( 'onclick' ) ? model.get( 'onclick' )() : Galaxy.frame.add( model.attributes );
} else {
model.set( 'show_menu', true );
}
}
},
_templateDivider: function(){
return '<li class="divider"></li>';
/** Configures login notification/popover */
_configurePopover: function() {
var self = this;
function buildLink( label, url ) {
return $( '<div/>' ).append( $( '<a/>' ).attr( 'href', Galaxy.root + url ).html( label ) ).html()
}
this.$toggle.popover && this.$toggle.popover( 'destroy' );
this.model.get( 'disabled' ) && this.$toggle.popover({
html : true,
placement : 'bottom',
content : 'Please ' + buildLink( 'login', 'user/login?use_panels=True' ) + ' or ' +
buildLink( 'register', 'user/create?use_panels=True' ) + ' to use this feature.'
}).on( 'shown.bs.popover', function() {
setTimeout( function() { self.$toggle.popover( 'hide' ) }, 5000 );
});
},
// fill template
_template: function (options){
// start template
var tmpl = '<ul id="' + options.id + '" class="nav navbar-nav" border="0" cellspacing="0">' +
'<li class="root dropdown" style="">' +
'<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '" title="' + options.title_attribute + '">' +
options.title + '<b class="symbol"></b>' +
'</a>' +
'</li>' +
'</ul>';
/** Url formatting */
_formatUrl: function( url ) {
return typeof url == 'string' && url.indexOf( '//' ) === -1 && url.charAt( 0 ) != Galaxy.root ? Galaxy.root + url : url;
},
// return template
return tmpl;
/** body tempate */
_template: function () {
return '<ul class="nav navbar-nav">' +
'<li class="dropdown">' +
'<a class="dropdown-toggle"/>' +
'<ul class="dropdown-menu"/>' +
'<div class="dropdown-note"/>' +
'</li>' +
'</ul>';
}
});
// return
return {
GalaxyMenu: GalaxyMenu,
GalaxyMastheadTab: GalaxyMastheadTab
Collection : Collection,
Tab : Tab
};
});
+67 -88
View File
@@ -3,10 +3,10 @@ define([
'layout/panel',
'mvc/ui/ui-modal',
'mvc/base-mvc'
], function( MASTHEAD, PANEL, MODAL, BASE_MVC ) {
], function( Masthead, Panel, Modal, BaseMVC ) {
// ============================================================================
var PageLayoutView = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
var PageLayoutView = Backbone.View.extend( BaseMVC.LoggableMixin ).extend({
_logNamespace : 'layout',
el : 'body',
@@ -17,113 +17,101 @@ var PageLayoutView = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
],
defaultOptions : {
message_box_visible : false,
message_box_content : '',
message_box_class : 'info',
message_box_visible : false,
message_box_content : '',
message_box_class : 'info',
show_inactivity_warning : false,
inactivity_box_content : '',
inactivity_box_content : ''
},
initialize : function( options ){
initialize : function( options ) {
// TODO: remove globals
this.log( this + '.initialize:', options );
_.extend( this, _.pick( options, this._panelIds ) );
this.options = _.defaults( _.omit( options, this._panelIds ), this.defaultOptions );
// TODO: remove globals
Galaxy.modal = this.modal = new MODAL.View();
},
/** */
$everything : function(){
return this.$( '#everything' );
},
render : function(){
this.log( this + '.render:' );
Galaxy.modal = this.modal = new Modal.View();
this.masthead = new Masthead.View( this.options.config );
this.$el.attr( 'scroll', 'no' );
this.$el.html( this.template( this.options ) );
this.$el.append( this._template() );
this.$el.append( this.masthead.$el );
this.$el.append( this.modal.$el );
this.$messagebox = this.$( '#messagebox' );
this.$inactivebox = this.$( '#inactivebox' );
},
//TODO: no render on masthead, needs init each time
Galaxy.masthead = this.masthead = new MASTHEAD.GalaxyMasthead( _.extend( this.options.config, {
el: this.$( '#masthead' ).get(0)
}));
if( this.options.message_box_visible ){
this.messageBox( this.options.message_box_content, this.options.message_box_class );
}
if( this.options.show_inactivity_warning ){
this.inactivityWarning( this.options.inactivity_box_content );
}
render : function() {
// TODO: Remove this line after select2 update
$( '.select2-hidden-accessible' ).remove();
this.log( this + '.render:' );
this.masthead.render();
this.renderMessageBox();
this.renderInactivityBox();
this.renderPanels();
return this;
},
/** */
messageBox : function( content, level ){
content = content || '';
level = level || 'info';
this.$el.addClass( 'has-message-box' );
this.$( '#messagebox' )
.attr( 'class', 'panel-' + level + '-message' )
.html( content )
.toggle( !!content );
/** Render message box */
renderMessageBox : function() {
if ( this.options.message_box_visible ){
var content = this.options.message_box_content || '';
var level = this.options.message_box_class || 'info';
this.$el.addClass( 'has-message-box' );
this.$messagebox
.attr( 'class', 'panel-' + level + '-message' )
.html( content )
.toggle( !!content )
.show();
} else {
this.$el.removeClass( 'has-message-box' );
this.$messagebox.hide();
}
return this;
},
/** */
inactivityWarning : function( content ){
var verificationLink = '<a href="' + Galaxy.root + 'user/resend_verification">Resend verification.</a>';
this.$el.addClass( 'has-inactivity-box' );
this.$( '#inactivebox' )
.html( content )
.append( ' ' + verificationLink )
.toggle( !!content );
/** Render inactivity warning */
renderInactivityBox : function() {
if( this.options.show_inactivity_warning ){
var content = this.options.inactivity_box_content || '';
var verificationLink = $( '<a/>' ).attr( 'href', Galaxy.root + 'user/resend_verification' ).html( 'Resend verification.' );
this.$el.addClass( 'has-inactivity-box' );
this.$inactivebox
.html( content )
.append( ' ' + verificationLink )
.toggle( !!content )
.show();
} else {
this.$el.removeClass( 'has-inactivity-box' );
this.$inactivebox.hide();
}
return this;
},
/** */
renderPanels : function(){
/** Render panels */
renderPanels : function() {
var page = this;
// TODO: Remove this line after select2 update
$( '.select2-hidden-accessible' ).remove();
this._panelIds.forEach( function( panelId ){
if( _.has( page, panelId ) ){
var panelView = page[ panelId ];
panelView.setElement( '#' + panelId );
panelView.render();
page[ panelId ].setElement( '#' + panelId );
page[ panelId ].render();
} else if ( panelId !== 'center' ) {
page.center.$el( panelId, 0 );
}
});
if( !this.left ){
this.center.$el.css( 'left', 0 );
}
if( !this.right ){
this.center.$el.css( 'right', 0 );
}
return this;
},
/** body template */
//TODO: to underscore
template: function( options ){
//TODO: remove inline styling
_template: function() {
return [
'<div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">',
'<div id="everything">',
'<div id="background"/>',
'<div id="masthead" class="navbar navbar-fixed-top navbar-inverse"></div>',
'<div id="messagebox" style="display: none;"></div>',
'<div id="inactivebox" class="panel-warning-message" style="display: none;"></div>',
// content here
// TODO: wrapping div
this.left? '<div id="left"/>' : '',
this.center? '<div id="center" class="inbound"/>' : '',
this.right? '<div id="right"/>' : '',
'<div id="messagebox"/>',
'<div id="inactivebox" class="panel-warning-message"/>',
'<div id="left"/>',
'<div id="center" class="inbound"/>',
'<div id="right"/>',
'</div>',
// a dropdown overlay for capturing clicks/drags
'<div id="dd-helper" style="display: none;"></div>',
// display message when js is disabled
'<div id="dd-helper"/>',
'<noscript>',
'<div class="overlay overlay-background noscript-overlay">',
'<div>',
@@ -138,16 +126,7 @@ var PageLayoutView = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
].join('');
},
hideSidePanels : function(){
if( this.left ){
this.left.hide();
}
if( this.right ){
this.right.hide();
}
},
toString : function(){ return 'PageLayoutView'; }
toString : function() { return 'PageLayoutView' }
});
// ============================================================================
+64 -252
View File
@@ -1,84 +1,51 @@
// dependencies
define(["mvc/ui/ui-frames"], function(Frames) {
/** Frame manager uses the ui-frames to create the scratch book masthead icon and functionality **/
var GalaxyFrame = Backbone.View.extend({
// base element
el_main: 'body',
// frame active/disabled
active: false,
// button active
button_active: null,
// button load
button_load : null,
// initialize
initialize : function(options) {
options = options || {};
// add to masthead menu
define([ 'mvc/ui/ui-frames' ], function( Frames ) {
return Backbone.View.extend({
initialize : function( options ) {
var self = this;
// create frames
this.frames = new Frames.View({
visible: false,
});
// add activate icon
this.button_active = new GalaxyMastheadIcon({
options = options || {};
this.frames = new Frames.View({ visible : false });
this.setElement( this.frames.$el );
this.buttonActive = options.collection.add({
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
onclick : function() { self._activate(); },
onclick : function() {
self.active = !self.active;
self.buttonActive.set({
toggle : self.active,
show_note : self.active,
note_cls : self.active && 'fa fa-check'
});
!self.active && self.frames.hide();
},
onbeforeunload : function() {
if (self.frames.length() > 0) {
return "You opened " + self.frames.length() + " frame(s) which will be lost.";
if ( self.frames.length() > 0 ) {
return 'You opened ' + self.frames.length() + ' frame(s) which will be lost.';
}
}
});
// add load icon
this.button_load = new GalaxyMastheadIcon({
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
onclick : function(e) {
if (self.frames.visible) {
self.frames.hide();
} else {
self.frames.show();
}
},
with_number : true
this.buttonLoad = options.collection.add({
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
show_note : true,
visible : false,
onclick : function( e ) {
self.frames.visible ? self.frames.hide() : self.frames.show();
}
});
// add to masthead
if( options.masthead ){
options.masthead.append(this.button_active);
options.masthead.append(this.button_load);
}
// create
this.setElement(this.frames.$el);
// append to main
$(this.el_main).append(this.$el);
// refresh menu
this.frames.setOnChange(function() {
self._refresh();
this.frames.on( 'add remove', function() {
this.visible && this.length() == 0 && this.hide();
self.buttonLoad.set( { 'note': this.length(), 'visible': this.length() > 0 } );
}).on( 'show hide ', function() {
self.buttonLoad.set( { 'toggle': this.visible, 'icon': this.visible && 'fa-eye' || 'fa-eye-slash' } );
});
this._refresh();
},
/**
* Add a dataset to the frames.
*/
add_dataset: function(dataset_id) {
/** Add a dataset to the frames */
addDataset: function( dataset_id ) {
var self = this;
require(['mvc/dataset/data'], function(DATA) {
var dataset = new DATA.Dataset({ id: dataset_id });
require([ 'mvc/dataset/data' ], function( DATA ) {
var dataset = new DATA.Dataset( { id : dataset_id } );
$.when( dataset.fetch() ).then( function() {
// Construct frame config based on dataset's type.
var frame_config = {
@@ -87,44 +54,36 @@ var GalaxyFrame = Backbone.View.extend({
// HACK: For now, assume 'tabular' and 'interval' are the only
// modules that contain tabular files. This needs to be replaced
// will a is_datatype() function.
is_tabular = _.find(['tabular', 'interval'], function(data_type) {
return dataset.get('data_type').indexOf(data_type) !== -1;
is_tabular = _.find( [ 'tabular', 'interval' ] , function( data_type ) {
return dataset.get( 'data_type' ).indexOf( data_type ) !== -1;
});
// Use tabular chunked display if dataset is tabular; otherwise load via URL.
if (is_tabular) {
var tabular_dataset = new DATA.TabularDataset(dataset.toJSON());
_.extend(frame_config, {
type: 'other',
if ( is_tabular ) {
var tabular_dataset = new DATA.TabularDataset( dataset.toJSON() );
_.extend( frame_config, {
content: function( parent_elt ) {
DATA.createTabularDatasetChunkedView({
model: tabular_dataset,
parent_elt: parent_elt,
embedded: true,
height: '100%'
model : tabular_dataset,
parent_elt : parent_elt,
embedded : true,
height : '100%'
});
}
});
}
else {
_.extend(frame_config, {
type: 'url',
content: Galaxy.root + 'datasets/' +
dataset.id + '/display/?preview=True'
_.extend( frame_config, {
url: Galaxy.root + 'datasets/' + dataset.id + '/display/?preview=True'
});
}
self.add(frame_config);
self.add( frame_config );
});
});
},
/**
* Add a trackster visualization to the frames.
*/
add_trackster_viz: function(viz_id) {
/** Add a trackster visualization to the frames. */
addTrackster: function(viz_id) {
var self = this;
require(['viz/visualization', 'viz/trackster'], function(visualization, trackster) {
var viz = new visualization.Visualization({id: viz_id});
@@ -155,7 +114,6 @@ var GalaxyFrame = Backbone.View.extend({
id: d.dataset_id
};
});
view = ui.create_visualization(view_config,
latest_revision.config.viewport,
latest_revision.config.view.drawables,
@@ -163,183 +121,37 @@ var GalaxyFrame = Backbone.View.extend({
false);
}
};
self.add(frame_config);
});
});
},
/**
* Add and display a new frame/window based on options.
*/
add: function(options){
// open new tab
if (options.target == '_blank'){
window.open(options.content);
return;
}
// reload entire window
if (options.target == '_top' || options.target == '_parent' || options.target == '_self'){
window.location = options.content;
return;
}
// validate
if (!this.active){
// fix url if main frame is unavailable
var $galaxy_main = $(window.parent.document).find('#galaxy_main');
if (options.target == 'galaxy_main' || options.target == 'center'){
if ($galaxy_main.length === 0){
var href = options.content;
if (href.indexOf('?') == -1)
/** Add and display a new frame/window based on options. */
add: function( options ) {
if ( options.target == '_blank' ) {
window.open( options.url );
} else if ( options.target == '_top' || options.target == '_parent' || options.target == '_self' ) {
window.location = options.url;
} else if ( !this.active ) {
var $galaxy_main = $( window.parent.document ).find( '#galaxy_main' );
if ( options.target == 'galaxy_main' || options.target == 'center' ){
if ( $galaxy_main.length === 0 ){
var href = options.url;
if ( href.indexOf( '?' ) == -1 )
href += '?';
else
href += '&';
href += 'use_panels=True';
window.location = href;
} else {
$galaxy_main.attr('src', options.content);
$galaxy_main.attr( 'src', options.url );
}
} else
window.location = options.content;
// stop
return;
}
// add to frames view
this.frames.add(options);
},
// activate/disable panel
_activate: function (){
// check
if (this.active){
// disable
this.active = false;
// toggle
this.button_active.untoggle();
// hide panel
this.frames.hide();
window.location = options.url;
} else {
// activate
this.active = true;
// untoggle
this.button_active.toggle();
}
},
// update frame counter
_refresh: function(){
// update on screen counter
this.button_load.number(this.frames.length());
// check
if(this.frames.length() === 0)
this.button_load.hide();
else
this.button_load.show();
// check
if (this.frames.visible) {
this.button_load.toggle();
} else {
this.button_load.untoggle();
this.frames.add( options );
}
}
});
/** Masthead icon **/
var GalaxyMastheadIcon = Backbone.View.extend({
// icon options
options:{
id : '',
icon : 'fa-cog',
tooltip : '',
with_number : false,
onclick : function() { alert ('clicked') },
onunload : null,
visible : true
},
// location identifier for masthead class
location: 'iconbar',
// initialize
initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
// add template for icon
this.setElement($(this._template(this.options)));
// configure icon
var self = this;
$(this.el).find('.icon').tooltip({title: this.options.tooltip, placement: 'bottom'})
.on('mouseup', self.options.onclick);
// visiblity
if (!this.options.visible)
this.hide();
},
// show
show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// switch icon
icon: function (new_icon){
// update icon class
$(this.el).find('.icon').removeClass(this.options.icon)
.addClass(new_icon);
// update icon
this.options.icon = new_icon;
},
// toggle
toggle: function(){
$(this.el).addClass('toggle');
},
// untoggle
untoggle: function(){
$(this.el).removeClass('toggle');
},
// set/get number
number: function(new_number){
$(this.el).find('.number').text(new_number);
},
// fill template icon
_template: function (options){
var tmpl = '<div id="' + options.id + '" class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
if (options.with_number)
tmpl+= '<div class="number"></div>';
tmpl += '</div>';
// return template
return tmpl;
}
});
// return
return {
GalaxyFrame: GalaxyFrame,
GalaxyMastheadIcon: GalaxyMastheadIcon
};
});
@@ -209,9 +209,8 @@ var DatasetListItemEdit = _super.extend(
$links.click( function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
Galaxy.frame.add({
title : "Visualization",
type : "url",
content : $( this ).attr( 'href' )
title : 'Visualization',
url : $( this ).attr( 'href' )
});
ev.preventDefault();
ev.stopPropagation();
@@ -161,7 +161,7 @@ var DatasetListItemView = _super.extend(
displayBtnData.onclick = function( ev ){
if (Galaxy.frame && Galaxy.frame.active) {
// Add dataset to frames.
Galaxy.frame.add_dataset(self.model.get('id'));
Galaxy.frame.addDataset(self.model.get('id'));
ev.preventDefault();
}
};
File diff suppressed because it is too large Load Diff
-19
View File
@@ -127,25 +127,6 @@ function init_refresh_on_change () {
window.init_refresh_on_change = init_refresh_on_change;
$(document).ready( function() {
// Masthead dropdown menus
var $dropdowns = $("#masthead ul.nav > li.dropdown > .dropdown-menu");
$("body").on( "click.nav_popups", function( e ) {
$dropdowns.hide();
$("#dd-helper").hide();
// If the target is in the menu, treat normally
if ( $(e.target).closest( "#masthead ul.nav > li.dropdown > .dropdown-menu" ).length ) {
return;
}
// Otherwise, was the click in a tab
var $clicked = $(e.target).closest( "#masthead ul.nav > li.dropdown" );
if ( $clicked.length ) {
$("#dd-helper").show();
$clicked.children( ".dropdown-menu" ).show();
e.preventDefault();
}
});
// Refresh events for form fields.
init_refresh_on_change();
+27 -47
View File
@@ -31,7 +31,6 @@
@import "toastr.less";
@import "jstree.less";
// Mixins
.unselectable {
.user-select(none);
@@ -69,7 +68,6 @@ body {
width: 100%;
height: 100%;
}
}
// ==== Panel layout styles ====
@@ -103,6 +101,7 @@ body {
overflow: hidden;
border-bottom: solid #999 1px;
font-size: 90%;
display: none;
}
#inactivebox {
@@ -114,6 +113,7 @@ body {
overflow: hidden;
border-bottom: solid #999 1px;
font-size: 90%;
display: none;
}
// Panels
@@ -337,6 +337,7 @@ div.unified-panel-body-background {
left: 0;
width: 100%;
height: 100%;
display: none;
}
// Messages for message box, slightly different style
@@ -372,20 +373,17 @@ div.unified-panel-body-background {
}
// Masthead
#masthead {
position:absolute;
top:0;
left:0;
width:100%;
min-width:990px;
padding: 0;
margin-bottom: 0px;
.nav {
z-index: 15001;
}
.nav > li > a {
cursor: pointer;
text-decoration: none;
@@ -393,22 +391,10 @@ div.unified-panel-body-background {
color: gold;
}
}
//.dropdown-menu {
// z-index: 15002;
//}
li.dropdown > a:hover .caret {
border-top-color: gold;
border-bottom-color: gold;
}
.navbar-brand {
position: absolute;
left: 0;
top: 0;
font-family: verdana;
font-weight: bold;
font-size: 20px;
@@ -418,53 +404,47 @@ div.unified-panel-body-background {
padding: 5px 20px 12px;
margin-left: -15px;
z-index: 2000;
img {
display: inline;
width: 26px;
vertical-align: top;
margin-left: 0.35em;
border: none;
}
a {
color: white;
text-decoration: none;
}
}
.iconbar
{
position : absolute;
top : 7px;
right : 110px;
cursor : pointer;
color : @gray-light;
overflow : hidden;
.symbol
{
float : left;
margin : 0px 10px;
font-size : 11px;
.navbar-header {
position: relative;
right: -50%;
float: left;
.navbar-tabs {
display: block;
position: relative;
right: 50%;
}
.symbol .number
{
}
.navbar-tabs {
.toggle {
color : gold;
}
.dropdown-note {
font-weight : bold;
font-size : 10px;
font-family : @font-family-sans-serif;
position : relative;
left : 23px;
top : -12px;
}
.toggle
{
position : absolute;
left : 35px;
top : 20px;
color : gold;
}
}
li.dropdown > a:hover .caret {
border-top-color: gold;
border-bottom-color: gold;
}
}
.quota-meter-container {
position: absolute;
top: 0;
-1
View File
@@ -11,7 +11,6 @@
.frame-background {
z-index : @zindex-navbar;
position : absolute;
display : none;
top : 0px;
left : 0px;
height : 100%;
-65
View File
@@ -1,65 +0,0 @@
@import "galaxy_bootstrap/variables.less";
@import "galaxy_variables.less";
body
{
background: @navbar-inverse-bg;
color: @navbar-inverse-color;
padding: 0;
border: 0;
margin: 3px;
margin-right: 5px;
margin-left: 5px;
overflow: hidden;
}
div.pageTitle
{
font-size: 175%;
font-weight: bold;
}
div.pageTitle a:link, div.pageTitle a:visited, div.pageTitle a:active, div.pageTitle a:hover
{
text-decoration: none;
}
a:link, a:visited, a:active
{
color: $masthead_link;
}
#tab-bar-bottom
{
z-index: -1;
position:absolute;
top:27px; left: 0;
width: 100%;
height: 100%;
background: @navbar-inverse-link-active-bg;
}
span.link-group
{
margin: 0;
padding: 0;
display: inline;
padding-bottom: 10px;
margin-bottom: -10px;
}
span.link-group span
{
margin: 0;
padding: 0;
display: inline;
}
span.link-group span.active-link
{
background: @navbar-inverse-link-active-bg;
padding-left: 3px; padding-right: 3px;
margin-left: -3px; margin-right: -3px;
padding-bottom: 10px;
margin-bottom: -10px;
}
+1
View File
@@ -68,6 +68,7 @@
}
.ui-modal {
display: none;
.modal-header.no-separator {
border: none !important;
padding-bottom: 0px !important;
@@ -51,9 +51,14 @@
root : '${root}',
app_root : '${app_root}'
};
// link galaxy
var Galaxy = Galaxy || parent.Galaxy;
var Galaxy = Galaxy || parent.Galaxy || {
root : '${root}',
emit : {
debug: function() {}
}
};
// console protection
window.console = window.console || {
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"masthead.js","sources":["../../src/layout/masthead.js"],"names":["define","Utils","Menu","Scratchbook","QuotaMeter","GalaxyMasthead","Backbone","View","extend","el_masthead","options","$background","list","initialize","this","$","off","setElement","_template","replaceWith","$el","el","find","self","window","on","e","$download_link","target","closest","length","append","attr","preventDefault","text","key","onbeforeunload","q","menu","Galaxy","GalaxyMenu","masthead","config","frame","GalaxyFrame","quotaMeter","UserQuotaMeter","model","user","render","events","click","mousedown","item","_add","prepend","highlight","id","current","addClass","$loc","location","$current","push","_click","$all","hide","hasClass","show","brand_text","brand","logo_url","root"],"mappings":"AAAAA,QACI,cACA,cACA,qBACA,4BACD,SAASC,EAAOC,EAAMC,EAAaC,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AM,IAI3BG,UAAW,SAASC,GAChB,GAAIC,GAAU3C,EAAED,KAAKO,IAAIC,KAAK,IAAMmC,EAAK,OACrCC,IACAA,EAAQC,SAAS,WAKzBL,KAAO,SAASD,EAAMtB,GAClB,GAAI6B,GAAO7C,EAAED,KAAKO,IAAIC,KAAK,IAAM+B,EAAKQ,SACtC,IAAID,EAAK,CAEL,GAAIE,GAAW/C,EAAEsC,EAAKhC,GAGtByC,GAASH,SAAS,iBAGd5B,EACA6B,EAAK7B,OAAO+B,GAEZF,EAAKL,QAAQO,GAIjBhD,KAAKF,KAAKmD,KAAKV,GAInB,MAAO,OAIXW,OAAQ,SAAStC,GAEb,GAAIuC,GAAOlD,EAAED,KAAKO,IAAIC,KAAK,SACvB2C,IACAA,EAAKC,MAIT,IAAIJ,GAAW/C,EAAEW,EAAEE,QAAQC,QAAQ,kBAAkBP,KAAK,SACtDP,GAAEW,EAAEE,QAAQuC,SAAS,SACrBL,EAASM,OACTtD,KAAKH,YAAYyD,QAEjBtD,KAAKH,YAAYuD,QASzBhD,UAAW,SAASR,GAChB,GAAI2D,GAAa3D,EAAQ4D,MAAS,KAAO5D,EAAQ4D,MAAS,EAC1D,OAAQ,6PAKsB5D,EAAQ6D,SAAW,uDAC0BhC,OAAOiC,KAAO,iEACvCH,EAAa,sPAYvE,QACIhE,eAAgBA"}
{"version":3,"file":"masthead.js","sources":["../../src/layout/masthead.js"],"names":["define","Utils","Menu","Scratchbook","QuotaMeter","View","Backbone","extend","initialize","options","self","this","setElement","_template","$navbarBrandLink","$","$navbarBrandImage","$navbarBrandTitle","$navbarTabs","$quoteMeter","collection","Collection","on","model","append","Tab","render","$el","empty","callback","each","m","fetch","Galaxy","frame","quotaMeter","UserQuotaMeter","user","el","window","e","$download_link","target","closest","length","attr","hide","preventDefault","text","q","get","html","brand","logo_url","root"],"mappings":"AAAAA,QACI,cACA,cACA,qBACA,4BACD,SAAUC,EAAOC,EAAMC,EAAaC,GAGvC,GAAIC,GAAOC,SAASD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AAK,mBACpDD,KAAOD,GAAQC,EAAI,OAET,KAATD,EACMA,EADX,UAMRtB,OAAQ,WAKJ,MAJAf,MAAKM,kBAAkBkC,KAAM,WAAcxC,KAAKF,QAAQ2C,OAAS,KAAOzC,KAAKF,QAAQ2C,OAAS,KAC9FzC,KAAKG,iBAAiB+B,KAAM,OAAQlC,KAAKF,QAAQ4C,UACjD1C,KAAKK,kBAAkB6B,KAAM,MAAOZ,OAAOqB,KAAO,uCAClD3C,KAAKwB,WAAWT,SACTf,MAIXE,UAAW,WACP,MAAQ,2UAgBhB,QACIR,KAAMA"}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"page.js","sources":["../../src/layout/page.js"],"names":["define","MASTHEAD","PANEL","MODAL","BASE_MVC","PageLayoutView","Backbone","View","extend","LoggableMixin","_logNamespace","el","className","_panelIds","defaultOptions","message_box_visible","message_box_content","message_box_class","show_inactivity_warning","inactivity_box_content","initialize","options","this","log","_","pick","defaults","omit","Galaxy","modal","$everything","$","render","$el","attr","html","template","append","masthead","GalaxyMasthead","config","get","messageBox","inactivityWarning","renderPanels","content","level","addClass","toggle","verificationLink","root","page","remove","forEach","panelId","has","panelView","setElement","left","center","css","right","join","hideSidePanels","hide","toString"],"mappings":"AAAAA,QACI,kBACA,eACA,kBACA,gBACD,SAAUC,EAAUC,EAAOC,EAAOC,GAGrC,GAAIC,GAAiBC,SAASC,KAAKC,OAAQJ,EAASK,eAAgBD,QAChEE,cAAgB,SAEhBC,GAAK,OACLC,UAAY,eAEZC,WACI,OAAQ,SAAU,SAGtBC,gBACIC,qBAAsB,EACtBC,oBAAsB,GACtBC,kBAAsB,OAEtBC,yBAA0B,EAC1BC,uBAA0B,IAG9BC,WAAa,SAAUC,GACnBC,KAAKC,IAAKD,KAAO,eAAgBD,GACjCG,EAAEhB,OAAQc,KAAME,EAAEC,KAAMJ,EAASC,KAAKT,YACtCS,KAAKD,QAAUG,EAAEE,SAAUF,EAAEG,KAAMN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MACNpC,KAAKqC,OAAO1B,IAAI2B,IAAK,OAAQ,GAE5BtC,KAAKuC,OACNvC,KAAKqC,OAAO1B,IAAI2B,IAAK,QAAS,GAE3BtC,MAKXc,SAAU,WAEN,OACI,gGACI,yBACA,2EACA,qDACA,oFAGAd,KAAKoC,KAAQ,mBAAqB,GAClCpC,KAAKqC,OAAQ,qCAAuC,GACpDrC,KAAKuC,MAAQ,oBAAsB,GACvC,SAEA,oDAEA,aACI,4DACI,QACI,wDACA,QACI,gFACA,iDACJ,SACJ,SACJ,SACJ,eACFC,KAAK,KAGXC,eAAiB,WACTzC,KAAKoC,MACLpC,KAAKoC,KAAKM,OAEV1C,KAAKuC,OACLvC,KAAKuC,MAAMG,QAInBC,SAAW,WAAY,MAAO,mBAI9B,QACI5D,eAAgBA"}
{"version":3,"file":"page.js","sources":["../../src/layout/page.js"],"names":["define","Masthead","Panel","Modal","BaseMVC","PageLayoutView","Backbone","View","extend","LoggableMixin","_logNamespace","el","className","_panelIds","defaultOptions","message_box_visible","message_box_content","message_box_class","show_inactivity_warning","inactivity_box_content","initialize","options","this","log","_","pick","defaults","omit","Galaxy","modal","masthead","config","$el","attr","append","_template","$messagebox","$","$inactivebox","render","remove","renderMessageBox","renderInactivityBox","renderPanels","content","level","addClass","html","toggle","show","removeClass","hide","verificationLink","root","page","forEach","panelId","has","setElement","center","join","toString"],"mappings":"AAAAA,QACI,kBACA,eACA,kBACA,gBACD,SAAUC,EAAUC,EAAOC,EAAOC,GAGrC,GAAIC,GAAiBC,SAASC,KAAKC,OAAQJ,EAAQK,eAAgBD,QAC/DE,cAAgB,SAEhBC,GAAK,OACLC,UAAY,eAEZC,WACI,OAAQ,SAAU,SAGtBC,gBACIC,qBAA0B,EAC1BC,oBAA0B,GAC1BC,kBAA0B,OAC1BC,yBAA0B,EAC1BC,uBAA0B,IAG9BC,WAAa,SAAUC,GAEnBC,KAAKC,IAAKD,KAAO,eAAgBD,GACjCG,EAAEhB,OAAQc,KAAME,EAAEC,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B,KAAKgB,aAAaa,MAEtB,OAAO7B,OAIXqB,aAAe,WACX,GAAIW,GAAOhC,IASX,OARAA,MAAKT,UAAU0C,QAAS,SAAUC,GAC1BhC,EAAEiC,IAAKH,EAAME,IACbF,EAAME,GAAUE,WAAY,IAAMF,GAClCF,EAAME,GAAUjB,UACI,WAAZiB,GACRF,EAAKK,OAAO3B,IAAKwB,EAAS,KAG3BlC,MAIXa,UAAW,WACP,OACI,wBACI,yBACA,yBACA,wDACA,mBACA,qCACA,oBACJ,SACA,wBACA,aACI,4DACI,QACI,wDACA,QACI,gFACA,iDACJ,SACJ,SACJ,SACJ,eACFyB,KAAK,KAGXC,SAAW,WAAa,MAAO,mBAI/B,QACIxD,eAAgBA"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"scratchbook.js","sources":["../../src/layout/scratchbook.js"],"names":["define","Frames","GalaxyFrame","Backbone","View","extend","el_main","active","button_active","button_load","initialize","options","self","this","frames","visible","GalaxyMastheadIcon","icon","tooltip","onclick","_activate","onbeforeunload","length","hide","show","with_number","masthead","append","setElement","$el","$","setOnChange","_refresh","add_dataset","dataset_id","require","DATA","dataset","Dataset","id","when","fetch","then","frame_config","title","get","is_tabular","_","find","data_type","indexOf","tabular_dataset","TabularDataset","toJSON","type","content","parent_elt","createTabularDatasetChunkedView","model","embedded","height","Galaxy","root","add","add_trackster_viz","viz_id","visualization","trackster","viz","Visualization","ui","TracksterUI","view_config","container","name","dbkey","stand_alone","latest_revision","drawables","config","view","each","d","hda_ldda","create_visualization","viewport","bookmarks","target","window","open","location","$galaxy_main","parent","document","href","attr","untoggle","toggle","number","alert","onunload","defaults","_template","el","placement","on","css","visibility","new_icon","removeClass","addClass","new_number","text","tmpl"],"mappings":"AACAA,QAAQ,oBAAqB,SAASC,GAGtC,GAAIC,GAAcC,SAASC,KAAKC,QAE5BC,QAAS,OAGTC,QAAQ,EAGRC,cAAe,KAGfC,YAAe,KAGfC,WAAa,SAASC,GAClBA,EAAUA,KAGV,IA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GAIxBX,OAAQ,WACJnE,EAAEjB,KAAK0F,IAAIO,SAAS,WAIxBd,SAAU,WACNlE,EAAEjB,KAAK0F,IAAIM,YAAY,WAI3BX,OAAQ,SAASa,GACbjF,EAAEjB,KAAK0F,IAAIvD,KAAK,WAAWgE,KAAKD,IAIpCT,UAAW,SAAU3F,GACjB,GAAIsG,GAAQ,YAActG,EAAQ4B,GAAK,8CACQ5B,EAAQM,KAAO,UAM9D,OALIN,GAAQc,cACRwF,GAAY,8BAChBA,GAAY,WAQpB,QACI/G,YAAaA,EACbc,mBAAoBA"}
{"version":3,"file":"scratchbook.js","sources":["../../src/layout/scratchbook.js"],"names":["define","Frames","Backbone","View","extend","initialize","options","self","this","frames","visible","setElement","$el","buttonActive","collection","add","icon","tooltip","onclick","active","set","toggle","show_note","note_cls","hide","onbeforeunload","length","buttonLoad","show","on","note","addDataset","dataset_id","require","DATA","dataset","Dataset","id","$","when","fetch","then","frame_config","title","get","is_tabular","_","find","data_type","indexOf","tabular_dataset","TabularDataset","toJSON","content","parent_elt","createTabularDatasetChunkedView","model","embedded","height","url","Galaxy","root","addTrackster","viz_id","visualization","trackster","viz","Visualization","ui","TracksterUI","type","view_config","container","name","dbkey","stand_alone","latest_revision","drawables","config","view","each","d","hda_ldda","create_visualization","viewport","bookmarks","target","window","open","location","$galaxy_main","parent","document","href","attr"],"mappings":"AACAA,QAAS,oBAAsB,SAAUC,GACzC,MAAOC,UAASC,KAAKC,QACjBC,WAAa,SAAUC,GACnB,GAAIC,GAAOC,IACXF,GAAUA,MACVE,KAAKC,OAAS,GAAIR,GAAOE,MAAOO,SAAU,IAC1CF,KAAKG,WAAYH,KAAKC,OAAOG,KAC7BJ,KAAKK,aAAeP,EAAQQ,WAAWC,KACnCC,KAAkB,QAClBC,QAAkB,6BAClBC,QAAkB,WACdX,EAAKY,QAAUZ,EAAKY,OACpBZ,EAAKM,aAAaO,KACdC,OAAYd,EAAKY,OACjBG,UAAYf,EAAKY,OACjBI,SAAYhB,E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AAaI,KAAM,MAAOxF,EAAQqD,SAGtC4B,QAAOE,SAAWnF,EAAQqD"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"onload.js","sources":["../src/onload.js"],"names":["replace_big_select_inputs","min_length","max_length","select_elts","refresh_select2","element","select_elt","$","options","placeholder","closeOnSelect","is","dropdownAutoWidth","containerCssClass","select2","jQuery","fn","undefined","each","this","not","num_options","find","length","hasClass","init_refresh_on_change","off","change","select_field","select_val","val","ref_on_change_vals","attr","split","last_selected_value","inArray","window","trigger","document","get","form","submit","click","confirm","_","Backbone","Handlebars","panels","require","extend","async_save_text","POPUPMENU","make_popupmenu","make_popup_menus","init_tag_click_function","ready","$dropdowns","on","e","hide","target","closest","$clicked","show","children","preventDefault","tooltip","placement","anchor","galaxy_main_exists","parent","frames","galaxy_main","href","indexOf"],"mappings":"AA4BA,QAASA,2BAA0BC,EAAYC,EAAYC,GAEvD,QAASC,GAAiBC,GACtB,GAAIC,GAAaC,EAAEF,GACfG,GAAYC,YAAY,kBACZC,eAAgBJ,EAAWK,GAAG,cAC9BC,mBAAsB,EACtBC,kBAAmB,mBAEnC,OAAOR,GAAQS,QAASN,GAIvBO,OAAOC,GAAGF,UAKIG,SAAfhB,IACAA,EAAa,IAEEgB,SAAff,IACAA,EAAa,KAGjBC,EAAcA,GAAeI,EAAE,UAE/BJ,EAAYe,KAAM,WACd,GAAIZ,GAAaC,EAAEY,MAAMC,IAAI,cAEzBC,EAAcf,EAAWgB,KAAK,UAAUC,MACxBtB,GAAdoB,GAA8BA,EAAcnB,GAI9CI,EAAWkB,SAAS,oBAWxBpB,EAAiBE,MAKzB,QAASmB,0BACLlB,EAAE,oCACGmB,IAAI,UACJC,OAAO,WACJ,GAAIC,GAAerB,EAAEY,MACjBU,EAAaD,EAAaE,MAE1BC,EAAqBH,EAAaI,KAAK,2BAC3C,IAAID,EAAoB,CACpBA,EAAqB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,EAAEE,QAAQC,QAAS,mDAAoDtC,OAA9E,CAIA,GAAIuC,GAAWvD,EAAEmD,EAAEE,QAAQC,QAAS,iCAC/BC,GAASvC,SACVhB,EAAE,cAAcwD,OAChBD,EAASE,SAAU,kBAAmBD,OACtCL,EAAEO,qBAKVxC,yBAGKlB,EAAES,GAAGkD,UAEN3D,EAAE,iCAAiC2D,SAAWC,UAAW,WAIzD5D,EAAE,WAAW2D,WAGjBb,mBAGArD,0BAA0B,GAAI,MAI9BO,EAAE,KAAKmC,MAAO,WACV,GAAI0B,GAAS7D,EAAEY,MACXkD,EAAsBC,OAAOC,QAAUD,OAAOC,OAAOC,WACzD,IAAkC,eAA3BJ,EAAOpC,KAAM,YAAoCqC,EAAuB,CAC3E,GAAII,GAAOL,EAAOpC,KAAK,OAEnByC,IADqB,IAArBA,EAAKC,QAAQ,KACL,IAGA,IAEZD,GAAQ,kBACRL,EAAOpC,KAAK,OAAQyC,GACpBL,EAAOpC,KAAK,SAAU,SAE1B,MAAOoC"}
{"version":3,"file":"onload.js","sources":["../src/onload.js"],"names":["replace_big_select_inputs","min_length","max_length","select_elts","refresh_select2","element","select_elt","$","options","placeholder","closeOnSelect","is","dropdownAutoWidth","containerCssClass","select2","jQuery","fn","undefined","each","this","not","num_options","find","length","hasClass","init_refresh_on_change","off","change","select_field","select_val","val","ref_on_change_vals","attr","split","last_selected_value","inArray","window","trigger","document","get","form","submit","click","confirm","_","Backbone","Handlebars","panels","require","extend","async_save_text","POPUPMENU","make_popupmenu","make_popup_menus","init_tag_click_function","ready","tooltip","placement","anchor","galaxy_main_exists","parent","frames","galaxy_main","href","indexOf"],"mappings":"AA4BA,QAASA,2BAA0BC,EAAYC,EAAYC,GAEvD,QAASC,GAAiBC,GACtB,GAAIC,GAAaC,EAAEF,GACfG,GAAYC,YAAY,kBACZC,eAAgBJ,EAAWK,GAAG,cAC9BC,mBAAsB,EACtBC,kBAAmB,mBAEnC,OAAOR,GAAQS,QAASN,GAIvBO,OAAOC,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ClBT,OAAOU,WAAaA,WAIpBV,OAAOW,OAASC,QAAS,gBAEzBJ,EAAEK,OAAQb,OAAQY,QAAS,iBAC3BZ,OAAOc,gBAAkBF,QAAS,wBAClC,IAAIG,WAAYH,QAAS,eACzBZ,QAAOgB,eAAiBD,UAAUC,eAClChB,OAAOiB,iBAAmBF,UAAUE,iBACpCjB,OAAOkB,wBAA0BN,QAAS,sBAyG1CZ,OAAOX,uBAAyBA,uBAEhClB,EAAE+B,UAAUiB,MAAO,WAEf9B,yBAGKlB,EAAES,GAAGwC,UAENjD,EAAE,iCAAiCiD,SAAWC,UAAW,WAIzDlD,EAAE,WAAWiD,WAGjBH,mBAGArD,0BAA0B,GAAI,MAI9BO,EAAE,KAAKmC,MAAO,WACV,GAAIgB,GAASnD,EAAEY,MACXwC,EAAsBC,OAAOC,QAAUD,OAAOC,OAAOC,WACzD,IAAkC,eAA3BJ,EAAO1B,KAAM,YAAoC2B,EAAuB,CAC3E,GAAII,GAAOL,EAAO1B,KAAK,OAEnB+B,IADqB,IAArBA,EAAKC,QAAQ,KACL,IAGA,IAEZD,GAAQ,kBACRL,EAAO1B,KAAK,OAAQ+B,GACpBL,EAAO1B,KAAK,SAAU,SAE1B,MAAO0B"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","layout/menu","layout/scratchbook","mvc/user/user-quotameter"],function(a,b,c,d){var e=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(a){this.options=a,$("body").off(),this.setElement($(this._template(a))),$("#masthead").replaceWith(this.$el),this.$background=$(this.el).find("#masthead-background");var e=this;$(window).on("click",function(a){var b=$(a.target).closest("a[download]");1==b.length&&(0===$("iframe[id=download]").length&&$("body").append($('<iframe id="download" style="display: none;" />')),$("iframe[id=download]").attr("src",b.attr("href")),a.preventDefault())}).on("beforeunload",function(){var a="";for(var b in e.list)if(e.list[b].options.onbeforeunload){var c=e.list[b].options.onbeforeunload();c&&(a+=c+" ")}return""!==a?a:void 0}),this.menu=Galaxy.menu=new b.GalaxyMenu({masthead:this,config:this.options}),this.frame=Galaxy.frame=new c.GalaxyFrame({masthead:this}),this.quotaMeter=Galaxy.quotaMeter=new d.UserQuotaMeter({model:Galaxy.user,el:this.$(".quota-meter-container")}).render()},events:{click:"_click",mousedown:function(a){a.preventDefault()}},append:function(a){return this._add(a,!0)},prepend:function(a){return this._add(a,!1)},highlight:function(a){var b=$(this.el).find("#"+a+"> li");b&&b.addClass("active")},_add:function(a,b){var c=$(this.el).find("#"+a.location);if(c){var d=$(a.el);d.addClass("masthead-item"),b?c.append(d):c.prepend(d),this.list.push(a)}return null},_click:function(a){var b=$(this.el).find(".popup");b&&b.hide();var c=$(a.target).closest(".masthead-item").find(".popup");$(a.target).hasClass("head")?(c.show(),this.$background.show()):this.$background.hide()},_template:function(a){var b=a.brand?"/ "+a.brand:"";return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+a.logo_url+'"><img style="margin-left: 0.35em;" border="0" src="'+Galaxy.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+b+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});return{GalaxyMasthead:e}});
define(["utils/utils","layout/menu","layout/scratchbook","mvc/user/user-quotameter"],function(a,b,c,d){var e=Backbone.View.extend({initialize:function(a){var e=this;this.options=a,this.setElement(this._template()),this.$navbarBrandLink=this.$(".navbar-brand-link"),this.$navbarBrandImage=this.$(".navbar-brand-image"),this.$navbarBrandTitle=this.$(".navbar-brand-title"),this.$navbarTabs=this.$(".navbar-tabs"),this.$quoteMeter=this.$(".quota-meter-container"),this.collection=new b.Collection,this.collection.on("add",function(a){e.$navbarTabs.append(new b.Tab({model:a}).render().$el)}).on("reset",function(){e.$navbarTabs.empty()}).on("dispatch",function(a){e.collection.each(function(b){a(b)})}).fetch(this.options),Galaxy.frame=this.frame=new c({collection:this.collection}),$("body").append(this.frame.$el),Galaxy.quotaMeter=this.quotaMeter=new d.UserQuotaMeter({model:Galaxy.user,el:this.$quoteMeter}),$(window).on("click",function(a){var b=$(a.target).closest("a[download]");1==b.length&&(0===$("iframe[id=download]").length&&$("body").append($("<iframe/>").attr("id","download").hide()),$("iframe[id=download]").attr("src",b.attr("href")),a.preventDefault())}).on("beforeunload",function(){var a="";return e.collection.each(function(b){var c=b.get("onbeforeunload")&&b.get("onbeforeunload")();c&&(a+=c+" ")}),""!==a?a:void 0})},render:function(){return this.$navbarBrandTitle.html("Galaxy "+(this.options.brand&&"/ "+this.options.brand||"")),this.$navbarBrandLink.attr("href",this.options.logo_url),this.$navbarBrandImage.attr("src",Galaxy.root+"static/images/galaxyIcon_noText.png"),this.quotaMeter.render(),this},_template:function(){return'<div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div class="navbar-header"><div class="navbar-tabs"/></div><div class="navbar-brand"><a class="navbar-brand-link"><img class="navbar-brand-image"/><span class="navbar-brand-title"/></a></div><div class="quota-meter-container"/><div class="navbar-icons"/></div>'}});return{View:e}});
//# sourceMappingURL=../../maps/layout/masthead.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["layout/masthead","layout/panel","mvc/ui/ui-modal","mvc/base-mvc"],function(a,b,c,d){var e=Backbone.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",el:"body",className:"full-content",_panelIds:["left","center","right"],defaultOptions:{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""},initialize:function(a){this.log(this+".initialize:",a),_.extend(this,_.pick(a,this._panelIds)),this.options=_.defaults(_.omit(a,this._panelIds),this.defaultOptions),Galaxy.modal=this.modal=new c.View},$everything:function(){return this.$("#everything")},render:function(){return this.log(this+".render:"),this.$el.attr("scroll","no"),this.$el.html(this.template(this.options)),this.$el.append(this.modal.$el),Galaxy.masthead=this.masthead=new a.GalaxyMasthead(_.extend(this.options.config,{el:this.$("#masthead").get(0)})),this.options.message_box_visible&&this.messageBox(this.options.message_box_content,this.options.message_box_class),this.options.show_inactivity_warning&&this.inactivityWarning(this.options.inactivity_box_content),this.renderPanels(),this},messageBox:function(a,b){return a=a||"",b=b||"info",this.$el.addClass("has-message-box"),this.$("#messagebox").attr("class","panel-"+b+"-message").html(a).toggle(!!a),this},inactivityWarning:function(a){var b='<a href="'+Galaxy.root+'user/resend_verification">Resend verification.</a>';return this.$el.addClass("has-inactivity-box"),this.$("#inactivebox").html(a).append(" "+b).toggle(!!a),this},renderPanels:function(){var a=this;return $(".select2-hidden-accessible").remove(),this._panelIds.forEach(function(b){if(_.has(a,b)){var c=a[b];c.setElement("#"+b),c.render()}}),this.left||this.center.$el.css("left",0),this.right||this.center.$el.css("right",0),this},template:function(){return['<div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">','<div id="background"/>','<div id="masthead" class="navbar navbar-fixed-top navbar-inverse"></div>','<div id="messagebox" style="display: none;"></div>','<div id="inactivebox" class="panel-warning-message" style="display: none;"></div>',this.left?'<div id="left"/>':"",this.center?'<div id="center" class="inbound"/>':"",this.right?'<div id="right"/>':"","</div>",'<div id="dd-helper" style="display: none;"></div>',"<noscript>",'<div class="overlay overlay-background noscript-overlay">',"<div>",'<h3 class="title">Javascript Required for Galaxy</h3>',"<div>","The Galaxy analysis interface requires a browser with Javascript enabled.<br>","Please enable Javascript and refresh this page","</div>","</div>","</div>","</noscript>"].join("")},hideSidePanels:function(){this.left&&this.left.hide(),this.right&&this.right.hide()},toString:function(){return"PageLayoutView"}});return{PageLayoutView:e}});
define(["layout/masthead","layout/panel","mvc/ui/ui-modal","mvc/base-mvc"],function(a,b,c,d){var e=Backbone.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",el:"body",className:"full-content",_panelIds:["left","center","right"],defaultOptions:{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""},initialize:function(b){this.log(this+".initialize:",b),_.extend(this,_.pick(b,this._panelIds)),this.options=_.defaults(_.omit(b,this._panelIds),this.defaultOptions),Galaxy.modal=this.modal=new c.View,this.masthead=new a.View(this.options.config),this.$el.attr("scroll","no"),this.$el.append(this._template()),this.$el.append(this.masthead.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox")},render:function(){return $(".select2-hidden-accessible").remove(),this.log(this+".render:"),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this},renderMessageBox:function(){if(this.options.message_box_visible){var a=this.options.message_box_content||"",b=this.options.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+b+"-message").html(a).toggle(!!a).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.options.show_inactivity_warning){var a=this.options.inactivity_box_content||"",b=$("<a/>").attr("href",Galaxy.root+"user/resend_verification").html("Resend verification.");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(a).append(" "+b).toggle(!!a).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var a=this;return this._panelIds.forEach(function(b){_.has(a,b)?(a[b].setElement("#"+b),a[b].render()):"center"!==b&&a.center.$el(b,0)}),this},_template:function(){return['<div id="everything">','<div id="background"/>','<div id="messagebox"/>','<div id="inactivebox" class="panel-warning-message"/>','<div id="left"/>','<div id="center" class="inbound"/>','<div id="right"/>',"</div>",'<div id="dd-helper"/>',"<noscript>",'<div class="overlay overlay-background noscript-overlay">',"<div>",'<h3 class="title">Javascript Required for Galaxy</h3>',"<div>","The Galaxy analysis interface requires a browser with Javascript enabled.<br>","Please enable Javascript and refresh this page","</div>","</div>","</div>","</noscript>"].join("")},toString:function(){return"PageLayoutView"}});return{PageLayoutView:e}});
//# sourceMappingURL=../../maps/layout/page.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/ui/ui-frames"],function(a){var b=Backbone.View.extend({el_main:"body",active:!1,button_active:null,button_load:null,initialize:function(b){b=b||{};var d=this;this.frames=new a.View({visible:!1}),this.button_active=new c({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",onclick:function(){d._activate()},onbeforeunload:function(){return d.frames.length()>0?"You opened "+d.frames.length()+" frame(s) which will be lost.":void 0}}),this.button_load=new c({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",onclick:function(){d.frames.visible?d.frames.hide():d.frames.show()},with_number:!0}),b.masthead&&(b.masthead.append(this.button_active),b.masthead.append(this.button_load)),this.setElement(this.frames.$el),$(this.el_main).append(this.$el),this.frames.setOnChange(function(){d._refresh()}),this._refresh()},add_dataset:function(a){var b=this;require(["mvc/dataset/data"],function(c){var d=new c.Dataset({id:a});$.when(d.fetch()).then(function(){var a={title:d.get("name")},e=_.find(["tabular","interval"],function(a){return-1!==d.get("data_type").indexOf(a)});if(e){var f=new c.TabularDataset(d.toJSON());_.extend(a,{type:"other",content:function(a){c.createTabularDatasetChunkedView({model:f,parent_elt:a,embedded:!0,height:"100%"})}})}else _.extend(a,{type:"url",content:Galaxy.root+"datasets/"+d.id+"/display/?preview=True"});b.add(a)})})},add_trackster_viz:function(a){var b=this;require(["viz/visualization","viz/trackster"],function(c,d){var e=new c.Visualization({id:a});$.when(e.fetch()).then(function(){var a=new d.TracksterUI(Galaxy.root),c={title:e.get("name"),type:"other",content:function(b){var c={container:b,name:e.get("title"),id:e.id,dbkey:e.get("dbkey"),stand_alone:!1},d=e.get("latest_revision"),f=d.config.view.drawables;_.each(f,function(a){a.dataset={hda_ldda:a.hda_ldda,id:a.dataset_id}}),view=a.create_visualization(c,d.config.viewport,d.config.view.drawables,d.config.bookmarks,!1)}};b.add(c)})})},add:function(a){if("_blank"==a.target)return void window.open(a.content);if("_top"==a.target||"_parent"==a.target||"_self"==a.target)return void(window.location=a.content);if(this.active)this.frames.add(a);else{var b=$(window.parent.document).find("#galaxy_main");if("galaxy_main"==a.target||"center"==a.target)if(0===b.length){var c=a.content;c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",window.location=c}else b.attr("src",a.content);else window.location=a.content}},_activate:function(){this.active?(this.active=!1,this.button_active.untoggle(),this.frames.hide()):(this.active=!0,this.button_active.toggle())},_refresh:function(){this.button_load.number(this.frames.length()),0===this.frames.length()?this.button_load.hide():this.button_load.show(),this.frames.visible?this.button_load.toggle():this.button_load.untoggle()}}),c=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:!1,onclick:function(){alert("clicked")},onunload:null,visible:!0},location:"iconbar",initialize:function(a){a&&(this.options=_.defaults(a,this.options)),this.setElement($(this._template(this.options)));var b=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",b.options.onclick),this.options.visible||this.hide()},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(a){$(this.el).find(".icon").removeClass(this.options.icon).addClass(a),this.options.icon=a},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(a){$(this.el).find(".number").text(a)},_template:function(a){var b='<div id="'+a.id+'" class="symbol"><div class="icon fa fa-2x '+a.icon+'"></div>';return a.with_number&&(b+='<div class="number"></div>'),b+="</div>"}});return{GalaxyFrame:b,GalaxyMastheadIcon:c}});
define(["mvc/ui/ui-frames"],function(a){return Backbone.View.extend({initialize:function(b){var c=this;b=b||{},this.frames=new a.View({visible:!1}),this.setElement(this.frames.$el),this.buttonActive=b.collection.add({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",onclick:function(){c.active=!c.active,c.buttonActive.set({toggle:c.active,show_note:c.active,note_cls:c.active&&"fa fa-check"}),!c.active&&c.frames.hide()},onbeforeunload:function(){return c.frames.length()>0?"You opened "+c.frames.length()+" frame(s) which will be lost.":void 0}}),this.buttonLoad=b.collection.add({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",show_note:!0,visible:!1,onclick:function(){c.frames.visible?c.frames.hide():c.frames.show()}}),this.frames.on("add remove",function(){this.visible&&0==this.length()&&this.hide(),c.buttonLoad.set({note:this.length(),visible:this.length()>0})}).on("show hide ",function(){c.buttonLoad.set({toggle:this.visible,icon:this.visible&&"fa-eye"||"fa-eye-slash"})})},addDataset:function(a){var b=this;require(["mvc/dataset/data"],function(c){var d=new c.Dataset({id:a});$.when(d.fetch()).then(function(){var a={title:d.get("name")},e=_.find(["tabular","interval"],function(a){return-1!==d.get("data_type").indexOf(a)});if(e){var f=new c.TabularDataset(d.toJSON());_.extend(a,{content:function(a){c.createTabularDatasetChunkedView({model:f,parent_elt:a,embedded:!0,height:"100%"})}})}else _.extend(a,{url:Galaxy.root+"datasets/"+d.id+"/display/?preview=True"});b.add(a)})})},addTrackster:function(a){var b=this;require(["viz/visualization","viz/trackster"],function(c,d){var e=new c.Visualization({id:a});$.when(e.fetch()).then(function(){var a=new d.TracksterUI(Galaxy.root),c={title:e.get("name"),type:"other",content:function(b){var c={container:b,name:e.get("title"),id:e.id,dbkey:e.get("dbkey"),stand_alone:!1},d=e.get("latest_revision"),f=d.config.view.drawables;_.each(f,function(a){a.dataset={hda_ldda:a.hda_ldda,id:a.dataset_id}}),view=a.create_visualization(c,d.config.viewport,d.config.view.drawables,d.config.bookmarks,!1)}};b.add(c)})})},add:function(a){if("_blank"==a.target)window.open(a.url);else if("_top"==a.target||"_parent"==a.target||"_self"==a.target)window.location=a.url;else if(this.active)this.frames.add(a);else{var b=$(window.parent.document).find("#galaxy_main");if("galaxy_main"==a.target||"center"==a.target)if(0===b.length){var c=a.url;c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",window.location=c}else b.attr("src",a.url);else window.location=a.url}}})});
//# sourceMappingURL=../../maps/layout/scratchbook.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
function replace_big_select_inputs(a,b,c){function d(a){var b=$(a),c={placeholder:"Click to select",closeOnSelect:!b.is("[MULTIPLE]"),dropdownAutoWidth:!0,containerCssClass:"select2-minwidth"};return a.select2(c)}jQuery.fn.select2&&(void 0===a&&(a=20),void 0===b&&(b=3e3),c=c||$("select"),c.each(function(){var c=$(this).not("[multiple]"),e=c.find("option").length;a>e||e>b||c.hasClass("no-autocomplete")||d(c)}))}function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),$(document).trigger("convert_to_values"),a.get(0).form.submit()}),$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),a.get(0).form.submit()}),$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}window.jQuery=jQuery,window.$=jQuery,window._=_,window.Backbone=Backbone,window.Handlebars=Handlebars,window.panels=require("layout/panel"),_.extend(window,require("layout/modal")),window.async_save_text=require("utils/async-save-text");var POPUPMENU=require("ui/popupmenu");window.make_popupmenu=POPUPMENU.make_popupmenu,window.make_popup_menus=POPUPMENU.make_popup_menus,window.init_tag_click_function=require("ui/autocom_tagging"),window.init_refresh_on_change=init_refresh_on_change,$(document).ready(function(){var a=$("#masthead ul.nav > li.dropdown > .dropdown-menu");$("body").on("click.nav_popups",function(b){if(a.hide(),$("#dd-helper").hide(),!$(b.target).closest("#masthead ul.nav > li.dropdown > .dropdown-menu").length){var c=$(b.target).closest("#masthead ul.nav > li.dropdown");c.length&&($("#dd-helper").show(),c.children(".dropdown-menu").show(),b.preventDefault())}}),init_refresh_on_change(),$.fn.tooltip&&($(".unified-panel-header [title]").tooltip({placement:"bottom"}),$("[title]").tooltip()),make_popup_menus(),replace_big_select_inputs(20,1500),$("a").click(function(){var a=$(this),b=parent.frames&&parent.frames.galaxy_main;if("galaxy_main"==a.attr("target")&&!b){var c=a.attr("href");c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",a.attr("href",c),a.attr("target","_self")}return a})});
function replace_big_select_inputs(a,b,c){function d(a){var b=$(a),c={placeholder:"Click to select",closeOnSelect:!b.is("[MULTIPLE]"),dropdownAutoWidth:!0,containerCssClass:"select2-minwidth"};return a.select2(c)}jQuery.fn.select2&&(void 0===a&&(a=20),void 0===b&&(b=3e3),c=c||$("select"),c.each(function(){var c=$(this).not("[multiple]"),e=c.find("option").length;a>e||e>b||c.hasClass("no-autocomplete")||d(c)}))}function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),$(document).trigger("convert_to_values"),a.get(0).form.submit()}),$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),a.get(0).form.submit()}),$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}window.jQuery=jQuery,window.$=jQuery,window._=_,window.Backbone=Backbone,window.Handlebars=Handlebars,window.panels=require("layout/panel"),_.extend(window,require("layout/modal")),window.async_save_text=require("utils/async-save-text");var POPUPMENU=require("ui/popupmenu");window.make_popupmenu=POPUPMENU.make_popupmenu,window.make_popup_menus=POPUPMENU.make_popup_menus,window.init_tag_click_function=require("ui/autocom_tagging"),window.init_refresh_on_change=init_refresh_on_change,$(document).ready(function(){init_refresh_on_change(),$.fn.tooltip&&($(".unified-panel-header [title]").tooltip({placement:"bottom"}),$("[title]").tooltip()),make_popup_menus(),replace_big_select_inputs(20,1500),$("a").click(function(){var a=$(this),b=parent.frames&&parent.frames.galaxy_main;if("galaxy_main"==a.attr("target")&&!b){var c=a.attr("href");c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",a.attr("href",c),a.attr("target","_self")}return a})});
//# sourceMappingURL=../maps/onload.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
a{text-decoration:underline}label{font-weight:normal}body{background:#2c3143;color:#999;padding:0;border:0;margin:3px;margin-right:5px;margin-left:5px;overflow:hidden}div.pageTitle{font-size:175%;font-weight:bold}div.pageTitle a:link,div.pageTitle a:visited,div.pageTitle a:active,div.pageTitle a:hover{text-decoration:none}a:link,a:visited,a:active{color:$masthead_link}#tab-bar-bottom{z-index:-1;position:absolute;top:27px;left:0;width:100%;height:100%;background:#181a24}span.link-group{margin:0;padding:0;display:inline;padding-bottom:10px;margin-bottom:-10px}span.link-group span{margin:0;padding:0;display:inline}span.link-group span.active-link{background:#181a24;padding-left:3px;padding-right:3px;margin-left:-3px;margin-right:-3px;padding-bottom:10px;margin-bottom:-10px}
a{text-decoration:underline}label{font-weight:normal}body{background:#2c3143;color:#999;padding:0;border:0;margin:3px;margin-right:5px;margin-left:5px;overflow:hidden}body #everything{position:absolute;top:0;left:0;width:100%;height:100%}body #messagebox{display:none}body #inactivebox{display:none}body #dd-helper{display:none}div.pageTitle{font-size:175%;font-weight:bold}div.pageTitle a:link,div.pageTitle a:visited,div.pageTitle a:active,div.pageTitle a:hover{text-decoration:none}a:link,a:visited,a:active{color:$masthead_link}#tab-bar-bottom{z-index:-1;position:absolute;top:27px;left:0;width:100%;height:100%;background:#181a24}span.link-group{margin:0;padding:0;display:inline;padding-bottom:10px;margin-bottom:-10px}span.link-group span{margin:0;padding:0;display:inline}span.link-group span.active-link{background:#181a24;padding-left:3px;padding-right:3px;margin-left:-3px;margin-right:-3px;padding-bottom:10px;margin-bottom:-10px}
+6 -16
View File
@@ -61,29 +61,19 @@
require([
'layout/masthead',
'mvc/ui/ui-modal',
'mvc/upload/upload-view',
'mvc/user/user-model'
], function( mod_masthead, mod_modal, GalaxyUpload, user ){
if( !Galaxy.user ){
], function( Masthead, Modal, user ){
if( !Galaxy.user ) {
// this doesn't need to wait for the page being readied
Galaxy.user = new user.User(${ h.dumps( masthead_config[ 'user_json' ], indent=2 ) });
}
$(function() {
// check if masthead is available
if (Galaxy.masthead){
return;
if (!Galaxy.masthead) {
Galaxy.masthead = new Masthead.View(${ h.dumps( masthead_config ) });
Galaxy.modal = new Modal.View();
$('body').append( Galaxy.masthead.render().$el );
}
// get configuration
var masthead_config = ${ h.dumps( masthead_config ) };
// load global galaxy objects
Galaxy.masthead = new mod_masthead.GalaxyMasthead(masthead_config);
Galaxy.modal = new mod_modal.View();
// add upload plugin
Galaxy.upload = new GalaxyUpload(masthead_config);
});
});
</script>
+11
View File
@@ -0,0 +1,11 @@
<!doctype html>
<!-- Minimal outline test page for a requirejs+qunit testing setup,
test environment is bootstrapped in test-common.js -->
<html>
<head>
<link href="../../../static/style/blue/base.css" media="screen" rel="stylesheet" type="text/css">
<script data-main="../test-common" src="../scripts/libs/require.js"></script>
</head>
<body>
</body>
</html>
+112
View File
@@ -0,0 +1,112 @@
/* global define, QUnit, module, test, ok, equal, deepEqual, notEqual */
define([ "test-app", "layout/masthead"
], function( testApp, Masthead ){
"use strict";
module( "Masthead test", {
setup: function() {
testApp.create();
var self = this;
this.masthead = new Masthead.View({
'brand' : 'brand',
'use_remote_user' : 'use_remote_user',
'remote_user_logout_href' : 'remote_user_logout_href',
'lims_doc_url' : 'lims_doc_url',
'biostar_url' : 'biostar_url',
'biostar_url_redirect' : 'biostar_url_redirect',
'support_url' : 'support_url',
'search_url' : 'search_url',
'mailing_lists' : 'mailing_lists',
'screencasts_url' : 'screencasts_url',
'wiki_url' : 'wiki_url',
'citation_url' : 'citation_url',
'terms_url' : 'terms_url',
'logo_url' : 'logo_url',
'is_admin_user' : 'is_admin_user',
'active_view' : 'analysis',
'ftp_upload_dir' : 'ftp_upload_dir',
'ftp_upload_site' : 'ftp_upload_site',
'datatypes_disable_auto' : true,
'allow_user_creation' : true,
'enable_cloud_launch' : true,
'user_requests' : true
});
$( 'body' ).append( this.masthead.render().$el );
},
teardown: function() {
testApp.destroy();
}
} );
test( 'test masthead tabs', function() {
this.tab = this.masthead.collection.first();
this.$tab = $( '.dropdown:first' );
this.$toggle = this.$tab.find( '.dropdown-toggle' );
this.$note = this.$tab.find( '.dropdown-note' );
this.$menu = this.$tab.find( 'ul' );
this.tab.set( 'title', 'Analyze' );
ok( this.$toggle.html() == 'Analyze', 'Correct title' );
ok( this.tab.get( 'target' ) == '_parent', 'Correct initial target' );
this.tab.set( 'target', '_target' );
ok( this.$toggle.attr( 'target' ) == '_target', 'Correct test target' );
ok( this.$tab.css( 'visibility' ) == 'visible', 'Tab visible' );
this.tab.set( 'visible', false );
ok( this.$tab.css( 'visibility' ) == 'hidden', 'Tab hidden' );
this.tab.set( 'visible', true );
ok( this.$tab.css( 'visibility' ) == 'visible', 'Tab visible, again' );
ok( this.$toggle.attr( 'href' ) == Galaxy.root, 'Correct initial url' );
this.tab.set( 'url', '_url' );
ok( this.$toggle.attr( 'href' ) == '/_url', 'Correct test url' );
this.tab.set( 'url', 'http://_url' );
ok( this.$toggle.attr( 'href' ) == 'http://_url', 'Correct http url' );
this.tab.set( 'tooltip', '_tooltip' );
this.$toggle.trigger( 'mouseover' );
ok( $( '.tooltip-inner' ).html() == '_tooltip', 'Correct tooltip' );
this.tab.set( 'tooltip', null );
this.$toggle.trigger( 'mouseover' );
ok( $( '.tooltip-inner' ).length == 0, 'Tooltip removed' );
this.tab.set( 'tooltip', '_tooltip_new' );
this.$toggle.trigger( 'mouseover' );
ok( $( '.tooltip-inner' ).html() == '_tooltip_new', 'Correct new tooltip' );
this.tab.set( 'cls', '_cls' );
ok( this.$toggle.hasClass ( '_cls' ), 'Correct extra class' );
this.tab.set( 'cls', '_cls_new' );
ok( this.$toggle.hasClass ( '_cls_new' ) && !this.$toggle.hasClass ( '_cls' ), 'Correct new extra class' );
ok( this.$note.html() == '', 'Correct empty note' );
this.tab.set( { 'note' : '_note', 'show_note' : true } );
ok( this.$note.html() == '_note', 'Correct new note' );
this.tab.set( 'toggle', true );
ok( this.$toggle.hasClass( 'toggle' ), 'Toggled' );
this.tab.set( 'toggle', false );
ok( !this.$toggle.hasClass( 'toggle' ), 'Untoggled' );
this.tab.set( 'disabled', true );
ok( this.$toggle.hasClass( 'disabled' ), 'Correctly disabled' );
this.tab.set( 'disabled', false );
ok( !this.$toggle.hasClass( 'disabled' ), 'Correctly enabled' );
ok( this.$tab.hasClass( 'active' ), 'Highlighted' );
this.tab.set( 'active', false );
ok( !this.$tab.hasClass( 'active' ), 'Not highlighted' );
this.tab.set( 'active', true );
ok( this.$tab.hasClass( 'active' ), 'Highlighted, again' );
this.tab.set( 'menu', [ { title: '_menu_title', url: '_menu_url', target: '_menu_target' } ] );
ok( this.$menu.hasClass( 'dropdown-menu' ), 'Menu has correct class' );
ok( this.$menu.css( 'display' ) == 'none', 'Menu hidden' );
this.$toggle.trigger( 'click' );
ok( this.$menu.css( 'display' ) == 'block', 'Menu shown' );
var $item = this.$menu.find( 'a' );
ok( $item.length == 1, 'Added one menu item' );
ok( $item.html() == '_menu_title', 'Menu item has correct title' );
ok( $item.attr( 'href' ) == '/_menu_url', 'Menu item has correct url' );
ok( $item.attr( 'target' ) == '_menu_target', 'Menu item has correct target' );
this.tab.set( 'menu', null );
$item = this.$menu.find( 'a' );
ok( $item.length == 0, 'All menu items removed' );
this.tab.set( 'menu', [ { title: '_menu_title_0', url: '_menu_url_0', target: '_menu_target_0' },
{ title: '_menu_title_1', url: '_menu_url_1', target: '_menu_target_1' } ] );
$item = this.$menu.find( 'a' );
ok( $item.length == 2, 'Two menu items added' );
this.tab.set( 'show_menu', false );
ok( this.$menu.css( 'display', 'none' ), 'Menu manually hidden' );
this.tab.set( 'show_menu', true );
ok( this.$menu.css( 'display', 'block' ), 'Menu manually shown, again' );
} );
});