galaxy-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: guerler: UI: Rename galaxy.master.js to galaxy.masthead.js
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/91c9b4fb1c06/
Changeset: 91c9b4fb1c06
User: guerler
Date: 2013-11-05 19:52:35
Summary: UI: Rename galaxy.master.js to galaxy.masthead.js
Affected #: 11 files
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+define(["galaxy.masthead", "libs/backbone/backbone-relational"], function(mod_masthead) {
// frame manager
var GalaxyFrame = Backbone.View.extend(
@@ -79,11 +79,11 @@
// initialize
initialize : function(options)
{
- // add to master menu
+ // add to masthead menu
var self = this;
// add activate icon
- this.button_active = new mod_master.GalaxyMasterIcon (
+ this.button_active = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
@@ -94,11 +94,11 @@
}
});
- // add to master
- Galaxy.master.append(this.button_active);
+ // add to masthead
+ Galaxy.masthead.append(this.button_active);
// add load icon
- this.button_load = new mod_master.GalaxyMasterIcon (
+ this.button_load = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
@@ -106,8 +106,8 @@
with_number : true
});
- // add to master
- Galaxy.master.append(this.button_load);
+ // add to masthead
+ Galaxy.masthead.append(this.button_load);
// read in defaults
if (options)
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.master.js
--- a/static/scripts/galaxy.master.js
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- galaxy master
-*/
-
-// dependencies
-define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
-
-// master
-var GalaxyMaster = Backbone.View.extend(
-{
- // base element
- el_master: '#everything',
-
- // options
- options : null,
-
- // item list
- list : {},
-
- // keeps track of the last element
- itemLast: null,
-
- // counter
- itemCounter: 0,
-
- // background
- $background: null,
-
- // flag indicating visibility of background
- backgroundVisible: false,
-
- // initialize
- initialize : function(options)
- {
- // update options
- this.options = options;
-
- // HACK: due to body events defined in galaxy.panels.js
- $("body").off();
-
- // define this element
- this.setElement($(this._template(options)));
-
- // append to master
- $(this.el_master).append($(this.el));
-
- // assign background
- this.$background = $(this.el).find('#master-background');
-
- // loop through item specific unload functions
- // and collect all there warning messages, regarding
- // the user's attempt to unload the page
- var self = this;
- window.onbeforeunload = function()
- {
- var text = "";
- for (key in self.list)
- if (self.list[key].options.on_unload)
- {
- var q = self.list[key].options.on_unload();
- if (q) text += q + " ";
- }
- if (text != "")
- return text;
- };
- },
-
- // configure events
- events:
- {
- 'click' : '_eventRefresh',
- 'mousedown' : function(e) { e.preventDefault() }
- },
-
- // adds a new item to the master
- append : function(item)
- {
- return this._add(item, true);
- },
-
- // adds a new item to the master
- prepend : function(item)
- {
- return this._add(item, false);
- },
-
- // adds a new item to the master
- _add : function(item, append)
- {
- var $loc = $(this.el).find('#' + item.masterLocation);
- if ($loc)
- {
- // create frame for new item
- var itemId = 'master-item-' + this.itemCounter++;
- var $itemNew = $(item.el);
-
- // configure id and class in order to mark new items
- $itemNew.attr('id', itemId);
- $itemNew.addClass('master-item');
-
- // append to master
- if (append) {
- $loc.append($itemNew);
- } else {
- $loc.prepend($itemNew);
- }
-
- // add to list
- this.list[itemId] = item;
-
- // return item id
- return itemId;
- }
-
- // location not found
- return null;
- },
-
- // handle click event
- _eventRefresh: function(e)
- {
- // identify current item
- var itemCurrent = $(e.target).closest('.master-item');
-
- // get identifier
- if (itemCurrent.length)
- itemCurrent = itemCurrent.attr('id');
-
- // check last item
- if (this.itemLast && this.itemLast != itemCurrent)
- {
- var it = this.list[this.itemLast];
- if (it) {
- if (it.masterReset) {
- it.masterReset();
- }
- }
- }
-
- // check if current item is in active state
- var useBackground = false;
- if (itemCurrent)
- {
- var it = this.list[itemCurrent];
- if (it) {
- if (it.masterReset) {
- if (this.itemLast == itemCurrent) {
- useBackground = this.backgroundVisible ? false : true;
- } else {
- useBackground = true;
- }
- }
- }
- }
-
- // decide wether to show/hide background
- if (useBackground) {
- this.$background.show();
- } else {
- this.$background.hide();
- }
-
- // backup
- this.backgroundVisible = useBackground;
- this.itemLast = itemCurrent;
- },
-
- /*
- HTML TEMPLATES
- */
-
- // template item
- _templateItem: function(id)
- {
- return '<div id="' + id + '" class="master-item"></div>';
- },
-
- // fill template
- _template: function(options)
- {
- return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
- '<div style="position: relative; right: -50%; float: left;">' +
- '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
- '</div>' +
- '<div class="navbar-brand">' +
- '<a href="' + options.logo_url + '">' +
- '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
- '<span id="brand"> Galaxy ' + options.brand + '</span>' +
- '</a>' +
- '</div>' +
- '<div class="quota-meter-container"></div>' +
- '<div id="iconbar" class="iconbar"></div>' +
- '</div>' +
- '<div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
- '</div>';
- }
-});
-
-// icon
-var GalaxyMasterIcon = Backbone.View.extend(
-{
- // icon options
- options:
- {
- id : "galaxy-icon",
- icon : "fa-cog",
- tooltip : "galaxy-icon",
- with_number : false,
- on_click : function() { alert ('clicked') },
- on_unload : null,
- visible : true
- },
-
- // location identifier for master class
- masterLocation: 'iconbar',
-
- // initialize
- initialize: function (options)
- {
- // read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
- // add template for icon
- this.setElement($(this._template(this.options)));
-
- // configure icon
- var self = this;
- $(this.el).find('.icon').tooltip({title: this.options.tooltip})
- .on('mouseup', self.options.on_click);
-
- // visiblity
- if (!this.options.visible)
- this.hide();
- },
-
- // show
- show: function()
- {
- $(this.el).css({visibility : 'visible'});
- },
-
- // show
- hide: function()
- {
- $(this.el).css({visibility : 'hidden'});
- },
-
- // switch icon
- icon: function (new_icon)
- {
- // update icon class
- $(this.el).find('.icon').removeClass(this.options.icon)
- .addClass(new_icon);
-
- // update icon
- this.options.icon = new_icon;
- },
-
- // toggle
- toggle: function()
- {
- $(this.el).addClass('toggle');
- },
-
- // untoggle
- untoggle: function()
- {
- $(this.el).removeClass('toggle');
- },
-
- // set/get number
- number: function(new_number)
- {
- $(this.el).find('.number').text(new_number);
- },
-
- // fill template icon
- _template: function (options)
- {
- var tmpl = '<div id=' + options.id + ' class="symbol">' +
- '<div class="icon fa fa-2x ' + options.icon + '"></div>';
- if (options.with_number)
- tmpl+= '<div class="number"></div>';
- tmpl += '</div>';
-
- // return template
- return tmpl;
- }
-});
-
-// tab
-var GalaxyMasterTab = Backbone.View.extend(
-{
- // main options
- options:
- {
- id : '',
- title : 'Title',
- target : '_parent',
- content : '',
- type : 'url',
- scratchbook : false,
- on_unload : null,
- visible : true
- },
-
- // location
- masterLocation: 'navbar',
-
- // optional sub menu
- $menu: null,
-
- // flag if menu is visible
- menuVisible: false,
-
- // events
- events:
- {
- 'click .head' : '_eventClickHead'
- },
-
- // initialize
- initialize: function (options)
- {
- // read in defaults
- if (options)
- this.options = _.defaults(options, this.options);
-
- // update url
- if (this.options.content && this.options.content.indexOf('//') === -1)
- this.options.content = galaxy_config.root + this.options.content;
-
- // add template for tab
- this.setElement($(this._template(this.options)));
-
- // visiblity
- if (!this.options.visible)
- this.hide();
- },
-
- // show
- show: function()
- {
- $(this.el).css({visibility : 'visible'});
- },
-
- // show
- hide: function()
- {
- $(this.el).css({visibility : 'hidden'});
- },
-
- // add menu item
- addMenu: function (options)
- {
- // menu option defaults
- var menuOptions = {
- title : 'Title',
- content : '',
- type : 'url',
- target : '_parent',
- scratchbook : false,
- divider : false
- }
-
- // read in defaults
- if (options)
- menuOptions = _.defaults(options, menuOptions);
-
- // update url
- if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
- menuOptions.content = galaxy_config.root + menuOptions.content;
-
- // check if submenu element is available
- if (!this.$menu)
- {
- // insert submenu element into root
- $(this.el).find('.root').append(this._templateMenu());
-
- // show caret
- $(this.el).find('.symbol').addClass('caret');
-
- // update element link
- this.$menu = $(this.el).find('.menu');
- }
-
- // create
- var $item = $(this._templateMenuItem(menuOptions));
-
- // append menu
- this.$menu.append($item);
-
- // add events
- var self = this;
- $item.on('click', function(e)
- {
- // prevent default
- e.preventDefault();
-
- // check for menu options
- self._hideMenu();
-
- // no modifications if new tab is requested
- if (self.options.target === '_blank')
- return true;
-
- // load into frame
- Galaxy.frame.add(options);
- });
-
- // append divider
- if (menuOptions.divider)
- this.$menu.append($(this._templateDivider()));
- },
-
- // add reset function called by master
- masterReset: function()
- {
- this._hideMenu();
- },
-
- // hide menu
- _hideMenu: function()
- {
- if (this.$menu && this.menuVisible)
- {
- this.$menu.hide();
- this.menuVisible = false;
- }
- },
-
- // show menu on header click
- _eventClickHead: function(e)
- {
- // prevent default
- e.preventDefault();
-
- // check for menu options
- if (this.$menu)
- {
- // show/hide menu
- if (!this.menuVisible)
- {
- this.$menu.show();
- this.menuVisible = true;
- } else {
- this.$menu.hide();
- this.menuVisible = false;
- }
- } else {
- // open new frame
- Galaxy.frame.add(this.options);
- }
- },
-
- // fill template header
- _templateMenuItem: function (options)
- {
- return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
- },
-
- // fill template header
- _templateMenu: function ()
- {
- return '<ul class="menu dropdown-menu"></ul>';
- },
-
- _templateDivider: function()
- {
- return '<li class="divider"></li>';
- },
-
- // fill template
- _template: function (options)
- {
- // start template
- var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
- '<li class="root dropdown" style="">' +
- '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
- options.title + '<b class="symbol"></b>' +
- '</a>' +
- '</li>' +
- '</ul>';
-
- // return template
- return tmpl;
- }
-});
-
-// return
-return {
- GalaxyMaster: GalaxyMaster,
- GalaxyMasterTab: GalaxyMasterTab,
- GalaxyMasterIcon: GalaxyMasterIcon
-};
-
-});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.masthead.js
--- /dev/null
+++ b/static/scripts/galaxy.masthead.js
@@ -0,0 +1,498 @@
+/*
+ galaxy masthead
+*/
+
+// dependencies
+define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
+
+// masthead
+var GalaxyMasthead = Backbone.View.extend(
+{
+ // base element
+ el_masthead: '#everything',
+
+ // options
+ options : null,
+
+ // item list
+ list : {},
+
+ // keeps track of the last element
+ itemLast: null,
+
+ // counter
+ itemCounter: 0,
+
+ // background
+ $background: null,
+
+ // flag indicating visibility of background
+ backgroundVisible: false,
+
+ // initialize
+ initialize : function(options)
+ {
+ // update options
+ this.options = options;
+
+ // HACK: due to body events defined in galaxy.panels.js
+ $("body").off();
+
+ // define this element
+ this.setElement($(this._template(options)));
+
+ // append to masthead
+ $(this.el_masthead).append($(this.el));
+
+ // assign background
+ this.$background = $(this.el).find('#masthead-background');
+
+ // loop through item specific unload functions
+ // and collect all there warning messages, regarding
+ // the user's attempt to unload the page
+ var self = this;
+ window.onbeforeunload = function()
+ {
+ var text = "";
+ for (key in self.list)
+ if (self.list[key].options.on_unload)
+ {
+ var q = self.list[key].options.on_unload();
+ if (q) text += q + " ";
+ }
+ if (text != "")
+ return text;
+ };
+ },
+
+ // configure events
+ events:
+ {
+ 'click' : '_eventRefresh',
+ 'mousedown' : function(e) { e.preventDefault() }
+ },
+
+ // adds a new item to the masthead
+ append : function(item)
+ {
+ return this._add(item, true);
+ },
+
+ // adds a new item to the masthead
+ prepend : function(item)
+ {
+ return this._add(item, false);
+ },
+
+ // adds a new item to the masthead
+ _add : function(item, append)
+ {
+ var $loc = $(this.el).find('#' + item.mastheadLocation);
+ if ($loc)
+ {
+ // create frame for new item
+ var itemId = 'masthead-item-' + this.itemCounter++;
+ var $itemNew = $(item.el);
+
+ // configure id and class in order to mark new items
+ $itemNew.attr('id', itemId);
+ $itemNew.addClass('masthead-item');
+
+ // append to masthead
+ if (append) {
+ $loc.append($itemNew);
+ } else {
+ $loc.prepend($itemNew);
+ }
+
+ // add to list
+ this.list[itemId] = item;
+
+ // return item id
+ return itemId;
+ }
+
+ // location not found
+ return null;
+ },
+
+ // handle click event
+ _eventRefresh: function(e)
+ {
+ // identify current item
+ var itemCurrent = $(e.target).closest('.masthead-item');
+
+ // get identifier
+ if (itemCurrent.length)
+ itemCurrent = itemCurrent.attr('id');
+
+ // check last item
+ if (this.itemLast && this.itemLast != itemCurrent)
+ {
+ var it = this.list[this.itemLast];
+ if (it) {
+ if (it.mastheadReset) {
+ it.mastheadReset();
+ }
+ }
+ }
+
+ // check if current item is in active state
+ var useBackground = false;
+ if (itemCurrent)
+ {
+ var it = this.list[itemCurrent];
+ if (it) {
+ if (it.mastheadReset) {
+ if (this.itemLast == itemCurrent) {
+ useBackground = this.backgroundVisible ? false : true;
+ } else {
+ useBackground = true;
+ }
+ }
+ }
+ }
+
+ // decide wether to show/hide background
+ if (useBackground) {
+ this.$background.show();
+ } else {
+ this.$background.hide();
+ }
+
+ // backup
+ this.backgroundVisible = useBackground;
+ this.itemLast = itemCurrent;
+ },
+
+ /*
+ HTML TEMPLATES
+ */
+
+ // template item
+ _templateItem: function(id)
+ {
+ return '<div id="' + id + '" class="masthead-item"></div>';
+ },
+
+ // fill template
+ _template: function(options)
+ {
+ return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
+ '<div style="position: relative; right: -50%; float: left;">' +
+ '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
+ '</div>' +
+ '<div class="navbar-brand">' +
+ '<a href="' + options.logo_url + '">' +
+ '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
+ '<span id="brand"> Galaxy ' + options.brand + '</span>' +
+ '</a>' +
+ '</div>' +
+ '<div class="quota-meter-container"></div>' +
+ '<div id="iconbar" class="iconbar"></div>' +
+ '</div>' +
+ '<div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
+ '</div>';
+ }
+});
+
+// icon
+var GalaxyMastheadIcon = Backbone.View.extend(
+{
+ // icon options
+ options:
+ {
+ id : "galaxy-icon",
+ icon : "fa-cog",
+ tooltip : "galaxy-icon",
+ with_number : false,
+ on_click : function() { alert ('clicked') },
+ on_unload : null,
+ visible : true
+ },
+
+ // location identifier for masthead class
+ mastheadLocation: 'iconbar',
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // add template for icon
+ this.setElement($(this._template(this.options)));
+
+ // configure icon
+ var self = this;
+ $(this.el).find('.icon').tooltip({title: this.options.tooltip})
+ .on('mouseup', self.options.on_click);
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // switch icon
+ icon: function (new_icon)
+ {
+ // update icon class
+ $(this.el).find('.icon').removeClass(this.options.icon)
+ .addClass(new_icon);
+
+ // update icon
+ this.options.icon = new_icon;
+ },
+
+ // toggle
+ toggle: function()
+ {
+ $(this.el).addClass('toggle');
+ },
+
+ // untoggle
+ untoggle: function()
+ {
+ $(this.el).removeClass('toggle');
+ },
+
+ // set/get number
+ number: function(new_number)
+ {
+ $(this.el).find('.number').text(new_number);
+ },
+
+ // fill template icon
+ _template: function (options)
+ {
+ var tmpl = '<div id=' + options.id + ' class="symbol">' +
+ '<div class="icon fa fa-2x ' + options.icon + '"></div>';
+ if (options.with_number)
+ tmpl+= '<div class="number"></div>';
+ tmpl += '</div>';
+
+ // return template
+ return tmpl;
+ }
+});
+
+// tab
+var GalaxyMastheadTab = Backbone.View.extend(
+{
+ // main options
+ options:
+ {
+ id : '',
+ title : 'Title',
+ target : '_parent',
+ content : '',
+ type : 'url',
+ scratchbook : false,
+ on_unload : null,
+ visible : true
+ },
+
+ // location
+ mastheadLocation: 'navbar',
+
+ // optional sub menu
+ $menu: null,
+
+ // flag if menu is visible
+ menuVisible: false,
+
+ // events
+ events:
+ {
+ 'click .head' : '_eventClickHead'
+ },
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // update url
+ if (this.options.content && this.options.content.indexOf('//') === -1)
+ this.options.content = galaxy_config.root + this.options.content;
+
+ // add template for tab
+ this.setElement($(this._template(this.options)));
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // add menu item
+ addMenu: function (options)
+ {
+ // menu option defaults
+ var menuOptions = {
+ title : 'Title',
+ content : '',
+ type : 'url',
+ target : '_parent',
+ scratchbook : false,
+ divider : false
+ }
+
+ // read in defaults
+ if (options)
+ menuOptions = _.defaults(options, menuOptions);
+
+ // update url
+ if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
+ menuOptions.content = galaxy_config.root + menuOptions.content;
+
+ // check if submenu element is available
+ if (!this.$menu)
+ {
+ // insert submenu element into root
+ $(this.el).find('.root').append(this._templateMenu());
+
+ // show caret
+ $(this.el).find('.symbol').addClass('caret');
+
+ // update element link
+ this.$menu = $(this.el).find('.menu');
+ }
+
+ // create
+ var $item = $(this._templateMenuItem(menuOptions));
+
+ // append menu
+ this.$menu.append($item);
+
+ // add events
+ var self = this;
+ $item.on('click', function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ self._hideMenu();
+
+ // no modifications if new tab is requested
+ if (self.options.target === '_blank')
+ return true;
+
+ // load into frame
+ Galaxy.frame.add(options);
+ });
+
+ // append divider
+ if (menuOptions.divider)
+ this.$menu.append($(this._templateDivider()));
+ },
+
+ // add reset function called by masthead
+ mastheadReset: function()
+ {
+ this._hideMenu();
+ },
+
+ // hide menu
+ _hideMenu: function()
+ {
+ if (this.$menu && this.menuVisible)
+ {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ },
+
+ // show menu on header click
+ _eventClickHead: function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ if (this.$menu)
+ {
+ // show/hide menu
+ if (!this.menuVisible)
+ {
+ this.$menu.show();
+ this.menuVisible = true;
+ } else {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ } else {
+ // open new frame
+ Galaxy.frame.add(this.options);
+ }
+ },
+
+ // fill template header
+ _templateMenuItem: function (options)
+ {
+ return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
+ },
+
+ // fill template header
+ _templateMenu: function ()
+ {
+ return '<ul class="menu dropdown-menu"></ul>';
+ },
+
+ _templateDivider: function()
+ {
+ return '<li class="divider"></li>';
+ },
+
+ // fill template
+ _template: function (options)
+ {
+ // start template
+ var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
+ '<li class="root dropdown" style="">' +
+ '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
+ options.title + '<b class="symbol"></b>' +
+ '</a>' +
+ '</li>' +
+ '</ul>';
+
+ // return template
+ return tmpl;
+ }
+});
+
+// return
+return {
+ GalaxyMasthead: GalaxyMasthead,
+ GalaxyMastheadTab: GalaxyMastheadTab,
+ GalaxyMastheadIcon: GalaxyMastheadIcon
+};
+
+});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.menu.js
--- a/static/scripts/galaxy.menu.js
+++ b/static/scripts/galaxy.menu.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+define(["galaxy.masthead", "libs/backbone/backbone-relational"], function(mod_masthead) {
// frame manager
var GalaxyMenu = Backbone.Model.extend(
@@ -11,14 +11,14 @@
// options
options: null,
- // link master class
- master: null,
+ // link masthead class
+ masthead: null,
// initialize
initialize: function(options)
{
this.options = options.config;
- this.master = options.master;
+ this.masthead = options.masthead;
this.create();
},
@@ -28,26 +28,26 @@
//
// Analyze data tab.
//
- var tab_analysis = new mod_master.GalaxyMasterTab({
+ var tab_analysis = new mod_masthead.GalaxyMastheadTab({
title : "Analyze Data",
content : "root/index"
});
- this.master.append(tab_analysis);
+ this.masthead.append(tab_analysis);
//
// Workflow tab.
//
- var tab_workflow = new mod_master.GalaxyMasterTab({
+ var tab_workflow = new mod_masthead.GalaxyMastheadTab({
title : "Workflow",
content : "workflow"
});
- this.master.append(tab_workflow);
+ this.masthead.append(tab_workflow);
//
// 'Shared Items' or Libraries tab.
//
- var tab_shared = new mod_master.GalaxyMasterTab({
+ var tab_shared = new mod_masthead.GalaxyMastheadTab({
title : "Shared Data",
content : "library/index"
});
@@ -79,14 +79,14 @@
content : "page/list_published"
});
- this.master.append(tab_shared);
+ this.masthead.append(tab_shared);
//
// Lab menu.
//
if (this.options.user.requests)
{
- var tab_lab = new mod_master.GalaxyMasterTab({
+ var tab_lab = new mod_masthead.GalaxyMastheadTab({
title : "Lab"
});
tab_lab.addMenu({
@@ -101,13 +101,13 @@
title : "Help",
content : this.options.lims_doc_url
});
- this.master.append(tab_lab);
+ this.masthead.append(tab_lab);
}
//
// Visualization tab.
//
- var tab_visualization = new mod_master.GalaxyMasterTab({
+ var tab_visualization = new mod_masthead.GalaxyMastheadTab({
title : "Visualization",
content : "visualization/list"
@@ -122,14 +122,14 @@
content : "visualization/list",
target : "_frame"
});
- this.master.append(tab_visualization);
+ this.masthead.append(tab_visualization);
//
// Cloud menu.
//
if (this.options.enable_cloud_launch)
{
- var tab_cloud = new mod_master.GalaxyMasterTab({
+ var tab_cloud = new mod_masthead.GalaxyMastheadTab({
title : "Cloud",
content : "cloudlaunch/index"
});
@@ -137,7 +137,7 @@
title : "New Cloud Cluster",
content : "cloudlaunch/index"
});
- this.master.append(tab_cloud);
+ this.masthead.append(tab_cloud);
}
//
@@ -145,18 +145,18 @@
//
if (this.options.is_admin_user)
{
- var tab_admin = new mod_master.GalaxyMasterTab({
+ var tab_admin = new mod_masthead.GalaxyMastheadTab({
title : "Admin",
content : "admin/index",
extra_class : "admin-only"
});
- this.master.append(tab_admin);
+ this.masthead.append(tab_admin);
}
//
// Help tab.
//
- var tab_help = new mod_master.GalaxyMasterTab({
+ var tab_help = new mod_masthead.GalaxyMastheadTab({
title : "Help"
});
if (this.options.biostar_url)
@@ -210,14 +210,14 @@
target : "_blank"
});
}
- this.master.append(tab_help);
+ this.masthead.append(tab_help);
//
// User tab.
//
if (!this.options.user.valid)
{
- var tab_user = new mod_master.GalaxyMasterTab({
+ var tab_user = new mod_masthead.GalaxyMastheadTab({
title : "User",
extra_class : "loggedout-only"
});
@@ -242,10 +242,10 @@
});
}
- // add to master
- this.master.append(tab_user);
+ // add to masthead
+ this.masthead.append(tab_user);
} else {
- var tab_user = new mod_master.GalaxyMasterTab({
+ var tab_user = new mod_masthead.GalaxyMastheadTab({
title : "User",
extra_class : "loggedin-only"
});
@@ -316,8 +316,8 @@
});
}
- // add to master
- this.master.append(tab_user);
+ // add to masthead
+ this.masthead.append(tab_user);
}
}
});
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/galaxy.upload.js
--- a/static/scripts/galaxy.upload.js
+++ b/static/scripts/galaxy.upload.js
@@ -3,7 +3,7 @@
*/
// dependencies
-define(["galaxy.modal", "galaxy.master", "utils/galaxy.utils", "utils/galaxy.uploadbox", "libs/backbone/backbone-relational"], function(mod_modal, mod_master, mod_utils) {
+define(["galaxy.modal", "galaxy.masthead", "utils/galaxy.utils", "utils/galaxy.uploadbox", "libs/backbone/backbone-relational"], function(mod_modal, mod_masthead, mod_utils) {
// galaxy upload
var GalaxyUpload = Backbone.View.extend(
@@ -64,7 +64,7 @@
// add activate icon
var self = this;
- this.button_show = new mod_master.GalaxyMasterIcon (
+ this.button_show = new mod_masthead.GalaxyMastheadIcon (
{
icon : 'fa-arrow-circle-o-up',
tooltip : 'Upload Files',
@@ -76,8 +76,8 @@
with_number : true
});
- // add to master
- Galaxy.master.prepend(this.button_show);
+ // add to masthead
+ Galaxy.masthead.prepend(this.button_show);
// load extension
var self = this;
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},add:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrame:a}});
\ No newline at end of file
+define(["galaxy.masthead","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMastheadIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.masthead.append(this.button_active);this.button_load=new b.GalaxyMastheadIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.masthead.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},add:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrame:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.master.js
--- a/static/scripts/packed/galaxy.master.js
+++ /dev/null
@@ -1,1 +0,0 @@
-define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_master:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_master).append($(this.el));this.$background=$(this.el).find("#master-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.masterLocation);if(e){var h="master-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("master-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".master-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.masterReset){g.masterReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.masterReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="master-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var d=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},masterLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var b=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},masterLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame.add(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},masterReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame.add(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMaster:a,GalaxyMasterTab:b,GalaxyMasterIcon:d}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.masthead.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -0,0 +1,1 @@
+define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_masthead:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.mastheadLocation);if(e){var h="masthead-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("masthead-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".masthead-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.mastheadReset){g.mastheadReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.mastheadReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="masthead-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},mastheadLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var d=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},mastheadLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame.add(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},mastheadReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame.add(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMasthead:a,GalaxyMastheadTab:d,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.menu.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.menu.js
@@ -0,0 +1,1 @@
+define(["galaxy.masthead","libs/backbone/backbone-relational"],function(b){var a=Backbone.Model.extend({options:null,masthead:null,initialize:function(c){this.options=c.config;this.masthead=c.masthead;this.create()},create:function(){var d=new b.GalaxyMastheadTab({title:"Analyze Data",content:"root/index"});this.masthead.append(d);var c=new b.GalaxyMastheadTab({title:"Workflow",content:"workflow"});this.masthead.append(c);var g=new b.GalaxyMastheadTab({title:"Shared Data",content:"library/index"});g.addMenu({title:"Data Libraries",content:"library/index",divider:true});g.addMenu({title:"Published Histories",content:"history/list_published"});g.addMenu({title:"Published Workflows",content:"workflow/list_published"});g.addMenu({title:"Published Visualizations",content:"visualization/list_published"});g.addMenu({title:"Published Pages",content:"page/list_published"});this.masthead.append(g);if(this.options.user.requests){var h=new b.GalaxyMastheadTab({title:"Lab"});h.addMenu({title:"Sequencing Requests",content:"requests/index"});h.addMenu({title:"Find Samples",content:"requests/find_samples_index"});h.addMenu({title:"Help",content:this.options.lims_doc_url});this.masthead.append(h)}var k=new b.GalaxyMastheadTab({title:"Visualization",content:"visualization/list"});k.addMenu({title:"New Track Browser",content:"visualization/trackster",target:"_frame"});k.addMenu({title:"Saved Visualizations",content:"visualization/list",target:"_frame"});this.masthead.append(k);if(this.options.enable_cloud_launch){var e=new b.GalaxyMastheadTab({title:"Cloud",content:"cloudlaunch/index"});e.addMenu({title:"New Cloud Cluster",content:"cloudlaunch/index"});this.masthead.append(e)}if(this.options.is_admin_user){var f=new b.GalaxyMastheadTab({title:"Admin",content:"admin/index",extra_class:"admin-only"});this.masthead.append(f)}var j=new b.GalaxyMastheadTab({title:"Help"});if(this.options.biostar_url){j.addMenu({title:"Galaxy Q&A Site",content:this.options.biostar_url_redirect,target:"_blank"});j.addMenu({title:"Ask a question",content:"biostar/biostar_question_redirect",target:"_blank"})}j.addMenu({title:"Support",content:this.options.support_url,target:"_blank"});j.addMenu({title:"Search",content:this.options.search_url,target:"_blank"});j.addMenu({title:"Mailing Lists",content:this.options.mailing_lists,target:"_blank"});j.addMenu({title:"Videos",content:this.options.screencasts_url,target:"_blank"});j.addMenu({title:"Wiki",content:this.options.wiki_url,target:"_blank"});j.addMenu({title:"How to Cite Galaxy",content:this.options.citation_url,target:"_blank"});if(!this.options.terms_url){j.addMenu({title:"Terms and Conditions",content:this.options.terms_url,target:"_blank"})}this.masthead.append(j);if(!this.options.user.valid){var i=new b.GalaxyMastheadTab({title:"User",extra_class:"loggedout-only"});if(this.options.allow_user_creation){i.addMenu({title:"Login",content:"user/login",target:"galaxy_main"})}if(this.options.allow_user_creation){i.addMenu({title:"Register",content:"user/create",target:"galaxy_main"})}this.masthead.append(i)}else{var i=new b.GalaxyMastheadTab({title:"User",extra_class:"loggedin-only"});i.addMenu({title:"Logged in as "+this.options.user.email});if(this.options.use_remote_user&&this.options.remote_user_logout_href){i.addMenu({title:"Logout",content:this.options.remote_user_logout_href,target:"_top"})}else{i.addMenu({title:"Preferences",content:"user?cntrller=user",target:"galaxy_main"});i.addMenu({title:"Custom Builds",content:"user/dbkeys",target:"galaxy_main"});i.addMenu({title:"Logout",content:"user/logout",target:"_top",divider:true})}i.addMenu({title:"Saved Histories",content:"history/list",target:"galaxy_main"});i.addMenu({title:"Saved Datasets",content:"dataset/list",target:"galaxy_main"});i.addMenu({title:"Saved Pages",content:"page/list",target:"_top"});i.addMenu({title:"API Keys",content:"user/api_keys?cntrller=user",target:"galaxy_main"});if(this.options.use_remote_user){i.addMenu({title:"Public Name",content:"user/edit_username?cntrller=user",target:"galaxy_main"})}this.masthead.append(i)}}});return{GalaxyMenu:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 static/scripts/packed/galaxy.upload.js
--- a/static/scripts/packed/galaxy.upload.js
+++ b/static/scripts/packed/galaxy.upload.js
@@ -1,1 +1,1 @@
-define(["galaxy.modal","galaxy.master","utils/galaxy.utils","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,d,c){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],state:{init:"fa fa-trash-o",queued:"fa fa-spinner fa-spin",running:"__running__",success:"fa fa-check",error:"fa fa-exclamation-triangle"},counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(){if(!Galaxy.currHistoryPanel){var e=this;window.setTimeout(function(){e.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}var e=this;this.button_show=new d.GalaxyMasterIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(f){e.event_show(f)},on_unload:function(){if(e.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.master.prepend(this.button_show);var e=this;c.jsonFromUrl(galaxy_config.root+"api/datatypes",function(f){for(key in f){e.select_extension.push([f[key],f[key]])}});c.jsonFromUrl(galaxy_config.root+"api/genomes",function(f){var g=e.select_genome[0];e.select_genome=[];for(key in f){if(f[key].length>1){if(f[key][1]!==g[1]){e.select_genome.push(f[key])}}}e.select_genome.sort(function(i,h){return i[0]>h[0]?1:i[0]<h[0]?-1:0});e.select_genome.unshift(g)})},event_dragover:function(f){},event_dragleave:function(f){},event_announce:function(i,g,n){var f="#upload-"+i;$(this.el).find("tbody:last").append(this.template_row(f));var h=this.get_upload_item(i);h.fadeIn();h.find("#title").html(g.name);h.find("#size").html(this.size_to_string(g.size));var m=this;h.find("#symbol").on("click",function(){m.event_remove(i)});h.find("#text-content").on("keyup",function(){var o=h.find("#text-content").val().length;h.find("#size").html(m.size_to_string(o))});this.event_progress(i,g,0);this.counter.announce++;this.update_screen();if(g.size==-1){var l=h.find("#text");var j=8;var e=h.width()-2*j;var k=h.height()-j;l.css("width",e+"px");l.css("top",k+"px");h.height(k+l.height()+2*j);l.show()}},event_initialize:function(i,e,n){this.button_show.number(this.counter.announce);var g=this.get_upload_item(i);var k=g.find("#symbol");k.addClass(this.state.running);var j=Galaxy.currHistoryPanel.model.get("id");var f=g.find("#extension").val();var m=g.find("#genome").val();var l=g.find("#text-content").val();var h=g.find("#space_to_tabs").is(":checked");if(!l&&!(e.size>0)){return null}this.uploadbox.configure({url:galaxy_config.root+"api/tools",paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=f;tool_input["files_0|NAME"]=e.name;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=h;data={};data.history_id=j;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},event_progress:function(f,g,i){var h=this.get_upload_item(f);var e=parseInt(i);h.find(".progress-bar").css({width:e+"%"});if(e!=100){h.find("#percentage").html(e+"%")}else{h.find("#percentage").html("Adding to history...")}},event_success:function(e,f,h){this.event_progress(e,f,100);this.button_show.number("");this.counter.announce--;this.counter.success++;this.update_screen();var g=this.get_upload_item(e);g.addClass("success");g.find("#percentage").html("100%");var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.success);Galaxy.currHistoryPanel.refreshHdas()},event_error:function(e,f,h){this.event_progress(e,f,0);this.button_show.number("");this.counter.announce--;this.counter.error++;this.update_screen();var g=this.get_upload_item(e);g.addClass("danger");g.find(".progress").remove();g.find("#info").html("<strong>Failed: </strong>"+h).show();var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.error)},event_start:function(){if(this.counter.announce==0||this.counter.running>0){return}var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.init)){g.removeClass(e.state.init);g.addClass(e.state.queued);$(this).find("#text-content").attr("disabled",true);$(this).find("#genome").attr("disabled",true);$(this).find("#extension").attr("disabled",true);$(this).find("#space_to_tabs").attr("disabled",true)}});this.counter.running=this.counter.announce;this.update_screen();this.uploadbox.start()},event_stop:function(){if(this.counter.running==0){return}this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},event_complete:function(){this.counter.running=0;this.update_screen();var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.queued)&&!g.hasClass(e.state.running)){g.removeClass(e.state.queued);g.addClass(e.state.init);$(this).find("#text-content").attr("disabled",false);$(this).find("#genome").attr("disabled",false);$(this).find("#extension").attr("disabled",false);$(this).find("#space_to_tabs").attr("disabled",false)}})},event_reset:function(){if(this.counter.running==0){var e=$(this.el).find(".upload-item");$(this.el).find("table").fadeOut({complete:function(){e.remove()}});this.counter.reset();this.update_screen();this.uploadbox.reset()}},event_remove:function(e){var f=this.get_upload_item(e);var g=f.find("#symbol");if(g.hasClass(this.state.init)||g.hasClass(this.state.success)||g.hasClass(this.state.error)){if(f.hasClass("success")){this.counter.success--}else{if(f.hasClass("danger")){this.counter.error--}else{this.counter.announce--}}this.update_screen();this.uploadbox.remove(e);f.remove()}},event_create:function(){this.uploadbox.add([{name:"New File",size:-1}])},event_show:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f.event_create()},Upload:function(){f.event_start()},Pause:function(){f.event_stop()},Reset:function(){f.event_reset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({dragover:function(){f.event_dragover()},dragleave:function(){f.event_dragleave()},announce:function(e,h,i){f.event_announce(e,h,i)},initialize:function(e,h,i){return f.event_initialize(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},complete:function(){f.event_complete()},});this.update_screen()}this.modal.show()},get_upload_item:function(e){return $(this.el).find("#upload-"+e)},size_to_string:function(e){var f="";if(e>=100000000000){e=e/100000000000;f="TB"}else{if(e>=100000000){e=e/100000000;f="GB"}else{if(e>=100000){e=e/100000;f="MB"}else{if(e>=100){e=e/100;f="KB"}else{if(e>0){e=e*10;f="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(e)/10)+"</strong> "+f},update_screen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},template:function(f,e){return'<div id="'+f+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+e+'" class="upload-info"></h6>'},template_row:function(f){var e='<tr id="'+f.substr(1)+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';e+='<td><select id="extension" class="extension">';for(key in this.select_extension){e+='<option value="'+this.select_extension[key][1]+'">'+this.select_extension[key][0]+"</option>"}e+="</select></td>";e+='<td><select id="genome" class="genome">';for(key in this.select_genome){e+='<option value="'+this.select_genome[key][1]+'">'+this.select_genome[key][0]+"</option>"}e+="</select></td>";e+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="symbol '+this.state.init+'"></div></td></tr>';return e}});return{GalaxyUpload:a}});
\ No newline at end of file
+define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,c,d){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],state:{init:"fa fa-trash-o",queued:"fa fa-spinner fa-spin",running:"__running__",success:"fa fa-check",error:"fa fa-exclamation-triangle"},counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(){if(!Galaxy.currHistoryPanel){var e=this;window.setTimeout(function(){e.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}var e=this;this.button_show=new c.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(f){e.event_show(f)},on_unload:function(){if(e.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var e=this;d.jsonFromUrl(galaxy_config.root+"api/datatypes",function(f){for(key in f){e.select_extension.push([f[key],f[key]])}});d.jsonFromUrl(galaxy_config.root+"api/genomes",function(f){var g=e.select_genome[0];e.select_genome=[];for(key in f){if(f[key].length>1){if(f[key][1]!==g[1]){e.select_genome.push(f[key])}}}e.select_genome.sort(function(i,h){return i[0]>h[0]?1:i[0]<h[0]?-1:0});e.select_genome.unshift(g)})},event_dragover:function(f){},event_dragleave:function(f){},event_announce:function(i,g,n){var f="#upload-"+i;$(this.el).find("tbody:last").append(this.template_row(f));var h=this.get_upload_item(i);h.fadeIn();h.find("#title").html(g.name);h.find("#size").html(this.size_to_string(g.size));var m=this;h.find("#symbol").on("click",function(){m.event_remove(i)});h.find("#text-content").on("keyup",function(){var o=h.find("#text-content").val().length;h.find("#size").html(m.size_to_string(o))});this.event_progress(i,g,0);this.counter.announce++;this.update_screen();if(g.size==-1){var l=h.find("#text");var j=8;var e=h.width()-2*j;var k=h.height()-j;l.css("width",e+"px");l.css("top",k+"px");h.height(k+l.height()+2*j);l.show()}},event_initialize:function(i,e,n){this.button_show.number(this.counter.announce);var g=this.get_upload_item(i);var k=g.find("#symbol");k.addClass(this.state.running);var j=Galaxy.currHistoryPanel.model.get("id");var f=g.find("#extension").val();var m=g.find("#genome").val();var l=g.find("#text-content").val();var h=g.find("#space_to_tabs").is(":checked");if(!l&&!(e.size>0)){return null}this.uploadbox.configure({url:galaxy_config.root+"api/tools",paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=f;tool_input["files_0|NAME"]=e.name;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=h;data={};data.history_id=j;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},event_progress:function(f,g,i){var h=this.get_upload_item(f);var e=parseInt(i);h.find(".progress-bar").css({width:e+"%"});if(e!=100){h.find("#percentage").html(e+"%")}else{h.find("#percentage").html("Adding to history...")}},event_success:function(e,f,h){this.event_progress(e,f,100);this.button_show.number("");this.counter.announce--;this.counter.success++;this.update_screen();var g=this.get_upload_item(e);g.addClass("success");g.find("#percentage").html("100%");var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.success);Galaxy.currHistoryPanel.refreshHdas()},event_error:function(e,f,h){this.event_progress(e,f,0);this.button_show.number("");this.counter.announce--;this.counter.error++;this.update_screen();var g=this.get_upload_item(e);g.addClass("danger");g.find(".progress").remove();g.find("#info").html("<strong>Failed: </strong>"+h).show();var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.error)},event_start:function(){if(this.counter.announce==0||this.counter.running>0){return}var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.init)){g.removeClass(e.state.init);g.addClass(e.state.queued);$(this).find("#text-content").attr("disabled",true);$(this).find("#genome").attr("disabled",true);$(this).find("#extension").attr("disabled",true);$(this).find("#space_to_tabs").attr("disabled",true)}});this.counter.running=this.counter.announce;this.update_screen();this.uploadbox.start()},event_stop:function(){if(this.counter.running==0){return}this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},event_complete:function(){this.counter.running=0;this.update_screen();var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.queued)&&!g.hasClass(e.state.running)){g.removeClass(e.state.queued);g.addClass(e.state.init);$(this).find("#text-content").attr("disabled",false);$(this).find("#genome").attr("disabled",false);$(this).find("#extension").attr("disabled",false);$(this).find("#space_to_tabs").attr("disabled",false)}})},event_reset:function(){if(this.counter.running==0){var e=$(this.el).find(".upload-item");$(this.el).find("table").fadeOut({complete:function(){e.remove()}});this.counter.reset();this.update_screen();this.uploadbox.reset()}},event_remove:function(e){var f=this.get_upload_item(e);var g=f.find("#symbol");if(g.hasClass(this.state.init)||g.hasClass(this.state.success)||g.hasClass(this.state.error)){if(f.hasClass("success")){this.counter.success--}else{if(f.hasClass("danger")){this.counter.error--}else{this.counter.announce--}}this.update_screen();this.uploadbox.remove(e);f.remove()}},event_create:function(){this.uploadbox.add([{name:"New File",size:-1}])},event_show:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f.event_create()},Upload:function(){f.event_start()},Pause:function(){f.event_stop()},Reset:function(){f.event_reset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({dragover:function(){f.event_dragover()},dragleave:function(){f.event_dragleave()},announce:function(e,h,i){f.event_announce(e,h,i)},initialize:function(e,h,i){return f.event_initialize(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},complete:function(){f.event_complete()},});this.update_screen()}this.modal.show()},get_upload_item:function(e){return $(this.el).find("#upload-"+e)},size_to_string:function(e){var f="";if(e>=100000000000){e=e/100000000000;f="TB"}else{if(e>=100000000){e=e/100000000;f="GB"}else{if(e>=100000){e=e/100000;f="MB"}else{if(e>=100){e=e/100;f="KB"}else{if(e>0){e=e*10;f="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(e)/10)+"</strong> "+f},update_screen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},template:function(f,e){return'<div id="'+f+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+e+'" class="upload-info"></h6>'},template_row:function(f){var e='<tr id="'+f.substr(1)+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';e+='<td><select id="extension" class="extension">';for(key in this.select_extension){e+='<option value="'+this.select_extension[key][1]+'">'+this.select_extension[key][0]+"</option>"}e+="</select></td>";e+='<td><select id="genome" class="genome">';for(key in this.select_genome){e+='<option value="'+this.select_genome[key][1]+'">'+this.select_genome[key][0]+"</option>"}e+="</select></td>";e+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="symbol '+this.state.init+'"></div></td></tr>';return e}});return{GalaxyUpload:a}});
\ No newline at end of file
diff -r 0e7ecc1418ea4f31d4c20a8c0ccc97f6558c41ee -r 91c9b4fb1c0660e4940ccb507b6f8cc5a3ad3f92 templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -25,11 +25,11 @@
%></%def>
-## master head generator
+## masthead head generator
<%def name="load()"><%
## get configuration
- master_config = {
+ masthead_config = {
## inject configuration
'brand' : app.config.get("brand", ""),
'use_remote_user' : app.config.use_remote_user,
@@ -70,37 +70,37 @@
$('<link href="' + galaxy_config.root + 'static/style/galaxy.frame.masthead.css" rel="stylesheet">').appendTo('head');
## load galaxy js-modules
- require(['galaxy.master', 'galaxy.menu', 'galaxy.modal', 'galaxy.frame', 'galaxy.upload'],
- function(mod_master, mod_menu, mod_modal, mod_frame, mod_upload)
+ require(['galaxy.masthead', 'galaxy.menu', 'galaxy.modal', 'galaxy.frame', 'galaxy.upload'],
+ function(mod_masthead, mod_menu, mod_modal, mod_frame, mod_upload)
{
- ## check if master is available
- if (Galaxy.master)
+ ## check if masthead is available
+ if (Galaxy.masthead)
return;
## get configuration
- var master_config = ${ h.to_json_string( master_config ) };
+ var masthead_config = ${ h.to_json_string( masthead_config ) };
## set up the quota meter (And fetch the current user data from trans)
- Galaxy.currUser = new User(master_config.user.json);
+ Galaxy.currUser = new User(masthead_config.user.json);
## load global galaxy objects
- Galaxy.master = new mod_master.GalaxyMaster(master_config);
+ Galaxy.masthead = new mod_masthead.GalaxyMasthead(masthead_config);
Galaxy.modal = new mod_modal.GalaxyModal();
Galaxy.frame = new mod_frame.GalaxyFrame();
## construct default menu options
Galaxy.menu = new mod_menu.GalaxyMenu({
- master: Galaxy.master,
- config: master_config
+ masthead: Galaxy.masthead,
+ config: masthead_config
});
## add upload plugin
##Galaxy.upload = new mod_upload.GalaxyUpload();
- ## add quota meter to master
+ ## add quota meter to masthead
Galaxy.quotaMeter = new UserQuotaMeter({
model : Galaxy.currUser,
- el : $(Galaxy.master.el).find('.quota-meter-container')
+ el : $(Galaxy.masthead.el).find('.quota-meter-container')
}).render();
});
</script>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: UI: Translate masthead mako code into js
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5828950834e3/
Changeset: 5828950834e3
User: guerler
Date: 2013-11-05 18:34:42
Summary: UI: Translate masthead mako code into js
Affected #: 14 files
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -1,5 +1,5 @@
/*
- galaxy frames v2.0
+ galaxy frames
*/
// dependencies
@@ -9,7 +9,7 @@
var GalaxyFrameManager = Backbone.View.extend(
{
// base element
- el_main: '#everything',
+ el_main: 'body',
// defaults inputs
options:
@@ -46,7 +46,7 @@
// scroll/element top
top: 0,
- // maximum viewport
+ // viewport scrolling state
top_max: 0,
// frame z-index
@@ -87,7 +87,7 @@
{
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
- on_click : function(e) { self.event_panel_active(e) },
+ on_click : function(e) { self._event_panel_active(e) },
on_unload : function() {
if (self.frame_counter > 0)
return "You opened " + self.frame_counter + " frame(s) which will be lost.";
@@ -102,7 +102,7 @@
{
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
- on_click : function(e) { self.event_panel_load(e) },
+ on_click : function(e) { self._event_panel_load(e) },
with_number : true
});
@@ -117,13 +117,13 @@
this.top = this.top_max = this.options.top_min;
// create
- this.setElement(this.template());
+ this.setElement(this._template());
// load background
- $(this.el).append(this.template_background());
+ $(this.el).append(this._template_background());
// load menu buttons
- $(this.el).append(this.template_menu());
+ $(this.el).append(this._template_menu());
// load to main frame
$(this.el_main).append($(this.el));
@@ -134,7 +134,7 @@
var id_shadow = '#frame-shadow';
// add shadow template
- $(this.el).append(this.template_shadow(id_shadow.substring(1)));
+ $(this.el).append(this._template_shadow(id_shadow.substring(1)));
// initialize frame
this.frame_shadow = {
@@ -146,23 +146,142 @@
};
// initialize size
- this.frame_resize(this.frame_shadow, {width: 0, height: 0});
+ this._frame_resize(this.frame_shadow, {width: 0, height: 0});
// add shadow to frame list
this.frame_list[id_shadow] = this.frame_shadow;
// initialize panel
- this.panel_refresh();
+ this._panel_refresh();
// catch window resize event
var self = this;
$(window).resize(function ()
{
if (self.visible)
- self.panel_refresh();
+ self._panel_refresh();
});
},
+ // adds and displays a new frame/window
+ frame_new: function(options)
+ {
+ // frame default options
+ var frameOptions =
+ {
+ title: '',
+ content: null,
+ target: '',
+ type: null,
+ scratchbook: false
+ }
+
+ // read in defaults
+ if (options)
+ options = _.defaults(options, frameOptions);
+ else
+ options = frameOptions;
+
+ // check for content
+ if(!options.content)
+ return;
+
+ // open new tab
+ if (options.target == '_blank')
+ {
+ window.open(options.content);
+ return;
+ }
+
+ // reload entire window
+ if (options.target == '_top' || options.target == '_parent' || options.target == '_self')
+ {
+ window.location = options.content;
+ return;
+ }
+
+ // validate
+ if (!this.active)
+ {
+ // fix url if main frame is unavailable
+ var $galaxy_main = $(window.parent.document).find('#galaxy_main');
+ if (options.target == 'galaxy_main' || options.target == 'center')
+ {
+ if ($galaxy_main.length == 0)
+ {
+ var href = options.content;
+ if (href.indexOf('?') == -1)
+ href += '?';
+ else
+ href += '&';
+ href += 'use_panels=True';
+ window.location = href;
+ } else {
+ $galaxy_main.attr('src', options.content);
+ }
+ } else
+ window.location = options.content;
+
+ // stop
+ return;
+ }
+
+ // check for number of frames
+ if (this.frame_counter >= this.options.frame_max)
+ {
+ alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
+ return;
+ }
+
+ // generate frame identifier
+ var frame_id = '#frame-' + (this.frame_counter_id++);
+
+ // check if frame exists
+ if ($(frame_id).length !== 0)
+ {
+ alert("This frame already exists. This page might contain multiple frame managers.");
+ return;
+ }
+
+ // reset top
+ this.top = this.options.top_min;
+
+ // append
+ $(this.el).append(this._template_frame(frame_id.substring(1), options.title, options.type, options.content));
+
+ // construct a new frame
+ var frame = {
+ id : frame_id,
+ screen_location : {},
+ grid_location : {},
+ grid_rank : null,
+ grid_lock : false
+ };
+
+ // set dimensions
+ options.width = this._to_pixel_coord('width', this.options.frame.cols);
+ options.height = this._to_pixel_coord('height', this.options.frame.rows);
+
+ // default z-index
+ this.frame_z = parseInt($(frame.id).css('z-index'));
+
+ // add to frame list
+ this.frame_list[frame_id] = frame;
+
+ // increase frame counter
+ this.frame_counter++;
+
+ // resize
+ this._frame_resize(frame, {width: options.width, height: options.height});
+
+ // place frame
+ this._frame_insert(frame, {top: 0, left: 0}, true);
+
+ // show frames if hidden
+ if (!this.visible)
+ this._panel_show_hide();
+ },
+
/*
EVENT HANDLING
*/
@@ -179,23 +298,23 @@
events:
{
// global frame events
- 'mousemove' : 'event_frame_mouse_move',
- 'mouseup' : 'event_frame_mouse_up',
- 'mouseleave' : 'event_frame_mouse_up',
- 'mousewheel' : 'event_panel_scroll',
- 'DOMMouseScroll' : 'event_panel_scroll',
+ 'mousemove' : '_event_frame_mouse_move',
+ 'mouseup' : '_event_frame_mouse_up',
+ 'mouseleave' : '_event_frame_mouse_up',
+ 'mousewheel' : '_event_panel_scroll',
+ 'DOMMouseScroll' : '_event_panel_scroll',
// events fixed to elements
- 'mousedown .frame' : 'event_frame_mouse_down',
- 'mousedown .frame-background' : 'event_panel_load',
- 'mousedown .frame-scroll-up' : 'event_panel_scroll_up',
- 'mousedown .frame-scroll-down' : 'event_panel_scroll_down',
- 'mousedown .f-close' : 'event_frame_close',
- 'mousedown .f-pin' : 'event_frame_lock'
+ 'mousedown .frame' : '_event_frame_mouse_down',
+ 'mousedown .frame-background' : '_event_panel_load',
+ 'mousedown .frame-scroll-up' : '_event_panel_scroll_up',
+ 'mousedown .frame-scroll-down' : '_event_panel_scroll_down',
+ 'mousedown .f-close' : '_event_frame_close',
+ 'mousedown .f-pin' : '_event_frame_lock'
},
// drag start
- event_frame_mouse_down: function (e)
+ _event_frame_mouse_down: function (e)
{
// skip if event is already active
if (this.event.type !== null)
@@ -218,7 +337,7 @@
e.preventDefault();
// identify frame
- this.event.target = this.event_get_frame(e.target);
+ this.event.target = this._frame_identify(e.target);
// check if frame is locked
if (this.event.target.grid_lock)
@@ -231,11 +350,11 @@
this.event.xy = {x: e.originalEvent.pageX, y: e.originalEvent.pageY};
// prepare drag/resize
- this.frame_drag_start(this.event.target);
+ this._frame_drag_start(this.event.target);
},
// mouse move event
- event_frame_mouse_move: function (e)
+ _event_frame_mouse_move: function (e)
{
// check
if (this.event.type != 'drag' && this.event.type != 'resize')
@@ -255,7 +374,7 @@
this.event.xy = event_xy_new;
// object position / size
- var p = this.frame_screen (this.event.target);
+ var p = this._frame_screen (this.event.target);
// resize event
if (this.event.type == 'resize')
@@ -270,23 +389,23 @@
p.height = Math.max(p.height, min_dim);
// apply resize to frame
- this.frame_resize(this.event.target, p);
+ this._frame_resize(this.event.target, p);
// break down to grid coordinates
- p.width = this.to_grid_coord('width', p.width) + 1;
- p.height = this.to_grid_coord('height', p.height) + 1;
+ p.width = this._to_grid_coord('width', p.width) + 1;
+ p.height = this._to_grid_coord('height', p.height) + 1;
// transfer back to pixels
- p.width = this.to_pixel_coord('width', p.width);
- p.height = this.to_pixel_coord('height', p.height);
+ p.width = this._to_pixel_coord('width', p.width);
+ p.height = this._to_pixel_coord('height', p.height);
// apply
- this.frame_resize(this.frame_shadow, p);
+ this._frame_resize(this.frame_shadow, p);
// fix position
- this.frame_insert(this.frame_shadow, {
- top : this.to_grid_coord('top', p.top),
- left : this.to_grid_coord('left', p.left)
+ this._frame_insert(this.frame_shadow, {
+ top : this._to_grid_coord('top', p.top),
+ left : this._to_grid_coord('left', p.left)
});
}
@@ -298,12 +417,12 @@
p.top += event_xy_delta.y;
// apply
- this.frame_offset(this.event.target, p);
+ this._frame_offset(this.event.target, p);
// get location of shadow
var l = {
- top : this.to_grid_coord('top', p.top),
- left : this.to_grid_coord('left', p.left)
+ top : this._to_grid_coord('top', p.top),
+ left : this._to_grid_coord('left', p.left)
};
// increase priority of current frame
@@ -311,26 +430,26 @@
l.left++;
// fix position
- this.frame_insert(this.frame_shadow, l);
+ this._frame_insert(this.frame_shadow, l);
}
},
// mouse up
- event_frame_mouse_up: function (e)
+ _event_frame_mouse_up: function (e)
{
// check
if (this.event.type != 'drag' && this.event.type != 'resize')
return;
// stop
- this.frame_drag_stop(this.event.target);
+ this._frame_drag_stop(this.event.target);
// reset event
this.event.type = null;
},
// drag start
- event_frame_close: function (e)
+ _event_frame_close: function (e)
{
// check
if (this.event.type !== null)
@@ -340,7 +459,7 @@
e.preventDefault();
// get frame
- var frame = this.event_get_frame(e.target);
+ var frame = this._frame_identify(e.target);
var self = this;
// fade out
@@ -356,19 +475,19 @@
self.frame_counter--;
// reload
- self.panel_refresh(true);
+ self._panel_refresh(true);
// refresh scroll state once all animations completed
- self.panel_animation_complete();
+ self._panel_animation_complete();
// hide if no frames left
if (self.visible && self.frame_counter == 0)
- self.panel_show_hide();
+ self._panel_show_hide();
});
},
// drag start
- event_frame_lock: function (e)
+ _event_frame_lock: function (e)
{
// check
if (this.event.type !== null)
@@ -378,7 +497,7 @@
e.preventDefault();
// get frame
- var frame = this.event_get_frame(e.target);
+ var frame = this._frame_identify(e.target);
// check
if (frame.grid_lock)
@@ -406,29 +525,29 @@
},
// show/hide panel
- event_panel_load: function (e)
+ _event_panel_load: function (e)
{
// check
if (this.event.type !== null)
return;
// load panel
- this.panel_show_hide();
+ this._panel_show_hide();
},
// activate/disable panel
- event_panel_active: function (e)
+ _event_panel_active: function (e)
{
// check
if (this.event.type !== null)
return;
// load panel
- this.panel_active_disable();
+ this._panel_active_disable();
},
// scroll
- event_panel_scroll: function(e)
+ _event_panel_scroll: function(e)
{
// check
if (this.event.type !== null || !this.visible)
@@ -441,11 +560,11 @@
var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3;
// refresh panel
- this.panel_scroll(delta);
+ this._panel_scroll(delta);
},
// scroll up
- event_panel_scroll_up: function(e)
+ _event_panel_scroll_up: function(e)
{
// check
if (this.event.type !== null)
@@ -455,11 +574,11 @@
e.preventDefault();
// scroll up
- this.panel_scroll(-this.options.scroll);
+ this._panel_scroll(-this.options.scroll);
},
// scroll down
- event_panel_scroll_down: function(e)
+ _event_panel_scroll_down: function(e)
{
// check
if (this.event.type !== null)
@@ -469,31 +588,31 @@
e.preventDefault();
// scroll down
- this.panel_scroll(this.options.scroll);
+ this._panel_scroll(this.options.scroll);
},
+ /*
+ FRAME EVENTS SUPPORT
+ */
+
// identify
- event_get_frame: function(target)
+ _frame_identify: function(target)
{
return this.frame_list['#' + $(target).closest('.frame').attr('id')];
},
-
- /*
- FRAME EVENTS START/STOP
- */
-
+
// drag start
- frame_drag_start : function (frame)
+ _frame_drag_start : function (frame)
{
// set focus
- this.frame_focus(frame, true);
+ this._frame_focus(frame, true);
// get current dimensions
- var p = this.frame_screen (frame);
+ var p = this._frame_screen (frame);
// initialize shadow
- this.frame_resize(this.frame_shadow, p);
- this.frame_grid(this.frame_shadow, frame.grid_location);
+ this._frame_resize(this.frame_shadow, p);
+ this._frame_grid(this.frame_shadow, frame.grid_location);
// reset location
frame.grid_location = null;
@@ -506,17 +625,17 @@
},
// drag stop
- frame_drag_stop : function (frame)
+ _frame_drag_stop : function (frame)
{
// remove focus
- this.frame_focus(frame, false);
+ this._frame_focus(frame, false);
// get new dimensions
- var p = this.frame_screen(this.frame_shadow);
+ var p = this._frame_screen(this.frame_shadow);
// update frame
- this.frame_resize(frame, p);
- this.frame_grid(frame, this.frame_shadow.grid_location, true);
+ this._frame_resize(frame, p);
+ this._frame_grid(frame, this.frame_shadow.grid_location, true);
// reset location of shadow
this.frame_shadow.grid_location = null;
@@ -528,7 +647,7 @@
$('.f-cover').hide();
// refresh scroll state once all animations completed
- this.panel_animation_complete();
+ this._panel_animation_complete();
},
/*
@@ -536,7 +655,7 @@
*/
// converts a pixel coordinate to grids
- to_grid_coord: function (type, px)
+ _to_grid_coord: function (type, px)
{
// determine sign
var sign = (type == 'width' || type == 'height') ? 1 : -1;
@@ -548,7 +667,7 @@
},
// converts a grid coordinate to pixels
- to_pixel_coord: function (type, g)
+ _to_pixel_coord: function (type, g)
{
// determine sign
var sign = (type == 'width' || type == 'height') ? 1 : -1;
@@ -562,25 +681,25 @@
},
// get grid coordinates
- to_grid: function (px)
+ _to_grid: function (px)
{
// full set
return {
- top : this.to_grid_coord('top', px.top),
- left : this.to_grid_coord('left', px.left),
- width : this.to_grid_coord('width', px.width),
- height : this.to_grid_coord('height', px.height)
+ top : this._to_grid_coord('top', px.top),
+ left : this._to_grid_coord('left', px.left),
+ width : this._to_grid_coord('width', px.width),
+ height : this._to_grid_coord('height', px.height)
};
},
// get pixel coordinates
- to_pixel: function(g)
+ _to_pixel: function(g)
{
return {
- top : this.to_pixel_coord('top', g.top),
- left : this.to_pixel_coord('left', g.left),
- width : this.to_pixel_coord('width', g.width),
- height : this.to_pixel_coord('height', g.height)
+ top : this._to_pixel_coord('top', g.top),
+ left : this._to_pixel_coord('left', g.left),
+ width : this._to_pixel_coord('width', g.width),
+ height : this._to_pixel_coord('height', g.height)
};
},
@@ -589,7 +708,7 @@
*/
// check collision
- is_collision: function(g)
+ _is_collision: function(g)
{
// is collision pair
function is_collision_pair (a, b)
@@ -618,7 +737,7 @@
},
// location/grid rank
- location_rank: function(loc)
+ _location_rank: function(loc)
{
return (loc.top * this.cols) + loc.left;
},
@@ -628,7 +747,7 @@
*/
// update frame counter
- menu_refresh: function()
+ _menu_refresh: function()
{
// update on screen counter
this.button_load.number(this.frame_counter);
@@ -657,24 +776,24 @@
*/
// panel on animation complete / frames not moving
- panel_animation_complete: function()
+ _panel_animation_complete: function()
{
var self = this;
- $(".frame").promise().done(function() {self.panel_scroll(0, true)});
+ $(".frame").promise().done(function() {self._panel_scroll(0, true)});
},
// refresh panel
- panel_refresh: function(animate)
+ _panel_refresh: function(animate)
{
// get current size
this.cols = parseInt($(window).width() / this.options.cell, 10) + 1;
// recalculate frame positions
- this.frame_insert(null, null, animate);
+ this._frame_insert(null, null, animate);
},
// update scroll
- panel_scroll: function(delta, animate)
+ _panel_scroll: function(delta, animate)
{
// new top value
var top_new = this.top - this.options.scroll * delta;
@@ -699,7 +818,7 @@
top : frame.screen_location.top - (this.top - top_new),
left : frame.screen_location.left
}
- this.frame_offset(frame, screen_location, animate);
+ this._frame_offset(frame, screen_location, animate);
}
}
@@ -708,11 +827,11 @@
}
// refresh
- this.menu_refresh();
+ this._menu_refresh();
},
// show or hide panel
- panel_show_hide: function()
+ _panel_show_hide: function()
{
// check
if (this.visible)
@@ -750,12 +869,12 @@
$(".frame-background").show();
// show panel
- this.panel_refresh();
+ this._panel_refresh();
}
},
// show or hide panel
- panel_active_disable: function()
+ _panel_active_disable: function()
{
// check
if (this.active)
@@ -768,7 +887,7 @@
// hide panel
if (this.visible)
- this.panel_show_hide();
+ this._panel_show_hide();
} else {
// activate
this.active = true;
@@ -781,82 +900,9 @@
/*
FRAME FUNCTIONS
*/
- // adds and displays a new frame/window
- frame_new: function(options)
- {
- // validate
- if (!this.active)
- {
- // load frame in main window
- if (options.location == 'center')
- {
- var galaxy_main = $( window.parent.document ).find( 'iframe#galaxy_main' );
- galaxy_main.attr( 'src', options.content );
- } else
- window.location = options.content;
-
- // stop
- return;
- }
-
- // check for number of frames
- if (this.frame_counter >= this.options.frame_max)
- {
- alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
- return;
- }
-
- // generate frame identifier
- var frame_id = '#frame-' + (this.frame_counter_id++);
-
- // check if frame exists
- if ($(frame_id).length !== 0)
- {
- alert("This frame already exists. This page might contain multiple frame managers.");
- return;
- }
-
- // reset top
- this.top = this.options.top_min;
-
- // append
- $(this.el).append(this.template_frame(frame_id.substring(1), options.title, options.type, options.content));
-
- // construct a new frame
- var frame = {
- id : frame_id,
- screen_location : {},
- grid_location : {},
- grid_rank : null,
- grid_lock : false
- };
-
- // set dimensions
- options.width = this.to_pixel_coord('width', this.options.frame.cols);
- options.height = this.to_pixel_coord('height', this.options.frame.rows);
-
- // default z-index
- this.frame_z = parseInt($(frame.id).css('z-index'));
-
- // add to frame list
- this.frame_list[frame_id] = frame;
-
- // increase frame counter
- this.frame_counter++;
-
- // resize
- this.frame_resize(frame, {width: options.width, height: options.height});
-
- // place frame
- this.frame_insert(frame, {top: 0, left: 0}, true);
-
- // show frames if hidden
- if (!this.visible)
- this.panel_show_hide();
- },
// frame insert at given location
- frame_insert: function(frame, new_loc, animate)
+ _frame_insert: function(frame, new_loc, animate)
{
// define
var place_list = [];
@@ -868,7 +914,7 @@
frame.grid_location = null;
// set first one to be placed
- place_list.push([frame, this.location_rank(new_loc)]);
+ place_list.push([frame, this._location_rank(new_loc)]);
}
// search
@@ -899,7 +945,7 @@
// place
for (i = 0; i < place_list.length; i++)
- this.frame_place(place_list[i][0], animate);
+ this._frame_place(place_list[i][0], animate);
// identify maximum viewport size
this.top_max = 0;
@@ -920,17 +966,17 @@
this.top_max = Math.min(this.top_max, this.options.top_min);
// panel menu
- this.menu_refresh();
+ this._menu_refresh();
},
// naive frame place
- frame_place: function(frame, animate)
+ _frame_place: function(frame, animate)
{
// reset grid location
frame.grid_location = null;
// grid coordinates of new frame
- var g = this.to_grid(this.frame_screen(frame));
+ var g = this._to_grid(this._frame_screen(frame));
// try grid coordinates
var done = false;
@@ -944,7 +990,7 @@
g.left = j;
// no collision
- if (!this.is_collision(g))
+ if (!this._is_collision(g))
{
done = true;
break;
@@ -958,13 +1004,13 @@
// check if valid spot was found
if (done)
- this.frame_grid(frame, g, animate);
+ this._frame_grid(frame, g, animate);
else
console.log("Grid dimensions exceeded.");
},
// focus
- frame_focus: function(frame, has_focus)
+ _frame_focus: function(frame, has_focus)
{
// get new z-value
var z = this.frame_z + (has_focus ? 1 : 0);
@@ -974,7 +1020,7 @@
},
// new left/top position frame
- frame_offset: function(frame, p, animate)
+ _frame_offset: function(frame, p, animate)
{
// update screen location
frame.screen_location.left = p.left;
@@ -984,7 +1030,7 @@
if (animate)
{
// set focus on animated
- this.frame_focus(frame, true);
+ this._frame_focus(frame, true);
// prepare for callback
var self = this;
@@ -993,7 +1039,7 @@
$(frame.id).animate({top: p.top, left: p.left}, 'fast', function()
{
// remove focus
- self.frame_focus(frame, false);
+ self._frame_focus(frame, false);
});
} else
// update css
@@ -1001,7 +1047,7 @@
},
// resize frame
- frame_resize: function(frame, p)
+ _frame_resize: function(frame, p)
{
// update css
$(frame.id).css({width: p.width, height: p.height});
@@ -1012,20 +1058,20 @@
},
// new grid location
- frame_grid: function (frame, l, animate)
+ _frame_grid: function (frame, l, animate)
{
// update grid location
frame.grid_location = l;
// place frame
- this.frame_offset(frame, this.to_pixel(l), animate);
+ this._frame_offset(frame, this._to_pixel(l), animate);
// update grid rank
- frame.grid_rank = this.location_rank(l);
+ frame.grid_rank = this._location_rank(l);
},
// get frame dimensions
- frame_screen: function(frame)
+ _frame_screen: function(frame)
{
var p = frame.screen_location;
return {top: p.top, left: p.left, width: p.width, height: p.height};
@@ -1036,13 +1082,13 @@
*/
// main element
- template: function()
+ _template: function()
{
- return '<div class="galaxy-frame"></div>';
+ return '<div class="galaxy-frame"></div>';
},
// fill regular frame template
- template_frame: function(id, title, type, content)
+ _template_frame: function(id, title, type, content)
{
// check title
if (!title)
@@ -1067,19 +1113,19 @@
},
// fill shadow template
- template_shadow: function(id)
+ _template_shadow: function(id)
{
return '<div id="' + id + '" class="frame-shadow corner"></div>';
},
// fill background template in order to cover underlying iframes
- template_background: function()
+ _template_background: function()
{
return '<div class="frame-background"></div>';
},
// fill menu button template
- template_menu: function()
+ _template_menu: function()
{
return '<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div>' +
'<div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>';
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.master.js
--- a/static/scripts/galaxy.master.js
+++ b/static/scripts/galaxy.master.js
@@ -3,27 +3,53 @@
*/
// dependencies
-define(["libs/backbone/backbone-relational"], function() {
+define(["utils/galaxy.utils", "libs/backbone/backbone-relational"], function(mod_utils) {
// master
var GalaxyMaster = Backbone.View.extend(
{
// base element
- el_master: '#masthead',
+ el_master: '#everything',
+
+ // options
+ options : null,
// item list
- list : [],
+ list : {},
+
+ // keeps track of the last element
+ itemLast: null,
+
+ // counter
+ itemCounter: 0,
+
+ // background
+ $background: null,
+
+ // flag indicating visibility of background
+ backgroundVisible: false,
// initialize
initialize : function(options)
{
+ // update options
+ this.options = options;
+
+ // HACK: due to body events defined in galaxy.panels.js
+ $("body").off();
+
// define this element
- this.setElement($(this.template()));
+ this.setElement($(this._template(options)));
// append to master
$(this.el_master).append($(this.el));
+ // assign background
+ this.$background = $(this.el).find('#master-background');
+
// loop through item specific unload functions
+ // and collect all there warning messages, regarding
+ // the user's attempt to unload the page
var self = this;
window.onbeforeunload = function()
{
@@ -39,38 +65,133 @@
};
},
- // prevent default
+ // configure events
events:
{
- 'mousedown' : function(e) {e.preventDefault()}
+ 'click' : '_eventRefresh',
+ 'mousedown' : function(e) { e.preventDefault() }
},
// adds a new item to the master
append : function(item)
{
- $(this.el).append($(item.el));
- this.list.push(item);
+ return this._add(item, true);
},
// adds a new item to the master
prepend : function(item)
{
- $(this.el).prepend($(item.el));
- this.list.push(item);
+ return this._add(item, false);
+ },
+
+ // adds a new item to the master
+ _add : function(item, append)
+ {
+ var $loc = $(this.el).find('#' + item.masterLocation);
+ if ($loc)
+ {
+ // create frame for new item
+ var itemId = 'master-item-' + this.itemCounter++;
+ var $itemNew = $(item.el);
+
+ // configure id and class in order to mark new items
+ $itemNew.attr('id', itemId);
+ $itemNew.addClass('master-item');
+
+ // append to master
+ if (append)
+ $loc.append($itemNew);
+ else
+ $loc.prepend($itemNew);
+
+ // add to list
+ this.list[itemId] = item;
+
+ // return item id
+ return itemId;
+ }
+
+ // location not found
+ return null;
+ },
+
+ // handle click event
+ _eventRefresh: function(e)
+ {
+ // identify current item
+ var itemCurrent = $(e.target).closest('.master-item');
+
+ // get identifier
+ if (itemCurrent.length)
+ itemCurrent = itemCurrent.attr('id');
+
+ // check last item
+ if (this.itemLast && this.itemLast != itemCurrent)
+ {
+ var it = this.list[this.itemLast];
+ if (it)
+ if (it.masterReset)
+ it.masterReset();
+ }
+
+ // check if current item is in active state
+ var useBackground = false;
+ if (itemCurrent)
+ {
+ var it = this.list[itemCurrent];
+ if (it)
+ if (it.masterReset)
+ {
+ if (this.itemLast == itemCurrent)
+ useBackground = this.backgroundVisible ? false : true;
+ else
+ useBackground = true;
+ }
+ }
+
+ // decide wether to show/hide background
+ if (useBackground)
+ this.$background.show();
+ else
+ this.$background.hide();
+
+ // backup
+ this.backgroundVisible = useBackground;
+ this.itemLast = itemCurrent;
},
/*
HTML TEMPLATES
*/
+
+ // template item
+ _templateItem: function(id)
+ {
+ return '<div id="' + id + '" class="master-item"></div>';
+ },
- // fill regular modal template
- template: function()
+ // fill template
+ _template: function(options)
{
- return '<div class="iconbar"></div>';
+ return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
+ '<div style="position: relative; right: -50%; float: left;">' +
+ '<div id="navbar" style="display: block; position: relative; right: 50%;"></div>' +
+ '</div>' +
+ '<div class="navbar-brand">' +
+ '<a href="' + options.logo_url + '">' +
+ '<img border="0" src="' + galaxy_config.root + 'static/images/galaxyIcon_noText.png">' +
+ '<span id="brand"> Galaxy ' + options.brand + '</span>' +
+ '</a>' +
+ '</div>' +
+ '<div class="quota-meter-container"></div>' +
+ '<div id="iconbar" class="iconbar"></div>' +
+ '</div>' +
+ '<div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div>' +
+ '</div>';
}
});
-// frame manager
+// icon
var GalaxyMasterIcon = Backbone.View.extend(
{
// icon options
@@ -85,6 +206,9 @@
visible : true
},
+ // location identifier for master class
+ masterLocation: 'iconbar',
+
// initialize
initialize: function (options)
{
@@ -93,12 +217,12 @@
this.options = _.defaults(options, this.options);
// add template for icon
- this.setElement($(this.template(this.options)));
+ this.setElement($(this._template(this.options)));
// configure icon
var self = this;
$(this.el).find('.icon').tooltip({title: this.options.tooltip})
- .on('click', self.options.on_click);
+ .on('mouseup', self.options.on_click);
// visiblity
if (!this.options.visible)
@@ -147,7 +271,7 @@
},
// fill template icon
- template: function (options)
+ _template: function (options)
{
var tmpl = '<div id=' + options.id + ' class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
@@ -160,10 +284,210 @@
}
});
+// tab
+var GalaxyMasterTab = Backbone.View.extend(
+{
+ // main options
+ options:
+ {
+ id : '',
+ title : 'Title',
+ target : '_parent',
+ content : '',
+ type : 'url',
+ scratchbook : false,
+ on_unload : null,
+ visible : true
+ },
+
+ // location
+ masterLocation: 'navbar',
+
+ // optional sub menu
+ $menu: null,
+
+ // flag if menu is visible
+ menuVisible: false,
+
+ // events
+ events:
+ {
+ 'click .head' : '_eventClickHead'
+ },
+
+ // initialize
+ initialize: function (options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // update url
+ if (this.options.content && this.options.content.indexOf('//') === -1)
+ this.options.content = galaxy_config.root + this.options.content;
+
+ // add template for tab
+ this.setElement($(this._template(this.options)));
+
+ // visiblity
+ if (!this.options.visible)
+ this.hide();
+ },
+
+ // show
+ show: function()
+ {
+ $(this.el).css({visibility : 'visible'});
+ },
+
+ // show
+ hide: function()
+ {
+ $(this.el).css({visibility : 'hidden'});
+ },
+
+ // add menu item
+ addMenu: function (options)
+ {
+ // menu option defaults
+ var menuOptions = {
+ title : 'Title',
+ content : '',
+ type : 'url',
+ target : '_parent',
+ scratchbook : false,
+ divider : false
+ }
+
+ // read in defaults
+ if (options)
+ menuOptions = _.defaults(options, menuOptions);
+
+ // update url
+ if (menuOptions.content && menuOptions.content.indexOf('//') === -1)
+ menuOptions.content = galaxy_config.root + menuOptions.content;
+
+ // check if submenu element is available
+ if (!this.$menu)
+ {
+ // insert submenu element into root
+ $(this.el).find('.root').append(this._templateMenu());
+
+ // show caret
+ $(this.el).find('.symbol').addClass('caret');
+
+ // update element link
+ this.$menu = $(this.el).find('.menu');
+ }
+
+ // create
+ var $item = $(this._templateMenuItem(menuOptions));
+
+ // append menu
+ this.$menu.append($item);
+
+ // add events
+ var self = this;
+ $item.on('click', function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ self._hideMenu();
+
+ // no modifications if new tab is requested
+ if (self.options.target === '_blank')
+ return true;
+
+ // load into frame
+ Galaxy.frame_manager.frame_new(options);
+ });
+
+ // append divider
+ if (menuOptions.divider)
+ this.$menu.append($(this._templateDivider()));
+ },
+
+ // add reset function called by master
+ masterReset: function()
+ {
+ this._hideMenu();
+ },
+
+ // hide menu
+ _hideMenu: function()
+ {
+ if (this.$menu && this.menuVisible)
+ {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ },
+
+ // show menu on header click
+ _eventClickHead: function(e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // check for menu options
+ if (this.$menu)
+ {
+ // show/hide menu
+ if (!this.menuVisible)
+ {
+ this.$menu.show();
+ this.menuVisible = true;
+ } else {
+ this.$menu.hide();
+ this.menuVisible = false;
+ }
+ } else {
+ // open new frame
+ Galaxy.frame_manager.frame_new(this.options);
+ }
+ },
+
+ // fill template header
+ _templateMenuItem: function (options)
+ {
+ return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
+ },
+
+ // fill template header
+ _templateMenu: function ()
+ {
+ return '<ul class="menu dropdown-menu"></ul>';
+ },
+
+ _templateDivider: function()
+ {
+ return '<li class="divider"></li>';
+ },
+
+ // fill template
+ _template: function (options)
+ {
+ // start template
+ var tmpl = '<ul class="nav navbar-nav" border="0" cellspacing="0">' +
+ '<li class="root dropdown" style="">' +
+ '<a class="head dropdown-toggle" data-toggle="dropdown" target="' + options.target + '" href="' + options.content + '">' +
+ options.title + '<b class="symbol"></b>' +
+ '</a>' +
+ '</li>' +
+ '</ul>';
+
+ // return template
+ return tmpl;
+ }
+});
+
// return
return {
GalaxyMaster: GalaxyMaster,
- GalaxyMasterIcon : GalaxyMasterIcon
+ GalaxyMasterTab: GalaxyMasterTab,
+ GalaxyMasterIcon: GalaxyMasterIcon
};
});
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/galaxy.menu.js
--- /dev/null
+++ b/static/scripts/galaxy.menu.js
@@ -0,0 +1,330 @@
+/*
+ galaxy menu
+*/
+
+// dependencies
+define(["galaxy.master", "libs/backbone/backbone-relational"], function(mod_master) {
+
+// frame manager
+var GalaxyMenu = Backbone.Model.extend(
+{
+ // options
+ options: null,
+
+ // link master class
+ master: null,
+
+ // initialize
+ initialize: function(options)
+ {
+ this.options = options.config;
+ this.master = options.master;
+ this.create();
+ },
+
+ // default menu
+ create: function()
+ {
+ //
+ // Analyze data tab.
+ //
+ var tab_analysis = new mod_master.GalaxyMasterTab({
+ title : "Analyze Data",
+ content : "root/index"
+ });
+ this.master.append(tab_analysis);
+
+ //
+ // Workflow tab.
+ //
+ var tab_workflow = new mod_master.GalaxyMasterTab({
+ title : "Workflow",
+ content : "workflow"
+
+ });
+ this.master.append(tab_workflow);
+
+ //
+ // 'Shared Items' or Libraries tab.
+ //
+ var tab_shared = new mod_master.GalaxyMasterTab({
+ title : "Shared Data",
+ content : "library/index"
+ });
+
+ tab_shared.addMenu({
+ title : "Data Libraries",
+ content : "library/index",
+ divider : true
+ });
+
+ tab_shared.addMenu({
+ title : "Published Histories",
+ content : "history/list_published"
+ });
+
+ tab_shared.addMenu({
+ title : "Published Workflows",
+ content : "workflow/list_published"
+
+ });
+
+ tab_shared.addMenu({
+ title : "Published Visualizations",
+ content : "visualization/list_published"
+ });
+
+ tab_shared.addMenu({
+ title : "Published Pages",
+ content : "page/list_published"
+ });
+
+ this.master.append(tab_shared);
+
+ //
+ // Lab menu.
+ //
+ if (this.options.user.requests)
+ {
+ var tab_lab = new mod_master.GalaxyMasterTab({
+ title : "Lab"
+ });
+ tab_lab.addMenu({
+ title : "Sequencing Requests",
+ content : "requests/index"
+ });
+ tab_lab.addMenu({
+ title : "Find Samples",
+ content : "requests/find_samples_index"
+ });
+ tab_lab.addMenu({
+ title : "Help",
+ content : this.options.lims_doc_url
+ });
+ this.master.append(tab_lab);
+ }
+
+ //
+ // Visualization tab.
+ //
+ var tab_visualization = new mod_master.GalaxyMasterTab({
+
+ title : "Visualization",
+ content : "visualization/list"
+ });
+ tab_visualization.addMenu({
+ title : "New Track Browser",
+ content : "visualization/trackster",
+ target : "_frame"
+ });
+ tab_visualization.addMenu({
+ title : "Saved Visualizations",
+ content : "visualization/list",
+ target : "_frame"
+ });
+ this.master.append(tab_visualization);
+
+ //
+ // Cloud menu.
+ //
+ if (this.options.enable_cloud_launch)
+ {
+ var tab_cloud = new mod_master.GalaxyMasterTab({
+ title : "Cloud",
+ content : "cloudlaunch/index"
+ });
+ tab_cloud.addMenu({
+ title : "New Cloud Cluster",
+ content : "cloudlaunch/index"
+ });
+ this.master.append(tab_cloud);
+ }
+
+ //
+ // Admin.
+ //
+ if (this.options.is_admin_user)
+ {
+ var tab_admin = new mod_master.GalaxyMasterTab({
+ title : "Admin",
+ content : "admin/index",
+ extra_class : "admin-only"
+ });
+ this.master.append(tab_admin);
+ }
+
+ //
+ // Help tab.
+ //
+ var tab_help = new mod_master.GalaxyMasterTab({
+ title : "Help"
+ });
+ if (this.options.biostar_url)
+ {
+ tab_help.addMenu({
+ title : "Galaxy Q&A Site",
+ content : this.options.biostar_url_redirect,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Ask a question",
+ content : "biostar/biostar_question_redirect",
+ target : "_blank"
+ });
+ }
+ tab_help.addMenu({
+ title : "Support",
+ content : this.options.support_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Search",
+ content : this.options.search_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Mailing Lists",
+ content : this.options.mailing_lists,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Videos",
+ content : this.options.screencasts_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "Wiki",
+ content : this.options.wiki_url,
+ target : "_blank"
+ });
+ tab_help.addMenu({
+ title : "How to Cite Galaxy",
+ content : this.options.citation_url,
+ target : "_blank"
+ });
+ if (!this.options.terms_url)
+ {
+ tab_help.addMenu({
+ title : "Terms and Conditions",
+ content : this.options.terms_url,
+ target : "_blank"
+ });
+ }
+ this.master.append(tab_help);
+
+ //
+ // User tab.
+ //
+ if (!this.options.user.valid)
+ {
+ var tab_user = new mod_master.GalaxyMasterTab({
+ title : "User",
+ extra_class : "loggedout-only"
+ });
+
+ // login
+ if (this.options.allow_user_creation)
+ {
+ tab_user.addMenu({
+ title : "Login",
+ content : "user/login",
+ target : "galaxy_main"
+ });
+ }
+
+ // register
+ if (this.options.allow_user_creation)
+ {
+ tab_user.addMenu({
+ title : "Register",
+ content : "user/create",
+ target : "galaxy_main"
+ });
+ }
+
+ // add to master
+ this.master.append(tab_user);
+ } else {
+ var tab_user = new mod_master.GalaxyMasterTab({
+ title : "User",
+ extra_class : "loggedin-only"
+ });
+
+ // show user logged in info
+ tab_user.addMenu({
+ title : "Logged in as " + this.options.user.email
+ });
+
+ // remote user
+ if (this.options.use_remote_user && this.options.remote_user_logout_href)
+ {
+ tab_user.addMenu({
+ title : "Logout",
+ content : this.options.remote_user_logout_href,
+ target : "_top"
+ });
+ } else {
+ tab_user.addMenu({
+ title : "Preferences",
+ content : "user?cntrller=user",
+ target : "galaxy_main"
+ });
+
+ tab_user.addMenu({
+ title : "Custom Builds",
+ content : "user/dbkeys",
+ target : "galaxy_main"
+ });
+
+ tab_user.addMenu({
+ title : "Logout",
+ content : "user/logout",
+ target : "_top",
+ divider : true
+ });
+ }
+
+ // default tabs
+ tab_user.addMenu({
+ title : "Saved Histories",
+ content : "history/list",
+ target : "galaxy_main"
+ });
+ tab_user.addMenu({
+ title : "Saved Datasets",
+ content : "dataset/list",
+ target : "galaxy_main"
+ });
+ tab_user.addMenu({
+ title : "Saved Pages",
+ content : "page/list",
+ target : "_top"
+ });
+
+ tab_user.addMenu({
+ title : "API Keys",
+ content : "user/api_keys?cntrller=user",
+ target : "galaxy_main"
+ });
+
+ if (this.options.use_remote_user)
+ {
+ tab_user.addMenu({
+ title : "Public Name",
+ content : "user/edit_username?cntrller=user",
+ target : "galaxy_main"
+ });
+ }
+
+ // add to master
+ this.master.append(tab_user);
+ }
+ }
+});
+
+// return
+return {
+ GalaxyMenu: GalaxyMenu
+};
+
+});
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -173,10 +173,10 @@
var self = this;
displayBtnData.onclick = function(){
Galaxy.frame_manager.frame_new({
- title : "Data Viewer: " + self.model.get('name'),
- type : "url",
- location: "center",
- content : self.urls.display
+ title : "Data Viewer: " + self.model.get('name'),
+ type : "url",
+ target : "galaxy_main",
+ content : self.urls.display
});
};
}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -232,9 +232,9 @@
return function(){// add widget
Galaxy.frame_manager.frame_new(
{
- title : "Visualization",
- type : "url",
- content : visualization_url + '/' + visualization + '?' + $.param( params )
+ title : "Visualization",
+ type : "url",
+ content : visualization_url + '/' + visualization + '?' + $.param( params )
});
};
}
@@ -491,10 +491,11 @@
// add widget
Galaxy.frame_manager.frame_new(
{
- title : "Scatterplot",
- type : "url",
- content : url + '/scatterplot?' + $.param(params),
- location : 'center'
+ title : "Scatterplot",
+ type : "url",
+ content : url + '/scatterplot?' + $.param(params),
+ target : 'galaxy_main',
+ scratchbook : true
});
//TODO: this needs to go away
@@ -553,9 +554,10 @@
// add widget
parent.Galaxy.frame_manager.frame_new({
- title : "Trackster",
- type : "url",
- content : vis_url + "/trackster?" + $.param(dataset_params)
+ title : "Trackster",
+ type : "url",
+ content : vis_url + "/trackster?" + $.param(dataset_params),
+ scratchbook : true
});
});
}
@@ -570,9 +572,10 @@
// add widget
parent.Galaxy.frame_manager.frame_new({
- title : "Trackster",
- type : "url",
- content : url
+ title : "Trackster",
+ type : "url",
+ content : url,
+ scratchbook : true
});
}
}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/galaxy.frame.js
--- a/static/scripts/packed/galaxy.frame.js
+++ b/static/scripts/packed/galaxy.frame.js
@@ -1,1 +1,1 @@
-define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"#everything",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c.event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c.event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this.template());$(this.el).append(this.template_background());$(this.el).append(this.template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this.template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this.panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c.panel_refresh()}})},event:{type:null,target:null,xy:null},events:{mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .frame":"event_frame_mouse_down","mousedown .frame-background":"event_panel_load","mousedown .frame-scroll-up":"event_panel_scroll_up","mousedown .frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.frame_shadow,h);this.frame_insert(this.frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.frame_shadow,c);this.frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this.panel_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this.panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},frame_new:function(d){if(!this.active){if(d.location=="center"){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this.template_frame(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(f.id).css("z-index"));this.frame_list[e]=f;this.frame_counter++;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},template:function(){return'<div class="galaxy-frame"></div>'},template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},template_background:function(){return'<div class="frame-background"></div>'},template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
+define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"body",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c._event_panel_active(f)},on_unload:function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-eye",tooltip:"Show/Hide Scratchbook",on_click:function(f){c._event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this._template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this._panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c._panel_refresh()}})},frame_new:function(d){var g={title:"",content:null,target:"",type:null,scratchbook:false};if(d){d=_.defaults(d,g)}else{d=g}if(!d.content){return}if(d.target=="_blank"){window.open(d.content);return}if(d.target=="_top"||d.target=="_parent"||d.target=="_self"){window.location=d.content;return}if(!this.active){var f=$(window.parent.document).find("#galaxy_main");if(d.target=="galaxy_main"||d.target=="center"){if(f.length==0){var c=d.content;if(c.indexOf("?")==-1){c+="?"}else{c+="&"}c+="use_panels=True";window.location=c}else{f.attr("src",d.content)}}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this._template_frame(e.substring(1),d.title,d.type,d.content));var h={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this._to_pixel_coord("width",this.options.frame.cols);d.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(h.id).css("z-index"));this.frame_list[e]=h;this.frame_counter++;this._frame_resize(h,{width:d.width,height:d.height});this._frame_insert(h,{top:0,left:0},true);if(!this.visible){this._panel_show_hide()}},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_panel_load","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this._frame_identify(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this._frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this._frame_resize(this.event.target,h);h.width=this._to_grid_coord("width",h.width)+1;h.height=this._to_grid_coord("height",h.height)+1;h.width=this._to_pixel_coord("width",h.width);h.height=this._to_pixel_coord("height",h.height);this._frame_resize(this.frame_shadow,h);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this._frame_offset(this.event.target,h);var c={top:this._to_grid_coord("top",h.top),left:this._to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this._frame_insert(this.frame_shadow,c)}},_event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this._frame_identify(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c._panel_refresh(true);c._panel_animation_complete();if(c.visible&&c.frame_counter==0){c._panel_show_hide()}})},_event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},_event_panel_load:function(c){if(this.event.type!==null){return}this._panel_show_hide()},_event_panel_active:function(c){if(this.event.type!==null){return}this._panel_active_disable()},_event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},_frame_drag_start:function(d){this._frame_focus(d,true);var c=this._frame_screen(d);this._frame_resize(this.frame_shadow,c);this._frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(d){this._frame_focus(d,false);var c=this._frame_screen(this.frame_shadow);this._frame_resize(d,c);this._frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},_to_grid:function(c){return{top:this._to_grid_coord("top",c.top),left:this._to_grid_coord("left",c.left),width:this._to_grid_coord("width",c.width),height:this._to_grid_coord("height",c.height)}},_to_pixel:function(c){return{top:this._to_pixel_coord("top",c.top),left:this._to_pixel_coord("left",c.left),width:this._to_pixel_coord("width",c.width),height:this._to_pixel_coord("height",c.height)}},_is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},_location_rank:function(c){return(c.top*this.cols)+c.left},_menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},_panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c._panel_scroll(0,true)})},_panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,c)},_panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this._frame_offset(g,f,c)}}this.top=e}this._menu_refresh()},_panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-eye-slash");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-eye");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this._panel_refresh()}},_panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this._panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},_frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this._location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this._frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(k,d){k.grid_location=null;var h=this._to_grid(this._frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this._is_collision(h)){c=true;break}}if(c){break}}if(c){this._frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},_frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this._frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c._frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},_frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},_frame_grid:function(e,c,d){e.grid_location=c;this._frame_offset(e,this._to_pixel(c),d);e.grid_rank=this._location_rank(c)},_frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa fa-thumb-tack"></span><span class="f-icon f-close fa fa-trash-o"></span></div><div class="f-content">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_template_menu:function(){return'<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div><div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/galaxy.master.js
--- a/static/scripts/packed/galaxy.master.js
+++ b/static/scripts/packed/galaxy.master.js
@@ -1,1 +1,1 @@
-define(["libs/backbone/backbone-relational"],function(){var a=Backbone.View.extend({el_master:"#masthead",list:[],initialize:function(d){this.setElement($(this.template()));$(this.el_master).append($(this.el));var c=this;window.onbeforeunload=function(){var f="";for(key in c.list){if(c.list[key].options.on_unload){var e=c.list[key].options.on_unload();if(e){f+=e+" "}}}if(f!=""){return f}}},events:{mousedown:function(c){c.preventDefault()}},append:function(c){$(this.el).append($(c.el));this.list.push(c)},prepend:function(c){$(this.el).prepend($(c.el));this.list.push(c)},template:function(){return'<div class="iconbar"></div>'}});var b=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}this.setElement($(this.template(this.options)));var c=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("click",c.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(c){$(this.el).find(".icon").removeClass(this.options.icon).addClass(c);this.options.icon=c},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(c){$(this.el).find(".number").text(c)},template:function(d){var c="<div id="+d.id+' class="symbol"><div class="icon fa fa-2x '+d.icon+'"></div>';if(d.with_number){c+='<div class="number"></div>'}c+="</div>";return c}});return{GalaxyMaster:a,GalaxyMasterIcon:b}});
\ No newline at end of file
+define(["utils/galaxy.utils","libs/backbone/backbone-relational"],function(c){var a=Backbone.View.extend({el_master:"#everything",options:null,list:{},itemLast:null,itemCounter:0,$background:null,backgroundVisible:false,initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_master).append($(this.el));this.$background=$(this.el).find("#master-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_eventRefresh",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},_add:function(g,f){var e=$(this.el).find("#"+g.masterLocation);if(e){var h="master-item-"+this.itemCounter++;var i=$(g.el);i.attr("id",h);i.addClass("master-item");if(f){e.append(i)}else{e.prepend(i)}this.list[h]=g;return h}return null},_eventRefresh:function(h){var i=$(h.target).closest(".master-item");if(i.length){i=i.attr("id")}if(this.itemLast&&this.itemLast!=i){var g=this.list[this.itemLast];if(g){if(g.masterReset){g.masterReset()}}}var f=false;if(i){var g=this.list[i];if(g){if(g.masterReset){if(this.itemLast==i){f=this.backgroundVisible?false:true}else{f=true}}}}if(f){this.$background.show()}else{this.$background.hide()}this.backgroundVisible=f;this.itemLast=i},_templateItem:function(e){return'<div id="'+e+'" class="master-item"></div>'},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="master-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var d=Backbone.View.extend({options:{id:"galaxy-icon",icon:"fa-cog",tooltip:"galaxy-icon",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},masterLocation:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e="<div id="+f.id+' class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var b=Backbone.View.extend({options:{id:"",title:"Title",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true},masterLocation:"navbar",$menu:null,menuVisible:false,events:{"click .head":"_eventClickHead"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},addMenu:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".menu")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();e._hideMenu();if(e.options.target==="_blank"){return true}Galaxy.frame_manager.frame_new(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},masterReset:function(){this._hideMenu()},_hideMenu:function(){if(this.$menu&&this.menuVisible){this.$menu.hide();this.menuVisible=false}},_eventClickHead:function(f){f.preventDefault();if(this.$menu){if(!this.menuVisible){this.$menu.show();this.menuVisible=true}else{this.$menu.hide();this.menuVisible=false}}else{Galaxy.frame_manager.frame_new(this.options)}},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="menu dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMaster:a,GalaxyMasterTab:b,GalaxyMasterIcon:d}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer: "+c.model.get("name"),type:"url",location:"center",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>";if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>";if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1312,7 +1312,7 @@
#masthead .navbar-brand{position:absolute;left:0;top:0;font-family:verdana;font-weight:bold;font-size:20px;line-height:1;color:white;padding:5px 20px 12px;margin-left:-15px;z-index:2000}#masthead .navbar-brand img{display:inline;width:26px;vertical-align:top}
#masthead .navbar-brand a{color:white;text-decoration:none}
#masthead .iconbar{position:absolute;top:5px;right:110px;cursor:pointer;color:#999;overflow:hidden}#masthead .iconbar .symbol{float:left;margin:0px 10px}
-#masthead .iconbar .symbol .number{font-weight:bold;font-size:10px;font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif;position:relative;left:23px;top:-16px}
+#masthead .iconbar .symbol .number{font-weight:bold;font-size:10px;font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif;position:relative;left:23px;top:-12px}
#masthead .iconbar .toggle{color:#BCC800}
.quota-meter-container{position:absolute;top:0;right:0;height:32px}
.quota-meter{position:absolute;top:8px;right:8px;height:16px;width:100px;background-color:#f5f5f5}
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f static/style/src/less/base.less
--- a/static/style/src/less/base.less
+++ b/static/style/src/less/base.less
@@ -440,7 +440,7 @@
font-family : @font-family-sans-serif;
position : relative;
left : 23px;
- top : -16px;
+ top : -12px;
}
.toggle
diff -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 -r 5828950834e3c888683dbeb567e10bcaf335c94f templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -93,15 +93,6 @@
"libs/backbone/backbone-relational": ["libs/backbone/backbone"]
}
});
-
- ## load galaxy js-modules
- require(['galaxy.master', 'galaxy.frame', 'galaxy.modal', 'galaxy.upload'], function(master, frame, modal, upload)
- {
- Galaxy.master = new master.GalaxyMaster();
- Galaxy.frame_manager = new frame.GalaxyFrameManager();
- Galaxy.modal = new modal.GalaxyModal();
- ##Galaxy.upload = new upload.GalaxyUpload();
- });
</script></%def>
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History panel: fix naming bug in purge async error handling
by commits-noreply@bitbucket.org 05 Nov '13
by commits-noreply@bitbucket.org 05 Nov '13
05 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/151b7d3b2f1b/
Changeset: 151b7d3b2f1b
Branch: stable
User: carlfeberhard
Date: 2013-11-05 17:33:06
Summary: History panel: fix naming bug in purge async error handling
Affected #: 2 files
diff -r 5c789ab4144ac9db6c91b5646032894cae016309 -r 151b7d3b2f1b8cf4ba6050214693eee776410574 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -58,7 +58,7 @@
xhr.error( function( error, status, message ){
//TODO: Exception messages are hidden within error page
//!NOTE: that includes the 'Removal of datasets by users is not allowed in this Galaxy instance.'
- view.trigger( 'error',
+ hdaView.trigger( 'error',
hdaView, xhr, { url: purge_url }, _l( "Unable to purge this dataset" ) );
});
});
diff -r 5c789ab4144ac9db6c91b5646032894cae016309 -r 151b7d3b2f1b8cf4ba6050214693eee776410574 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){view.trigger("error",a,f,{url:b},_l("Unable to purge this dataset"))})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.trigger("error",a,null,null,{url:b},_l("deletion failed"));a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:f+"/"+h+"?"+$.param(g)})}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",a,g,{url:a.urls.tags.get},_l("Tagging failed"))},success:function(e){b.html(e);b.find("[title]").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(c){this.log(this+".loadAndDisplayAnnotation",c);var a=this,e=this.$el.find(".annotation-area"),d=e.find(".annotation-elt"),b=this.urls.annotation.set;if(e.is(":hidden")){if(!jQuery.trim(d.html())){$.ajax({url:this.urls.annotation.get,error:function(h,f,g){a.log("Annotation failed",h,f,g);a.trigger("error",a,h,{url:a.urls.annotation.get},_l("Annotation failed"))},success:function(f){if(f===""){f="<em>"+_l("Describe or add notes to dataset")+"</em>"}d.html(f);e.find("[title]").tooltip();async_save_text(d.attr("id"),d.attr("id"),b,"new_annotation",18,true,4);e.slideDown("fast")}})}else{e.slideDown("fast")}}else{e.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:a+"/scatterplot?"+$.param(b),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){f.Galaxy.modal.hide()},"View in saved visualization":function(){f.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:e,buttons:{Cancel:function(){f.Galaxy.modal.hide()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){f.Galaxy.modal.hide();var g=$(this).val();c.id=g;f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})})}}})},"View in new visualization":function(){f.Galaxy.modal.hide();var g=a+"/trackster?"+$.param(c);f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g})}}})}});return false}};
\ No newline at end of file
+var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){a.trigger("error",a,f,{url:b},_l("Unable to purge this dataset"))})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.trigger("error",a,null,null,{url:b},_l("deletion failed"));a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:f+"/"+h+"?"+$.param(g)})}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",a,g,{url:a.urls.tags.get},_l("Tagging failed"))},success:function(e){b.html(e);b.find("[title]").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(c){this.log(this+".loadAndDisplayAnnotation",c);var a=this,e=this.$el.find(".annotation-area"),d=e.find(".annotation-elt"),b=this.urls.annotation.set;if(e.is(":hidden")){if(!jQuery.trim(d.html())){$.ajax({url:this.urls.annotation.get,error:function(h,f,g){a.log("Annotation failed",h,f,g);a.trigger("error",a,h,{url:a.urls.annotation.get},_l("Annotation failed"))},success:function(f){if(f===""){f="<em>"+_l("Describe or add notes to dataset")+"</em>"}d.html(f);e.find("[title]").tooltip();async_save_text(d.attr("id"),d.attr("id"),b,"new_annotation",18,true,4);e.slideDown("fast")}})}else{e.slideDown("fast")}}else{e.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:a+"/scatterplot?"+$.param(b),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){f.Galaxy.modal.hide()},"View in saved visualization":function(){f.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:e,buttons:{Cancel:function(){f.Galaxy.modal.hide()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){f.Galaxy.modal.hide();var g=$(this).val();c.id=g;f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})})}}})},"View in new visualization":function(){f.Galaxy.modal.hide();var g=a+"/trackster?"+$.param(c);f.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g})}}})}});return false}};
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b8eb9c6131fe/
Changeset: b8eb9c6131fe
Branch: mapped_str_update_in_filter1
User: BjoernGruening
Date: 2013-10-25 10:34:28
Summary: add [ and ] to mapped strings and advanced filters
Affected #: 1 file
diff -r d57971b60b8d907c33bf4dfc1bba2432baaf96e9 -r b8eb9c6131feca3b270cad3cceb2335f5c6f4244 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -48,6 +48,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
https://bitbucket.org/galaxy/galaxy-central/commits/a6452bf916e3/
Changeset: a6452bf916e3
User: jmchilton
Date: 2013-11-05 06:42:06
Summary: Merge Pull Request #244.
Affected #: 1 file
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r a6452bf916e388d7ae49bc3a6cc4565332e74724 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -174,6 +174,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
https://bitbucket.org/galaxy/galaxy-central/commits/5986d0a2628f/
Changeset: 5986d0a2628f
Branch: mapped_str_update_in_filter1
User: jmchilton
Date: 2013-11-05 06:43:22
Summary: Close branch mapped_str_update_in_filter1
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/c67b9518c1e0/
Changeset: c67b9518c1e0
User: jmchilton
Date: 2013-11-05 06:48:18
Summary: Merge.
Affected #: 1 file
diff -r 815129b821b624f3ef4c61e13546d0d3e17e7f93 -r c67b9518c1e0dc1d04d5dfb78a10b0b7847eb6b6 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -174,6 +174,8 @@
'__ge__': '>=',
'__sq__': '\'',
'__dq__': '"',
+ '__ob__': '[',
+ '__cb__': ']',
}
for key, value in mapped_str.items():
cond_text = cond_text.replace( key, value )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bcd8ece8aebe/
Changeset: bcd8ece8aebe
Branch: r_environment_enhancement
User: BjoernGruening
Date: 2013-10-31 10:45:09
Summary: allow more actions after setup_r_environment
Affected #: 1 file
diff -r d57971b60b8d907c33bf4dfc1bba2432baaf96e9 -r bcd8ece8aebe27ed06468d7cf3eb6dfa9dda6293 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -347,6 +347,7 @@
# <!-- allow installing an R packages -->
# <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGe…</package>
# </action>
+ filtered_actions = actions[ 1: ]
if action_dict.get( 'env_shell_file_paths', False ):
install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] )
https://bitbucket.org/galaxy/galaxy-central/commits/815129b821b6/
Changeset: 815129b821b6
User: jmchilton
Date: 2013-11-05 06:47:04
Summary: Merged in BjoernGruening/galaxy-central-bgruening/r_environment_enhancement (pull request #249)
allow more actions after setup_r_environment
Affected #: 1 file
diff -r c458a0fe1ba816098fed03370f425f346bb1df68 -r 815129b821b624f3ef4c61e13546d0d3e17e7f93 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -347,6 +347,7 @@
# <!-- allow installing an R packages -->
# <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGe…</package>
# </action>
+ filtered_actions = actions[ 1: ]
if action_dict.get( 'env_shell_file_paths', False ):
install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e094c73fed4d/
Changeset: e094c73fed4d
Branch: stable
User: jmchilton
Date: 2013-11-04 20:55:00
Summary: White-list expressions executed by filtering and dna_filtering tools.
Affected #: 2 files
diff -r 1f0e7ae9e324fcc1e12105651269016f2edb925f -r e094c73fed4dc66b589932edb83412cb8b827cd3 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 1f0e7ae9e324fcc1e12105651269016f2edb925f -r e094c73fed4dc66b589932edb83412cb8b827cd3 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/f79149dd3d35/
Changeset: f79149dd3d35
Branch: next-stable
User: natefoo
Date: 2013-11-04 20:56:17
Summary: Merge security fix for filtering tools from stable.
Affected #: 2 files
diff -r 2be3aed79643555879b1b5154449872bcd6447da -r f79149dd3d35909bf3d6332750b62823fe146034 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 2be3aed79643555879b1b5154449872bcd6447da -r f79149dd3d35909bf3d6332750b62823fe146034 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/c458a0fe1ba8/
Changeset: c458a0fe1ba8
User: natefoo
Date: 2013-11-04 20:56:57
Summary: Merge security fix for filtering tools from stable/next-stable.
Affected #: 2 files
diff -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 -r c458a0fe1ba816098fed03370f425f346bb1df68 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py
+++ b/tools/stats/dna_filtering.py
@@ -19,13 +19,143 @@
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-#assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ elif name == "codes":
+ return True
+ else:
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
+
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -148,6 +278,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+ if not check_expression( cond_text ):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Prepare the column variable names and wrappers for column data types
cols, type_casts = [], []
for col in range( 1, in_columns + 1 ):
diff -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 -r c458a0fe1ba816098fed03370f425f346bb1df68 tools/stats/filtering.py
--- a/tools/stats/filtering.py
+++ b/tools/stats/filtering.py
@@ -6,13 +6,139 @@
import sys, re, os.path
from galaxy import eggs
+from ast import parse, Module, walk
+
# Older py compatibility
try:
set()
except:
from sets import Set as set
-assert sys.version_info[:2] >= ( 2, 4 )
+AST_NODE_TYPE_WHITELIST = [
+ 'Expr', 'Load',
+ 'Str', 'Num', 'BoolOp',
+ 'Compare', 'And', 'Eq',
+ 'NotEq', 'Or', 'GtE',
+ 'LtE', 'Lt', 'Gt',
+ 'BinOp', 'Add', 'Div',
+ 'Sub', 'Mult', 'Mod',
+ 'Pow', 'LShift', 'GShift',
+ 'BitAnd', 'BitOr', 'BitXor',
+ 'UnaryOp', 'Invert', 'Not',
+ 'NotIn', 'In', 'Is',
+ 'IsNot', 'List',
+ 'Index', 'Subscript',
+ # Further checks
+ 'Name', 'Call', 'Attribute',
+]
+
+
+BUILTIN_AND_MATH_FUNCTIONS = 'abs|all|any|bin|chr|cmp|complex|divmod|float|hex|int|len|long|max|min|oct|ord|pow|range|reversed|round|sorted|str|sum|type|unichr|unicode|log|exp|sqrt|ceil|floor'.split('|')
+STRING_AND_LIST_METHODS = [ name for name in dir('') + dir([]) if not name.startswith('_') ]
+VALID_FUNCTIONS = BUILTIN_AND_MATH_FUNCTIONS + STRING_AND_LIST_METHODS
+
+
+def __check_name( ast_node ):
+ name = ast_node.id
+ if re.match(r'^c\d+$', name):
+ return True
+ return name in VALID_FUNCTIONS
+
+
+def __check_attribute( ast_node ):
+ attribute_name = ast_node.attr
+ if attribute_name not in STRING_AND_LIST_METHODS:
+ return False
+ return True
+
+
+def __check_call( ast_node ):
+ # If we are calling a function or method, it better be a math,
+ # string or list function.
+ ast_func = ast_node.func
+ ast_func_class = ast_func.__class__.__name__
+ if ast_func_class == 'Name':
+ if ast_func.id not in BUILTIN_AND_MATH_FUNCTIONS:
+ return False
+ elif ast_func_class == 'Attribute':
+ if not __check_attribute( ast_func ):
+ return False
+ else:
+ return False
+
+ return True
+
+
+def check_expression( text ):
+ """
+
+ >>> check_expression("c1=='chr1' and c3-c2>=2000 and c6=='+'")
+ True
+ >>> check_expression("eval('1+1')")
+ False
+ >>> check_expression("import sys")
+ False
+ >>> check_expression("[].__str__")
+ False
+ >>> check_expression("__builtins__")
+ False
+ >>> check_expression("'x' in globals")
+ False
+ >>> check_expression("'x' in [1,2,3]")
+ True
+ >>> check_expression("c3=='chr1' and c5>5")
+ True
+ >>> check_expression("c3=='chr1' and d5>5") # Invalid d5 reference
+ False
+ >>> check_expression("c3=='chr1' and c5>5 or exec")
+ False
+ >>> check_expression("type(c1) != type(1)")
+ True
+ >>> check_expression("c1.split(',')[1] == '1'")
+ True
+ >>> check_expression("exec 1")
+ False
+ >>> check_expression("str(c2) in [\\\"a\\\",\\\"b\\\"]")
+ True
+ """
+ try:
+ module = parse( text )
+ except SyntaxError:
+ return False
+
+ if not isinstance(module, Module):
+ return False
+ statements = module.body
+ if not len( statements ) == 1:
+ return False
+ expression = statements[0]
+ if expression.__class__.__name__ != 'Expr':
+ return False
+
+ for ast_node in walk( expression ):
+ ast_node_class = ast_node.__class__.__name__
+
+ # Toss out everything that is not a "simple" expression,
+ # imports, error handling, etc...
+ if ast_node_class not in AST_NODE_TYPE_WHITELIST:
+ return False
+
+ # White-list more potentially dangerous types AST elements.
+ if ast_node_class == 'Name':
+ # In order to prevent loading 'exec', 'eval', etc...
+ # put string restriction on names allowed.
+ if not __check_name( ast_node ):
+ return False
+ # Check only valid, white-listed functions are called.
+ elif ast_node_class == 'Call':
+ if not __check_call( ast_node ):
+ return False
+ # Check only valid, white-listed attributes are accessed
+ elif ast_node_class == 'Attribute':
+ if not __check_attribute( ast_node ):
+ return False
+
+ return True
def get_operands( filter_condition ):
# Note that the order of all_operators is important
@@ -62,6 +188,9 @@
if operand in secured:
stop_err( "Illegal value '%s' in condition '%s'" % ( operand, cond_text ) )
+if not check_expression(cond_text):
+ stop_err( "Illegal/invalid in condition '%s'" % ( cond_text ) )
+
# Work out which columns are used in the filter (save using 1 based counting)
used_cols = sorted(set(int(match.group()[1:]) \
for match in re.finditer('c(\d)+', cond_text)))
@@ -120,7 +249,6 @@
first_invalid_line = i + 1
invalid_line = line
''' % ( assign, wrap, cond_text )
-
valid_filter = True
try:
exec code
https://bitbucket.org/galaxy/galaxy-central/commits/740e7adcbaa4/
Changeset: 740e7adcbaa4
Branch: next-stable
User: natefoo
Date: 2013-11-04 20:57:29
Summary: Close next-stable branch.
Affected #: 0 files
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History panel: remove refs to urls.tags
by commits-noreply@bitbucket.org 02 Nov '13
by commits-noreply@bitbucket.org 02 Nov '13
02 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6d633418ecfa/
Changeset: 6d633418ecfa
User: carlfeberhard
Date: 2013-11-02 17:41:18
Summary: History panel: remove refs to urls.tags
Affected #: 2 files
diff -r 68c80bac0d4d71854526f6e56156f09b46059205 -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -298,7 +298,7 @@
* @returns {jQuery} rendered DOM
*/
_render_tagButton : function(){
- if( !this.hasUser || !this.urls.tags.get ){
+ if( !this.hasUser ){
return null;
}
@@ -320,7 +320,7 @@
* @returns {jQuery} rendered DOM
*/
_render_annotateButton : function(){
- if( !this.hasUser || !this.urls.annotation.get ){
+ if( !this.hasUser ){
return null;
}
diff -r 68c80bac0d4d71854526f6e56156f09b46059205 -r 6d633418ecfa98b8c7028de024b76c4ae37aacf8 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser||!this.urls.tags.get){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser||!this.urls.annotation.get){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.enabled=false;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame_manager.frame_new({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_tagButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"})},_render_annotateButton:function(){if(!this.hasUser){return null}return faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"})},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);g.find(".dataset-actions .left").append(this._render_visualizationsButton());g.find(".dataset-actions .right").append([this._render_tagButton(),this._render_annotateButton()]);this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display")}).render();return g},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge","click .dataset-tag-btn":"displayTags","click .dataset-annotate-btn":"loadAndDisplayAnnotation"},confirmPurge:function c(g){this.model.purge();return false},displayTags:function(g){this.$el.find(".tags-display").slideToggle(this.fxSpeed);return false},loadAndDisplayAnnotation:function(j){this.log(this+".loadAndDisplayAnnotation",j);var i=this,h=this.$el.find(".annotation-display"),g=h.find(".annotation");if(h.is(":hidden")){if(!jQuery.trim(g.html())){var k=$.ajax(this.urls.annotation.get);k.fail(function(n,l,m){i.log("Annotation failed",n,l,m);i.trigger("error",i,n,{},_l("Annotation failed"))});k.done(function(l){l=l||"<em>"+_l("Describe or add notes to dataset")+"</em>";g.html(l);h.find("[title]").tooltip();g.make_text_editable({use_textarea:true,on_finish:function(m){g.text(m);i.model.save({annotation:m},{silent:true}).fail(function(){g.text(i.model.previous("annotation"))})}});h.slideDown(i.fxSpeed)})}else{h.slideDown(i.fxSpeed)}}else{h.slideUp(i.fxSpeed)}return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame_manager.frame_new({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),location:"center"});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i)})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame_manager.frame_new({title:"Trackster",type:"url",content:m})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2be3aed79643/
Changeset: 2be3aed79643
Branch: next-stable
User: greg
Date: 2013-11-02 16:04:47
Summary: Fix for handling a repository dependency that has a tool dependency in error because it has a missing env.sh file.
Affected #: 1 file
diff -r 52df185d7552f2ecc13097bdae86388faf640990 -r 2be3aed79643555879b1b5154449872bcd6447da lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -272,7 +272,12 @@
env_var_dict[ 'value' ] = new_value
new_env_var_dicts.append( env_var_dict )
else:
- log.debug( 'Invalid file %s specified, ignoring set_environment_for_install action.', env_sh_file_path )
+ tool_dependency.status = app.model.ToolShedRepository.installation_status.ERROR
+ error_message = 'Invalid file %s specified, ignoring set_environment_for_install action.', env_sh_file_path
+ tool_dependency.error_message = error_message
+ sa_session = app.model.context.current
+ sa_session.add( tool_dependency )
+ sa_session.flush()
action_dict[ 'environment_variable' ] = new_env_var_dicts
else:
action_dict[ 'environment_variable' ] = env_var_dicts
https://bitbucket.org/galaxy/galaxy-central/commits/68c80bac0d4d/
Changeset: 68c80bac0d4d
User: greg
Date: 2013-11-02 16:05:11
Summary: Merged from next-stable
Affected #: 1 file
diff -r ea6ff3d7224db5d218eefa91af1b08626229eae1 -r 68c80bac0d4d71854526f6e56156f09b46059205 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -272,7 +272,12 @@
env_var_dict[ 'value' ] = new_value
new_env_var_dicts.append( env_var_dict )
else:
- log.debug( 'Invalid file %s specified, ignoring set_environment_for_install action.', env_sh_file_path )
+ tool_dependency.status = app.model.ToolShedRepository.installation_status.ERROR
+ error_message = 'Invalid file %s specified, ignoring set_environment_for_install action.', env_sh_file_path
+ tool_dependency.error_message = error_message
+ sa_session = app.model.context.current
+ sa_session.add( tool_dependency )
+ sa_session.flush()
action_dict[ 'environment_variable' ] = new_env_var_dicts
else:
action_dict[ 'environment_variable' ] = env_var_dicts
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/52df185d7552/
Changeset: 52df185d7552
Branch: next-stable
User: Dave Bouvier
Date: 2013-11-01 21:08:49
Summary: Update RSS feed filters to reflect which revisions are regularly tested and relevant to display.
Affected #: 1 file
diff -r 7c60a5b67c3ec7825d3d2511f27867823de19350 -r 52df185d7552f2ecc13097bdae86388faf640990 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1552,6 +1552,8 @@
trans.model.Repository.table.c.user_id == user.id ) ):
if not metadata_row.tool_test_results:
continue
+ if metadata_row.changeset_revision != metadata_row.repository.tip( trans.app ):
+ continue
current_repository_errors = []
tool_dependency_errors = []
repository_dependency_errors = []
https://bitbucket.org/galaxy/galaxy-central/commits/ea6ff3d7224d/
Changeset: ea6ff3d7224d
User: Dave Bouvier
Date: 2013-11-01 21:09:23
Summary: Merge with next-stable.
Affected #: 1 file
diff -r 78388e08a9a15fcbe77e78430a7ac05a46e405bd -r ea6ff3d7224db5d218eefa91af1b08626229eae1 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1552,6 +1552,8 @@
trans.model.Repository.table.c.user_id == user.id ) ):
if not metadata_row.tool_test_results:
continue
+ if metadata_row.changeset_revision != metadata_row.repository.tip( trans.app ):
+ continue
current_repository_errors = []
tool_dependency_errors = []
repository_dependency_errors = []
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Users API: add UsesTagsMixin
by commits-noreply@bitbucket.org 01 Nov '13
by commits-noreply@bitbucket.org 01 Nov '13
01 Nov '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/78388e08a9a1/
Changeset: 78388e08a9a1
User: carlfeberhard
Date: 2013-11-01 20:54:56
Summary: Users API: add UsesTagsMixin
Affected #: 1 file
diff -r d69e53660b28c5b84a9b6606b7ab989303cc74c6 -r 78388e08a9a15fcbe77e78430a7ac05a46e405bd lib/galaxy/webapps/galaxy/api/users.py
--- a/lib/galaxy/webapps/galaxy/api/users.py
+++ b/lib/galaxy/webapps/galaxy/api/users.py
@@ -4,12 +4,12 @@
import logging
from paste.httpexceptions import HTTPBadRequest, HTTPNotImplemented
from galaxy import util, web
-from galaxy.web.base.controller import BaseAPIController
+from galaxy.web.base.controller import BaseAPIController, UsesTagsMixin
log = logging.getLogger( __name__ )
-class UserAPIController( BaseAPIController ):
+class UserAPIController( BaseAPIController, UsesTagsMixin ):
@web.expose_api
def index( self, trans, deleted='False', **kwd ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0