galaxy-commits
Threads by month
- ----- 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
January 2015
- 2 participants
- 248 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2ea487b70602/
Changeset: 2ea487b70602
User: dannon
Date: 2015-01-26 13:54:29+00:00
Summary: Log when using virtualenv at Galaxy startup.
Affected #: 1 file
diff -r 36a5b25e0d33efdaaa0a6abb96468f648ee206f5 -r 2ea487b70602bd94f442243e27f00fca92693c33 run.sh
--- a/run.sh
+++ b/run.sh
@@ -6,6 +6,7 @@
# should run this instance in.
if [ -d .venv ];
then
+ printf "Activating virtualenv at %s/.venv\n" $(pwd)
. .venv/bin/activate
fi
https://bitbucket.org/galaxy/galaxy-central/commits/39f3f0586c48/
Changeset: 39f3f0586c48
User: dannon
Date: 2015-01-26 13:58:29+00:00
Summary: Allow admin users to change user information (like email addresses) when using remote_auth; otherwise should a user email address change you had to manually edit the database.
Affected #: 1 file
diff -r 2ea487b70602bd94f442243e27f00fca92693c33 -r 39f3f0586c48f81452e3a7a6af1f5e97c4ef8ed0 lib/galaxy/web/framework/middleware/remoteuser.py
--- a/lib/galaxy/web/framework/middleware/remoteuser.py
+++ b/lib/galaxy/web/framework/middleware/remoteuser.py
@@ -64,7 +64,7 @@
# If the secret header is enabled, we expect upstream to send along some key
# in HTTP_GX_SECRET, so we'll need to compare that here to the correct value
- #
+ #
# This is not an ideal location for this function. The reason being
# that because this check is done BEFORE the REMOTE_USER check, it is
# possible to attack the GX_SECRET key without having correct
@@ -79,8 +79,8 @@
title = "Access to Galaxy is denied"
message = """
Galaxy is configured to authenticate users via an external
- method (such as HTTP authentication in Apache), but an
- incorrect shared secret key was provided by the
+ method (such as HTTP authentication in Apache), but an
+ incorrect shared secret key was provided by the
upstream (proxy) server.</p><p>Please contact your local Galaxy administrator. The
variable <code>remote_user_secret</code> and
@@ -88,7 +88,7 @@
access Galaxy.
"""
return self.error( start_response, title, message )
-
+
if not environ.get(self.remote_user_header, '(null)').startswith('(null)'):
if not environ[ self.remote_user_header ].count( '@' ):
if self.maildomain is not None:
@@ -114,6 +114,8 @@
pass # admins can create users
elif path_info.startswith( '/user/logout' ) and environ[ self.remote_user_header ] in self.admin_users:
pass # Admin users may be impersonating, allow logout.
+ elif path_info.startswith( '/user/manage_user_info' ) and environ[ self.remote_user_header ] in self.admin_users:
+ pass # Admin users need to be able to change user information
elif path_info.startswith( '/user/api_keys' ):
pass # api keys can be managed when remote_user is in use
elif path_info.startswith( '/user/edit_username' ):
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: jmchilton: Toolbox: Watch even empty directories if they are explicitly tool_dir specified.
by commits-noreply@bitbucket.org 25 Jan '15
by commits-noreply@bitbucket.org 25 Jan '15
25 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/36a5b25e0d33/
Changeset: 36a5b25e0d33
User: jmchilton
Date: 2015-01-26 00:18:53+00:00
Summary: Toolbox: Watch even empty directories if they are explicitly tool_dir specified.
Affected #: 1 file
diff -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 -r 36a5b25e0d33efdaaa0a6abb96468f648ee206f5 lib/galaxy/tools/toolbox/base.py
--- a/lib/galaxy/tools/toolbox/base.py
+++ b/lib/galaxy/tools/toolbox/base.py
@@ -759,9 +759,9 @@
def _load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
- self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=True )
- def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive, force_watch=False ):
def quick_load( tool_file, async=True ):
try:
@@ -793,7 +793,7 @@
elif name.endswith( ".xml" ):
quick_load( child_path, async=False )
tool_loaded = True
- if tool_loaded:
+ if tool_loaded or force_watch:
self._tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
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
24 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/31cb0fdae229/
Changeset: 31cb0fdae229
User: guerler
Date: 2015-01-24 08:53:07+00:00
Summary: Upload: Remove spaces
Affected #: 7 files
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -458,25 +458,25 @@
class_partial : 'fa fa-minus-square-o',
value : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement($('<div/>'));
-
+
// set initial value
this.value(Boolean(this.options.value));
-
+
// add event handler
var self = this;
this.$el.on('click', function() {
self.value(!self.current);
});
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select',],
+ 'mvc/ui/ui-select'],
function( Utils,
UploadModel,
@@ -125,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 client/galaxy/scripts/mvc/upload/upload-view.js
--- a/client/galaxy/scripts/mvc/upload/upload-view.js
+++ b/client/galaxy/scripts/mvc/upload/upload-view.js
@@ -40,7 +40,7 @@
// extension selector
select_extension : null,
-
+
// genome selector
select_genome: null,
@@ -226,7 +226,7 @@
container : self.$el.parent().find('#header-extension'),
value : self.list_extensions[0]
});
-
+
// handle extension info popover
self.$el.parent().find('#header-extension-info').on('click' , function(e) {
self.showExtensionInfo({
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -458,25 +458,25 @@
class_partial : 'fa fa-minus-square-o',
value : false
},
-
+
// initialize
initialize : function(options) {
// configure options
this.options = Utils.merge(options, this.optionsDefault);
-
+
// create new element
this.setElement($('<div/>'));
-
+
// set initial value
this.value(Boolean(this.options.value));
-
+
// add event handler
var self = this;
this.$el.on('click', function() {
self.value(!self.current);
});
},
-
+
// value
value : function (new_val) {
if (new_val !== undefined) {
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select',],
+ 'mvc/ui/ui-select'],
function( Utils,
UploadModel,
@@ -125,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -40,7 +40,7 @@
// extension selector
select_extension : null,
-
+
// genome selector
select_genome: null,
@@ -226,7 +226,7 @@
container : self.$el.parent().find('#header-extension'),
value : self.list_extensions[0]
});
-
+
// handle extension info popover
self.$el.parent().find('#header-extension-info').on('click' , function(e) {
self.showExtensionInfo({
diff -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 -r 31cb0fdae2298b2a7ad882c465fa88ec98082f26 static/scripts/packed/mvc/upload/upload-row.js
--- a/static/scripts/packed/mvc/upload/upload-row.js
+++ b/static/scripts/packed/mvc/upload/upload-row.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select",],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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="'+this.status_classes.init+'"></div></td></tr>'}})});
\ 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
commit/galaxy-central: guerler: Upload: Add additional options, revise merged pull request
by commits-noreply@bitbucket.org 24 Jan '15
by commits-noreply@bitbucket.org 24 Jan '15
24 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dc3357ffb6d9/
Changeset: dc3357ffb6d9
User: guerler
Date: 2015-01-24 08:49:12+00:00
Summary: Upload: Add additional options, revise merged pull request
Affected #: 15 files
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -448,6 +448,54 @@
}
});
+// plugin
+var CheckButton = Backbone.View.extend({
+
+ // default options
+ optionsDefault: {
+ class_add : 'fa fa-square-o',
+ class_remove : 'fa fa-check-square-o',
+ class_partial : 'fa fa-minus-square-o',
+ value : false
+ },
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement($('<div/>'));
+
+ // set initial value
+ this.value(Boolean(this.options.value));
+
+ // add event handler
+ var self = this;
+ this.$el.on('click', function() {
+ self.value(!self.current);
+ });
+ },
+
+ // value
+ value : function (new_val) {
+ if (new_val !== undefined) {
+ this.current = new_val;
+ if (new_val) {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_remove);
+ } else {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_add);
+ }
+ this.options.onchange && this.options.onchange(new_val);
+ }
+ return this.current;
+ }
+});
+
// return
return {
Anchor : Anchor,
@@ -463,6 +511,7 @@
RadioButton : Options.RadioButton,
Checkbox : Options.Checkbox,
Radio : Options.Radio,
+ CheckButton : CheckButton,
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-model.js
--- a/client/galaxy/scripts/mvc/upload/upload-model.js
+++ b/client/galaxy/scripts/mvc/upload/upload-model.js
@@ -14,8 +14,6 @@
file_type : null,
file_path : '',
percentage : 0,
- row : null,
- // settings
space_to_tabs : false,
to_posix_lines : true
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select'],
+ 'mvc/ui/ui-select',],
function( Utils,
UploadModel,
@@ -42,9 +42,6 @@
// link app
this.app = app;
- // default value for extension of files
- var default_ext = 'Auto-detect';
-
// link this
var self = this;
@@ -64,6 +61,9 @@
placement : 'bottom'
});
+ // initialize default genome through default select field
+ var default_genome = this.app.select_genome.value();
+
// select genomes
this.select_genome = new Select.View({
css: 'genome',
@@ -72,39 +72,29 @@
},
data: self.app.list_genomes,
container: it.find('#genome'),
- value: self.model.get('genome')
+ value: default_genome
});
// initialize genome
- this.model.set('genome', self.select_genome.value());
+ this.model.set('genome', default_genome);
- // ensure files added after an individual row has changed
- // default to Auto-detect instead of ---
- if(!(this.app.select_extension.value() === '---')){
- this.default_ext = this.app.select_extension.value();
- }
-
+ // initialize default extension through default select field
+ var default_extension = this.app.select_extension.value();
+
// select extension
this.select_extension = new Select.View({
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
- // type to '---'
- if(!(self.select_extension.value() === app.select_extension.value()))
- {
- var newExte = '---';
- app.select_extension.value(newExte);
- }
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.default_ext
+ value: default_extension
});
// initialize extension
- this.model.set('extension', self.select_extension.value());
-
+ this.model.set('extension', default_extension);
+
//
// ui events
//
@@ -113,8 +103,13 @@
it.find('#symbol').on('click', function() { self._removeRow(); });
// handle extension info popover
- it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ it.find('#extension-info').on('click' , function(e) {
+ self.app.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
// handle settings popover
it.find('#settings').on('click' , function(e) { self._showSettings(); })
@@ -130,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -146,6 +141,9 @@
this.model.on('change:genome', function() {
self._refreshGenome();
});
+ this.model.on('change:extension', function() {
+ self._refreshExtension();
+ });
this.model.on('change:file_size', function() {
self._refreshFileSize();
});
@@ -155,7 +153,6 @@
this.app.collection.on('reset', function() {
self.remove();
});
- self.model.set('row', self);
},
// render
@@ -175,8 +172,9 @@
it.find('#size').html(Utils.bytesToString (file_size));
// remove mode class
- it.find('#mode').removeClass()
- .addClass('mode');
+ it.find('#mode')
+ .removeClass()
+ .addClass('mode');
// activate text field if file is new
if (file_mode == 'new') {
@@ -229,11 +227,14 @@
// handle model events
//
- // genome
+ // update extension
+ _refreshExtension: function() {
+ this.select_extension.value(this.model.get('extension'));
+ },
+
+ // update genome
_refreshGenome: function() {
- // update genome info on screen
- var genome = this.model.get('genome');
- this.select_genome.value(genome);
+ this.select_genome.value(this.model.get('genome'));
},
// progress
@@ -327,33 +328,6 @@
},
// attach file info popup
- _showExtensionInfo : function() {
- // initialize
- var $el = $(this.el).find('#extension-info');
- var extension = this.model.get('extension');
- var title = this.select_extension.text();
- var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
- // create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- // attach file info popup
_showSettings : function() {
// check if popover is visible
if (!this.settings.visible) {
@@ -368,23 +342,10 @@
},
// template
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
- },
-
- // template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
'<td>' +
- '<div style="position: relative;">' +
+ '<div class="name-column">' +
'<div id="mode"></div>' +
'<div id="title" class="title"></div>' +
'<div id="text" class="text">' +
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-view.js
--- a/client/galaxy/scripts/mvc/upload/upload-view.js
+++ b/client/galaxy/scripts/mvc/upload/upload-view.js
@@ -23,7 +23,7 @@
return Backbone.View.extend({
// options
options : {
- nginx_upload_path : ''
+ nginx_upload_path : ''
},
// own modal
@@ -40,6 +40,9 @@
// extension selector
select_extension : null,
+
+ // genome selector
+ select_genome: null,
// current upload size
upload_size: 0,
@@ -130,14 +133,6 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // add the '---' extension for use when the row types are changed individually
- self.list_extensions.push({
- id : "---",
- text : "---",
- description : "",
- description_url : ""
- });
-
// add auto field
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
@@ -167,14 +162,6 @@
this.collection.on('remove', function(item) {
self._eventRemove(item);
});
- this.collection.on('change:genome', function(item) {
- var genome = item.get('genome');
- self.collection.each(function(item) {
- if (item.get('status') == 'init' && item.get('genome') == '?') {
- item.set('genome', genome);
- }
- });
- });
},
//
@@ -232,28 +219,30 @@
container : button
});
- // select extension
+ // select extension
this.select_extension = new Select.View({
- css: 'extension',
- onchange : function() {
- var newExten = self.select_extension.value()
- var len = self.collection.models.length;
- // Only trigger changing the rows if the "set all" isn't set to '---'
- // Prevents recursively changing the rows after an individual row has been changed
- if(!(newExten === '---')){
- for(i = 0; i < len; i++){
- self.collection.models[i].attributes['row'].select_extension.value(newExten);
- }
- }
- },
- data: self.list_extensions,
- container: self.$el.parents().find('#extension'),
- value: self.list_extensions[0]
+ css : 'header-selection',
+ data : self.list_extensions,
+ container : self.$el.parent().find('#header-extension'),
+ value : self.list_extensions[0]
});
-
+
// handle extension info popover
- self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ self.$el.parent().find('#header-extension-info').on('click' , function(e) {
+ self.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
+
+ // genome extension
+ this.select_genome = new Select.View({
+ css : 'header-selection',
+ data : self.list_genomes,
+ container : self.$el.parent().find('#header-genome'),
+ value : self.list_genomes[0]
+ });
}
// show modal
@@ -266,45 +255,27 @@
this._updateScreen();
},
- _showExtensionInfo : function() {
+ showExtensionInfo : function(options) {
// initialize
var self = this;
- var $el = $(this.el).parents().find('#extension-info_out');
- var extension = self.select_extension.value();
-
- var title = this.select_extension.text();
-
+ var $el = options.$el;
+ var extension = options.extension;
+ var title = options.title;
var description = _.findWhere(self.list_extensions, {'id': extension});
// create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
+ this.extension_popup && this.extension_popup.remove();
+ this.extension_popup = new Popover.View({
+ placement: 'bottom',
+ container: $el,
+ destroy: true
+ });
+
+ // add content and show popup
+ this.extension_popup.title(title);
+ this.extension_popup.empty();
+ this.extension_popup.append(this._templateDescription(description));
+ this.extension_popup.show();
},
//
@@ -593,6 +564,7 @@
// reset value for universal type drop-down
this.select_extension.value(this.list_extensions[0]);
+ this.select_genome.value(this.list_genomes[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -684,12 +656,28 @@
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
+
+ // template for extensions description
+ _templateDescription: function(options) {
+ if (options.description) {
+ var tmpl = options.description;
+ if (options.description_url) {
+ tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
+ }
+ return tmpl;
+ } else {
+ return 'There is no description available for this file extension.';
+ }
+ },
+
// load html template
_template: function(id, idInfo) {
- return '<div id="uploadhead" class="uploadhead">' +
- '<span class="fftext">"Set All" Types:  </span>' +
- '<span id="extension" class="extension"/>  ' +
- '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' +
+ return '<div id="upload-header" class="upload-header">' +
+ '<span class="header-title">Type (default):</span>' +
+ '<span id="header-extension"/>' +
+ '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' +
+ '<span class="header-title">Genome (default):</span>' +
+ '<span id="header-genome"/>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -707,7 +695,7 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="uploadfoot">' +
+ '<div class="upload-footer">' +
'<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' ;
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -448,6 +448,54 @@
}
});
+// plugin
+var CheckButton = Backbone.View.extend({
+
+ // default options
+ optionsDefault: {
+ class_add : 'fa fa-square-o',
+ class_remove : 'fa fa-check-square-o',
+ class_partial : 'fa fa-minus-square-o',
+ value : false
+ },
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement($('<div/>'));
+
+ // set initial value
+ this.value(Boolean(this.options.value));
+
+ // add event handler
+ var self = this;
+ this.$el.on('click', function() {
+ self.value(!self.current);
+ });
+ },
+
+ // value
+ value : function (new_val) {
+ if (new_val !== undefined) {
+ this.current = new_val;
+ if (new_val) {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_remove);
+ } else {
+ this.$el.removeClass()
+ .addClass('ui-checkbutton')
+ .addClass(this.options.class_add);
+ }
+ this.options.onchange && this.options.onchange(new_val);
+ }
+ return this.current;
+ }
+});
+
// return
return {
Anchor : Anchor,
@@ -463,6 +511,7 @@
RadioButton : Options.RadioButton,
Checkbox : Options.Checkbox,
Radio : Options.Radio,
+ CheckButton : CheckButton,
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-model.js
--- a/static/scripts/mvc/upload/upload-model.js
+++ b/static/scripts/mvc/upload/upload-model.js
@@ -14,8 +14,6 @@
file_type : null,
file_path : '',
percentage : 0,
- row : null,
- // settings
space_to_tabs : false,
to_posix_lines : true
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -3,7 +3,7 @@
'mvc/upload/upload-model',
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
- 'mvc/ui/ui-select'],
+ 'mvc/ui/ui-select',],
function( Utils,
UploadModel,
@@ -42,9 +42,6 @@
// link app
this.app = app;
- // default value for extension of files
- var default_ext = 'Auto-detect';
-
// link this
var self = this;
@@ -64,6 +61,9 @@
placement : 'bottom'
});
+ // initialize default genome through default select field
+ var default_genome = this.app.select_genome.value();
+
// select genomes
this.select_genome = new Select.View({
css: 'genome',
@@ -72,39 +72,29 @@
},
data: self.app.list_genomes,
container: it.find('#genome'),
- value: self.model.get('genome')
+ value: default_genome
});
// initialize genome
- this.model.set('genome', self.select_genome.value());
+ this.model.set('genome', default_genome);
- // ensure files added after an individual row has changed
- // default to Auto-detect instead of ---
- if(!(this.app.select_extension.value() === '---')){
- this.default_ext = this.app.select_extension.value();
- }
-
+ // initialize default extension through default select field
+ var default_extension = this.app.select_extension.value();
+
// select extension
this.select_extension = new Select.View({
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
- // type to '---'
- if(!(self.select_extension.value() === app.select_extension.value()))
- {
- var newExte = '---';
- app.select_extension.value(newExte);
- }
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.default_ext
+ value: default_extension
});
// initialize extension
- this.model.set('extension', self.select_extension.value());
-
+ this.model.set('extension', default_extension);
+
//
// ui events
//
@@ -113,8 +103,13 @@
it.find('#symbol').on('click', function() { self._removeRow(); });
// handle extension info popover
- it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ it.find('#extension-info').on('click' , function(e) {
+ self.app.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
// handle settings popover
it.find('#settings').on('click' , function(e) { self._showSettings(); })
@@ -130,7 +125,7 @@
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -146,6 +141,9 @@
this.model.on('change:genome', function() {
self._refreshGenome();
});
+ this.model.on('change:extension', function() {
+ self._refreshExtension();
+ });
this.model.on('change:file_size', function() {
self._refreshFileSize();
});
@@ -155,7 +153,6 @@
this.app.collection.on('reset', function() {
self.remove();
});
- self.model.set('row', self);
},
// render
@@ -175,8 +172,9 @@
it.find('#size').html(Utils.bytesToString (file_size));
// remove mode class
- it.find('#mode').removeClass()
- .addClass('mode');
+ it.find('#mode')
+ .removeClass()
+ .addClass('mode');
// activate text field if file is new
if (file_mode == 'new') {
@@ -229,11 +227,14 @@
// handle model events
//
- // genome
+ // update extension
+ _refreshExtension: function() {
+ this.select_extension.value(this.model.get('extension'));
+ },
+
+ // update genome
_refreshGenome: function() {
- // update genome info on screen
- var genome = this.model.get('genome');
- this.select_genome.value(genome);
+ this.select_genome.value(this.model.get('genome'));
},
// progress
@@ -327,33 +328,6 @@
},
// attach file info popup
- _showExtensionInfo : function() {
- // initialize
- var $el = $(this.el).find('#extension-info');
- var extension = this.model.get('extension');
- var title = this.select_extension.text();
- var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
- // create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- // attach file info popup
_showSettings : function() {
// check if popover is visible
if (!this.settings.visible) {
@@ -368,23 +342,10 @@
},
// template
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
- },
-
- // template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
'<td>' +
- '<div style="position: relative;">' +
+ '<div class="name-column">' +
'<div id="mode"></div>' +
'<div id="title" class="title"></div>' +
'<div id="text" class="text">' +
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -23,7 +23,7 @@
return Backbone.View.extend({
// options
options : {
- nginx_upload_path : ''
+ nginx_upload_path : ''
},
// own modal
@@ -40,6 +40,9 @@
// extension selector
select_extension : null,
+
+ // genome selector
+ select_genome: null,
// current upload size
upload_size: 0,
@@ -130,14 +133,6 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // add the '---' extension for use when the row types are changed individually
- self.list_extensions.push({
- id : "---",
- text : "---",
- description : "",
- description_url : ""
- });
-
// add auto field
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
@@ -167,14 +162,6 @@
this.collection.on('remove', function(item) {
self._eventRemove(item);
});
- this.collection.on('change:genome', function(item) {
- var genome = item.get('genome');
- self.collection.each(function(item) {
- if (item.get('status') == 'init' && item.get('genome') == '?') {
- item.set('genome', genome);
- }
- });
- });
},
//
@@ -232,28 +219,30 @@
container : button
});
- // select extension
+ // select extension
this.select_extension = new Select.View({
- css: 'extension',
- onchange : function() {
- var newExten = self.select_extension.value()
- var len = self.collection.models.length;
- // Only trigger changing the rows if the "set all" isn't set to '---'
- // Prevents recursively changing the rows after an individual row has been changed
- if(!(newExten === '---')){
- for(i = 0; i < len; i++){
- self.collection.models[i].attributes['row'].select_extension.value(newExten);
- }
- }
- },
- data: self.list_extensions,
- container: self.$el.parents().find('#extension'),
- value: self.list_extensions[0]
+ css : 'header-selection',
+ data : self.list_extensions,
+ container : self.$el.parent().find('#header-extension'),
+ value : self.list_extensions[0]
});
-
+
// handle extension info popover
- self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
+ self.$el.parent().find('#header-extension-info').on('click' , function(e) {
+ self.showExtensionInfo({
+ $el : $(e.target),
+ title : self.select_extension.text(),
+ extension : self.select_extension.value()
+ });
+ }).on('mousedown', function(e) { e.preventDefault(); });
+
+ // genome extension
+ this.select_genome = new Select.View({
+ css : 'header-selection',
+ data : self.list_genomes,
+ container : self.$el.parent().find('#header-genome'),
+ value : self.list_genomes[0]
+ });
}
// show modal
@@ -266,45 +255,27 @@
this._updateScreen();
},
- _showExtensionInfo : function() {
+ showExtensionInfo : function(options) {
// initialize
var self = this;
- var $el = $(this.el).parents().find('#extension-info_out');
- var extension = self.select_extension.value();
-
- var title = this.select_extension.text();
-
+ var $el = options.$el;
+ var extension = options.extension;
+ var title = options.title;
var description = _.findWhere(self.list_extensions, {'id': extension});
// create popup
- if (!this.extension_popup) {
- this.extension_popup = new Popover.View({
- placement: 'bottom',
- container: $el
- });
- }
-
- // show / hide popup
- if (!this.extension_popup.visible) {
- this.extension_popup.title(title);
- this.extension_popup.empty();
- this.extension_popup.append(this._templateDescription(description));
- this.extension_popup.show();
- } else {
- this.extension_popup.hide();
- }
- },
-
- _templateDescription: function(options) {
- if (options.description) {
- var tmpl = options.description;
- if (options.description_url) {
- tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
- }
- return tmpl;
- } else {
- return 'There is no description available for this file extension.';
- }
+ this.extension_popup && this.extension_popup.remove();
+ this.extension_popup = new Popover.View({
+ placement: 'bottom',
+ container: $el,
+ destroy: true
+ });
+
+ // add content and show popup
+ this.extension_popup.title(title);
+ this.extension_popup.empty();
+ this.extension_popup.append(this._templateDescription(description));
+ this.extension_popup.show();
},
//
@@ -593,6 +564,7 @@
// reset value for universal type drop-down
this.select_extension.value(this.list_extensions[0]);
+ this.select_genome.value(this.list_genomes[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -684,12 +656,28 @@
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
+
+ // template for extensions description
+ _templateDescription: function(options) {
+ if (options.description) {
+ var tmpl = options.description;
+ if (options.description_url) {
+ tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)';
+ }
+ return tmpl;
+ } else {
+ return 'There is no description available for this file extension.';
+ }
+ },
+
// load html template
_template: function(id, idInfo) {
- return '<div id="uploadhead" class="uploadhead">' +
- '<span class="fftext">"Set All" Types:  </span>' +
- '<span id="extension" class="extension"/>  ' +
- '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' +
+ return '<div id="upload-header" class="upload-header">' +
+ '<span class="header-title">Type (default):</span>' +
+ '<span id="header-extension"/>' +
+ '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' +
+ '<span class="header-title">Genome (default):</span>' +
+ '<span id="header-genome"/>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -707,7 +695,7 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="uploadfoot">' +
+ '<div class="upload-footer">' +
'<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' ;
}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/ui/ui-misc.js
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,o,l,q,m){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="'+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var r=this;$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick&&!r.disabled){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(r){this.$("i").removeClass(this.options.icon).addClass(r);this.options.icon=r},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="'+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var n=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(s){this.options=k.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!s.persistent){var r=this;this.timeout=window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){if(r.area){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'"></textarea>'}else{return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}}});var p=Backbone.View.extend({initialize:function(r){this.options=r;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(r){if(r!==undefined){this.$("hidden").val(r)}return this.$("hidden").val()},_template:function(s){var r='<div id="'+s.id+'" >';if(s.info){r+="<label>"+s.info+"</label>"}r+='<hidden value="'+s.value+'"/></div>';return r}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:i,Label:j,Message:n,Modal:m,RadioButton:o.RadioButton,Checkbox:o.Checkbox,Radio:o.Radio,Searchbox:a,Select:b,Hidden:p,Slider:e,Drilldown:l}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(d,g,h,l,k,r,b){var p=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return'<img class="ui-image '+s.cls+'" src="'+s.url+'"/>'}});var i=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'<label class="ui-label '+s.cls+'">'+s.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'<div><span class="fa '+s.icon+'" class="ui-icon"/> '+s.title+"</div>"}});var f=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){var t='<button id="'+s.id+'" type="submit" style="float: '+s.floating+';" type="button" class="'+s.cls+'">';if(s.icon){t+='<i class="icon fa '+s.icon+'"></i> '}t+=s.title+"</button>";return t}});var n=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var s=this;$(this.el).on("click",function(){$(".tooltip").hide();if(t.onclick&&!s.disabled){t.onclick()}});$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(s){this.$("i").removeClass(this.options.icon).addClass(s);this.options.icon=s},_template:function(s){var t="";if(s.title){t="width: auto;"}var u='<div id="'+s.id+'" style="float: '+s.floating+"; "+t+'" class="'+s.cls+'">';if(s.title){u+='<div class="button"><i class="icon fa '+s.icon+'"/> <span class="title">'+s.title+"</span></div>"}else{u+='<i class="icon fa '+s.icon+'"/>'}u+="</div>";return u}});var o=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick)},_template:function(s){return'<div><a href="javascript:void(0)" class="ui-anchor '+s.cls+'">'+s.title+"</a></div>"}});var a=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(t){this.options=d.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(t.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!t.persistent){var s=this;this.timeout=window.setTimeout(function(){if(s.$el.is(":visible")){s.$el.fadeOut()}else{s.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(s){return'<div class="ui-message alert alert-'+s.status+'"/>'}});var e=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));var s=this;if(this.options.onclick){this.$el.on("submit",function(v){var u=s.$el.find("#search");s.options.onclick(u.val())})}},_template:function(s){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+s.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var m=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var s=this;this.$el.on("input",function(){if(s.options.onchange){s.options.onchange(s.$el.val())}})},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){if(s.area){return'<textarea id="'+s.id+'" class="ui-textarea '+s.cls+'"></textarea>'}else{return'<input id="'+s.id+'" type="'+s.type+'" value="'+s.value+'" placeholder="'+s.placeholder+'" class="ui-input '+s.cls+'">'}}});var j=Backbone.View.extend({initialize:function(s){this.options=s;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(s){if(s!==undefined){this.$("hidden").val(s)}return this.$("hidden").val()},_template:function(t){var s='<div id="'+t.id+'" >';if(t.info){s+="<label>"+t.info+"</label>"}s+='<hidden value="'+t.value+'"/></div>';return s}});var q=Backbone.View.extend({optionsDefault:{class_add:"fa fa-square-o",class_remove:"fa fa-check-square-o",class_partial:"fa fa-minus-square-o",value:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement($("<div/>"));this.value(Boolean(this.options.value));var s=this;this.$el.on("click",function(){s.value(!s.current)})},value:function(s){if(s!==undefined){this.current=s;if(s){this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_remove)}else{this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_add)}this.options.onchange&&this.options.onchange(s)}return this.current}});return{Anchor:o,Button:f,ButtonIcon:n,ButtonMenu:r,Icon:c,Image:p,Input:m,Label:i,Message:a,Modal:b,RadioButton:l.RadioButton,Checkbox:l.Checkbox,Radio:l.Radio,CheckButton:q,Searchbox:e,Select:g,Hidden:j,Slider:h,Drilldown:k}});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-model.js
--- a/static/scripts/packed/mvc/upload/upload-model.js
+++ b/static/scripts/packed/mvc/upload/upload-model.js
@@ -1,1 +1,1 @@
-define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,row:null,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}});
\ No newline at end of file
+define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-row.js
--- a/static/scripts/packed/mvc/upload/upload-row.js
+++ b/static/scripts/packed/mvc/upload/upload-row.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(j,h){this.app=j;var g="Auto-detect";var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var i=this.$el;this.settings=new c.View({title:"Upload configuration",container:i.find("#settings"),placement:"bottom"});this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:i.find("#genome"),value:f.model.get("genome")});this.model.set("genome",f.select_genome.value());if(!(this.app.select_extension.value()==="---")){this.default_ext=this.app.select_extension.value()}this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value());if(!(f.select_extension.value()===j.select_extension.value())){var k="---";j.select_extension.value(k)}},data:f.app.list_extensions,container:i.find("#extension"),value:f.default_ext});this.model.set("extension",f.select_extension.value());i.find("#symbol").on("click",function(){f._removeRow()});i.find("#extension-info").on("click",function(k){f._showExtensionInfo()}).on("mousedown",function(k){k.preventDefault()});i.find("#settings").on("click",function(k){f._showSettings()}).on("mousedown",function(k){k.preventDefault()});i.find("#text-content").on("keyup",function(k){f.model.set("url_paste",$(k.target).val());f.model.set("file_size",$(k.target).val().length)});i.find("#space_to_tabs").on("change",function(k){f.model.set("space_to_tabs",$(k.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()});f.model.set("row",f)},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshGenome:function(){var f=this.model.get("genome");this.select_genome.value(f)},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showExtensionInfo:function(){var f=$(this.el).find("#extension-info");var i=this.model.get("extension");var h=this.select_extension.text();var g=_.findWhere(this.app.list_extensions,{id:i});if(!this.extension_popup){this.extension_popup=new c.View({placement:"bottom",container:f})}if(!this.extension_popup.visible){this.extension_popup.title(h);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(g));this.extension_popup.show()}else{this.extension_popup.hide()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_templateDescription:function(g){if(g.description){var f=g.description;if(g.description_url){f+=' (<a href="'+g.description_url+'" target="_blank">read more</a>)'}return f}else{return"There is no description available for this file extension."}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div style="position: relative;"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select",],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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="'+this.status_classes.init+'"></div></td></tr>'}})});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-view.js
--- a/static/scripts/packed/mvc/upload/upload-view.js
+++ b/static/scripts/packed/mvc/upload/upload-view.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(k){var j=this;if(k){this.options=_.defaults(k,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(l){if(l){l.preventDefault();j.show()}},onunload:function(){if(j.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var j=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(l){for(key in l){j.list_extensions.push({id:l[key].extension,text:l[key].extension,description:l[key].description,description_url:l[key].description_url})}j.list_extensions.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0});j.list_extensions.push({id:"---",text:"---",description:"",description_url:""});if(!j.options.datatypes_disable_auto){j.list_extensions.unshift(j.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(l){for(key in l){j.list_genomes.push({id:l[key][1],text:l[key][0]})}j.list_genomes.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0})}});this.collection.on("remove",function(l){j._eventRemove(l)});this.collection.on("change:genome",function(m){var l=m.get("genome");j.collection.each(function(n){if(n.get("status")=="init"&&n.get("genome")=="?"){n.set("genome",l)}})})},show:function(){var j=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){j.show()},500);return}if(!this.modal){var j=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){j.uploadbox.select()},"Choose FTP file":function(){j._eventFtp()},"Paste/Fetch data":function(){j._eventCreate()},Start:function(){j._eventStart()},Pause:function(){j._eventStop()},Reset:function(){j._eventReset()},Close:function(){j.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var j=this;this.uploadbox=this.$el.uploadbox({announce:function(l,m,n){j._eventAnnounce(l,m,n)},initialize:function(l,m,n){return j._eventInitialize(l,m,n)},progress:function(l,m,n){j._eventProgress(l,m,n)},success:function(l,m,n){j._eventSuccess(l,m,n)},error:function(l,m,n){j._eventError(l,m,n)},complete:function(){j._eventComplete()}});var k=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:k});this.select_extension=new h.View({css:"extension",onchange:function(){var m=j.select_extension.value();var l=j.collection.models.length;if(!(m==="---")){for(i=0;i<l;i++){j.collection.models[i].attributes.row.select_extension.value(m)}}},data:j.list_extensions,container:j.$el.parents().find("#extension"),value:j.list_extensions[0]});j.$el.parents().find("#extension-info_out").on("click",function(l){j._showExtensionInfo()}).on("mousedown",function(l){l.preventDefault()})}this.modal.show();this._updateUser();this._updateScreen()},_showExtensionInfo:function(){var j=this;var k=$(this.el).parents().find("#extension-info_out");var n=j.select_extension.value();var m=this.select_extension.text();var l=_.findWhere(j.list_extensions,{id:n});if(!this.extension_popup){this.extension_popup=new d.View({placement:"bottom",container:k})}if(!this.extension_popup.visible){this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()}else{this.extension_popup.hide()}},_templateDescription:function(k){if(k.description){var j=k.description;if(k.description_url){j+=' (<a href="'+k.description_url+'" target="_blank">read more</a>)'}return j}else{return"There is no description available for this file extension."}},_eventRemove:function(k){var j=k.get("status");if(j=="success"){this.counter.success--}else{if(j=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(k.id)},_eventAnnounce:function(j,k,m){this.counter.announce++;this._updateScreen();var l=new b(this,{id:j,file_name:k.name,file_size:k.size,file_mode:k.mode,file_path:k.path});this.collection.add(l.model);$(this.el).find("tbody:first").append(l.$el);l.render()},_eventInitialize:function(o,l,u){var m=this.collection.get(o);m.set("status","running");var q=m.get("file_name");var p=m.get("file_path");var j=m.get("file_mode");var r=m.get("extension");var t=m.get("genome");var s=m.get("url_paste");var n=m.get("space_to_tabs");var k=m.get("to_posix_lines");if(!s&&!(l.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(j=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(j=="new"){tool_input["files_0|url_paste"]=s}if(j=="ftp"){tool_input["files_0|ftp_files"]=p}tool_input.dbkey=t;tool_input.file_type=r;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=n&&"Yes"||null;tool_input["files_0|to_posix_lines"]=k&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(k,l,j){var m=this.collection.get(k);m.set("percentage",j);this.ui_button.set("percentage",this._upload_percentage(j,l.size))},_eventSuccess:function(k,l,n){var m=this.collection.get(k);m.set("percentage",100);m.set("status","success");var j=m.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,j));this.upload_completed+=j*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","error");l.set("info",m);this.ui_button.set("percentage",this._upload_percentage(100,k.size));this.ui_button.set("status","danger");this.upload_completed+=k.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(j){if(j.get("status")=="queued"){j.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var j=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(k){if(k.get("status")=="init"){k.set("status","queued");j.upload_size+=k.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.select_extension.value(this.list_extensions[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: 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 'Start' 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("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(j,k){return(this.upload_completed+(j*k))/this.upload_size},_template:function(k,j){return'<div id="uploadhead" class="uploadhead"><span class="fftext">"Set All" Types:  </span><span id="extension" class="extension"/>  <span id="extension-info_out" class="upload-icon-button fa fa-search"/></div><div id="'+k+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="uploadfoot"><h6 id="'+j+'" class="upload-info"></h6></div>'}})});
\ No newline at end of file
+define(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,select_genome:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(j){var i=this;if(j){this.options=_.defaults(j,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(k){if(k){k.preventDefault();i.show()}},onunload:function(){if(i.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var i=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(k){for(key in k){i.list_extensions.push({id:k[key].extension,text:k[key].extension,description:k[key].description,description_url:k[key].description_url})}i.list_extensions.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0});if(!i.options.datatypes_disable_auto){i.list_extensions.unshift(i.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(k){for(key in k){i.list_genomes.push({id:k[key][1],text:k[key][0]})}i.list_genomes.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0})}});this.collection.on("remove",function(k){i._eventRemove(k)})},show:function(){var i=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){i.show()},500);return}if(!this.modal){var i=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){i.uploadbox.select()},"Choose FTP file":function(){i._eventFtp()},"Paste/Fetch data":function(){i._eventCreate()},Start:function(){i._eventStart()},Pause:function(){i._eventStop()},Reset:function(){i._eventReset()},Close:function(){i.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var i=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){i._eventAnnounce(k,l,m)},initialize:function(k,l,m){return i._eventInitialize(k,l,m)},progress:function(k,l,m){i._eventProgress(k,l,m)},success:function(k,l,m){i._eventSuccess(k,l,m)},error:function(k,l,m){i._eventError(k,l,m)},complete:function(){i._eventComplete()}});var j=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:j});this.select_extension=new h.View({css:"header-selection",data:i.list_extensions,container:i.$el.parent().find("#header-extension"),value:i.list_extensions[0]});i.$el.parent().find("#header-extension-info").on("click",function(k){i.showExtensionInfo({$el:$(k.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(k){k.preventDefault()});this.select_genome=new h.View({css:"header-selection",data:i.list_genomes,container:i.$el.parent().find("#header-genome"),value:i.list_genomes[0]})}this.modal.show();this._updateUser();this._updateScreen()},showExtensionInfo:function(j){var i=this;var k=j.$el;var n=j.extension;var m=j.title;var l=_.findWhere(i.list_extensions,{id:n});this.extension_popup&&this.extension_popup.remove();this.extension_popup=new d.View({placement:"bottom",container:k,destroy:true});this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()},_eventRemove:function(j){var i=j.get("status");if(i=="success"){this.counter.success--}else{if(i=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(j.id)},_eventAnnounce:function(i,j,l){this.counter.announce++;this._updateScreen();var k=new b(this,{id:i,file_name:j.name,file_size:j.size,file_mode:j.mode,file_path:j.path});this.collection.add(k.model);$(this.el).find("tbody:first").append(k.$el);k.render()},_eventInitialize:function(n,k,t){var l=this.collection.get(n);l.set("status","running");var p=l.get("file_name");var o=l.get("file_path");var i=l.get("file_mode");var q=l.get("extension");var s=l.get("genome");var r=l.get("url_paste");var m=l.get("space_to_tabs");var j=l.get("to_posix_lines");if(!r&&!(k.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(i=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(i=="new"){tool_input["files_0|url_paste"]=r}if(i=="ftp"){tool_input["files_0|ftp_files"]=o}tool_input.dbkey=s;tool_input.file_type=q;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=m&&"Yes"||null;tool_input["files_0|to_posix_lines"]=j&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(j,k,i){var l=this.collection.get(j);l.set("percentage",i);this.ui_button.set("percentage",this._upload_percentage(i,k.size))},_eventSuccess:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","success");var i=l.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,i));this.upload_completed+=i*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","error");k.set("info",l);this.ui_button.set("percentage",this._upload_percentage(100,j.size));this.ui_button.set("status","danger");this.upload_completed+=j.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(i){if(i.get("status")=="queued"){i.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var i=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(j){if(j.get("status")=="init"){j.set("status","queued");i.upload_size+=j.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.set("status","info");this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},_eventReset:function(){if(this.counter.running==0){this.collection.reset();this.counter.reset();this._updateScreen();this.uploadbox.reset();this.select_extension.value(this.list_extensions[0]);this.select_genome.value(this.list_genomes[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: 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 'Start' 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("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(i,j){return(this.upload_completed+(i*j))/this.upload_size},_templateDescription:function(j){if(j.description){var i=j.description;if(j.description_url){i+=' (<a href="'+j.description_url+'" target="_blank">read more</a>)'}return i}else{return"There is no description available for this file extension."}},_template:function(j,i){return'<div id="upload-header" class="upload-header"><span class="header-title">Type (default):</span><span id="header-extension"/><span id="header-extension-info" class="upload-icon-button fa fa-search"/><span class="header-title">Genome (default):</span><span id="header-genome"/></div><div id="'+j+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="upload-footer"><h6 id="'+i+'" class="upload-info"></h6></div>'}})});
\ No newline at end of file
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -119,12 +119,6 @@
.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}
.table tbody+tbody{border-top:2px solid #d6b161}
.table .table{background-color:#fff}
-.uploadhead{height:10%; text-align:left; max-height:20px; line-height:18px; margin-bottom: 5px;}
-.uploadfoot{height:5%; text-align:center;}
-.uploadhead .fftext{font-weight: bold;}
-.uploadhead .select2-container .select2-choice .select2-arrow b{background-position:0 -3px}
-.uploadhead .extension{width:100px;min-width:100px;font-size:11px}
-.uploadhead .select2-container .select2-choice{max-height:20px;line-height:18px;text-align:center; font-weight: normal;}
.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}
.table-bordered{border:1px solid #d6b161}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #d6b161}
.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}
@@ -1375,13 +1369,13 @@
.upload-button .label{position:absolute;top:2px;width:inherit;text-align:center;line-height:19px;font-size:1.2em}
.upload-icon{font-size:1.2em;width:1.2em}
.upload-icon-button{font-size:1.2em;width:1.2em;cursor:pointer}
-.upload-info{font-weight:normal;text-align:center}
-.upload-box{width:100%;height:85%;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:10px;overflow-x:hidden;-ms-overflow-style:none}.upload-box .table{width:100%}
+.upload-box{width:100%;height:90%;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:10px;overflow-x:hidden;-ms-overflow-style:none}.upload-box .table{width:100%}
.upload-box .table th{text-align:center;white-space:nowrap}
.upload-box .table td{margin:0px}
.upload-box .upload-item .select2-arrow b{background-position:0 -3px}
.upload-box .upload-item .select2-choice{max-height:20px;line-height:18px;background:transparent}
.upload-box .upload-item .select2-container-disabled .select2-arrow{background:transparent}
+.upload-box .name-column{position:relative}
.upload-box .mode{float:left;font-size:1.2em;width:1.2em;color:#555}
.upload-box .title{width:130px;word-wrap:break-word;font-size:11px;float:left}
.upload-box .text{position:absolute;display:none}.upload-box .text .text-content{font-size:11px;width:100%;height:50px;resize:none;background:inherit;color:#000}
@@ -1395,6 +1389,10 @@
.upload-ftp .upload-ftp-help{margin-bottom:10px}
.upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px}
.upload-settings .upload-settings-cover{position:absolute;width:100%;height:100%;top:0px;left:0px;background:#fff;opacity:0.4;cursor:no-drop}
+.upload-header{height:5%;text-align:left;max-height:20px;line-height:18px;margin-bottom:15px}.upload-header .header-title{font-weight:bold;padding-left:60px;padding-right:20px}
+.upload-header .header-selection{width:200px;min-width:200px;font-size:11px;padding-right:10px}
+.upload-header .select2-choice{max-height:20px;line-height:18px;background:transparent;text-align:center;font-weight:normal}.upload-header .select2-choice .select2-arrow b{background-position:0 -3px}
+.upload-footer{height:5%;text-align:center}.upload-footer .upload-info{font-weight:normal;text-align:center}
.no-highlight,.ui-button-icon,.ui-portlet,.ui-portlet-slim,.ui-portlet-repeat,.ui-portlet-section{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;}
.ui-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px}
.ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px}
@@ -1435,6 +1433,7 @@
.ui-form-slider .ui-form-slider-element{width:calc(100% - 110px);float:left;top:8px;left:10px}
.ui-radiobutton{width:100%}.ui-radiobutton label{height:23px;line-height:1em}
.ui-radiobutton i{padding-right:5px}
+.ui-checkbutton{font-size:1.2em;width:1.2em;cursor:pointer}
.ui-select{position:relative}.ui-select .button{position:absolute;top:5px;right:5px}
.ui-select .select2-container{width:100%}
.ui-select select{position:relative;top:0px;height:27px;width:100%;padding-left:5px;padding-right:20px;cursor:pointer;background:transparent;-webkit-appearance:none;border:1px solid #bfbfbf;-moz-border-radius:3px;border-radius:3px}
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -298,6 +298,12 @@
}
}
+.ui-checkbutton {
+ font-size: 1.2em;
+ width: 1.2em;
+ cursor: pointer;
+}
+
.ui-select {
position: relative;
.button {
diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/upload.less
--- a/static/style/src/less/upload.less
+++ b/static/style/src/less/upload.less
@@ -52,14 +52,9 @@
cursor: pointer;
}
-.upload-info {
- font-weight: normal;
- text-align: center;
-}
-
.upload-box {
width : 100%;
- height : 95%;
+ height : 90%;
text-align : center;
overflow : scroll;
font-size : @font-size-base;
@@ -102,6 +97,10 @@
}
}
+ .name-column {
+ position: relative;
+ }
+
.mode {
float: left;
font-size: 1.2em;
@@ -214,3 +213,41 @@
cursor: no-drop;
}
}
+
+.upload-header {
+ height:5%;
+ text-align:left;
+ max-height:20px;
+ line-height:18px;
+ margin-bottom: 15px;
+ .header-title {
+ font-weight: bold;
+ padding-left: 60px;
+ padding-right: 20px;
+ }
+ .header-selection{
+ width:200px;
+ min-width:200px;
+ font-size:11px;
+ padding-right: 10px;
+ }
+ .select2-choice {
+ .select2-arrow b {
+ background-position: 0 -3px;
+ }
+ max-height: 20px;
+ line-height: 18px;
+ background: transparent;
+ text-align:center;
+ font-weight: normal;
+ }
+}
+
+.upload-footer {
+ height:5%;
+ text-align:center;
+ .upload-info {
+ font-weight: normal;
+ text-align: center;
+ }
+}
\ 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
commit/galaxy-central: dannon: Remove more trailing space from upload.js's.
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/49d651198b3a/
Changeset: 49d651198b3a
User: dannon
Date: 2015-01-23 20:30:28+00:00
Summary: Remove more trailing space from upload.js's.
Affected #: 4 files
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e client/galaxy/scripts/mvc/upload/upload-row.js
--- a/client/galaxy/scripts/mvc/upload/upload-row.js
+++ b/client/galaxy/scripts/mvc/upload/upload-row.js
@@ -4,7 +4,7 @@
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
'mvc/ui/ui-select'],
-
+
function( Utils,
UploadModel,
UploadSettings,
@@ -18,7 +18,7 @@
options: {
padding : 8
},
-
+
// states
status_classes : {
init : 'upload-icon-button fa fa-trash-o',
@@ -27,36 +27,36 @@
success : 'upload-icon-button fa fa-check',
error : 'upload-icon-button fa fa-exclamation-triangle'
},
-
+
// handle for settings popover
settings: null,
-
+
// genome selector
select_genome : null,
-
+
// extension selector
select_extension : null,
-
+
// render
initialize: function(app, options) {
// link app
this.app = app;
-
+
// default value for extension of files
var default_ext = 'Auto-detect';
// link this
var self = this;
-
+
// create model
this.model = new UploadModel.Model(options);
-
+
// add upload item
this.setElement(this._template(options));
// link item
var it = this.$el;
-
+
// append popup to settings icon
this.settings = new Popover.View({
title : 'Upload configuration',
@@ -74,11 +74,11 @@
container: it.find('#genome'),
value: self.model.get('genome')
});
-
+
// initialize genome
this.model.set('genome', self.select_genome.value());
- // ensure files added after an individual row has changed
+ // ensure files added after an individual row has changed
// default to Auto-detect instead of ---
if(!(this.app.select_extension.value() === '---')){
this.default_ext = this.app.select_extension.value();
@@ -89,7 +89,7 @@
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
+ // if user has changed individual row type, then change "set all"
// type to '---'
if(!(self.select_extension.value() === app.select_extension.value()))
{
@@ -101,17 +101,17 @@
container: it.find('#extension'),
value: self.default_ext
});
-
+
// initialize extension
this.model.set('extension', self.select_extension.value());
-
+
//
// ui events
//
-
+
// handle click event
it.find('#symbol').on('click', function() { self._removeRow(); });
-
+
// handle extension info popover
it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
.on('mousedown', function(e) { e.preventDefault(); });
@@ -125,12 +125,12 @@
self.model.set('url_paste', $(e.target).val());
self.model.set('file_size', $(e.target).val().length);
});
-
+
// handle space to tabs button
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -157,57 +157,57 @@
});
self.model.set('row', self);
},
-
+
// render
render: function() {
// read model
var file_name = this.model.get('file_name');
var file_size = this.model.get('file_size');
var file_mode = this.model.get('file_mode');
-
+
// link item
var it = this.$el;
-
+
// update title
it.find('#title').html(file_name);
-
+
// update info
it.find('#size').html(Utils.bytesToString (file_size));
-
+
// remove mode class
it.find('#mode').removeClass()
.addClass('mode');
-
+
// activate text field if file is new
if (file_mode == 'new') {
// get text component
var text = it.find('#text');
-
+
// get padding
var padding = this.options.padding;
-
+
// get dimensions
var width = it.width() - 2 * padding;
var height = it.height() - padding;
-
+
// set dimensions
text.css('width', width + 'px');
text.css('top', height + 'px');
it.height(height + text.height() + 2 * padding);
-
+
// show text field
text.show();
-
+
// update icon
it.find('#mode').addClass('fa fa-pencil');
}
-
+
// file from local disk
if (file_mode == 'local') {
// update icon
it.find('#mode').addClass('fa fa-laptop');
}
-
+
// file from ftp
if (file_mode == 'ftp') {
// update icon
@@ -220,7 +220,7 @@
// trigger remove event
this.select_genome.remove();
this.select_extension.remove();
-
+
// call the base class remove method
Backbone.View.prototype.remove.apply(this);
},
@@ -228,14 +228,14 @@
//
// handle model events
//
-
+
// genome
_refreshGenome: function() {
// update genome info on screen
var genome = this.model.get('genome');
this.select_genome.value(genome);
},
-
+
// progress
_refreshInfo: function() {
// write error message
@@ -246,7 +246,7 @@
this.$el.find('#info').hide();
}
},
-
+
// progress
_refreshPercentage : function() {
var percentage = parseInt(this.model.get('percentage'));
@@ -256,29 +256,29 @@
else
this.$el.find('#percentage').html('Adding to history...');
},
-
+
// status
_refreshStatus : function() {
// get element
var it = this.$el;
-
+
// identify new status
var status = this.model.get('status');
var status_class = this.status_classes[status];
-
+
// identify symbol and reset classes
var sy = this.$el.find('#symbol');
sy.removeClass();
-
+
// set new status class
sy.addClass(status_class);
-
+
// enable form fields
if (status == 'init') {
// select fields
this.select_genome.enable();
this.select_extension.enable();
-
+
// default fields
it.find('#text-content').attr('disabled', false);
it.find('#space_to_tabs').attr('disabled', false);
@@ -286,18 +286,18 @@
// select fields
this.select_genome.disable();
this.select_extension.disable();
-
+
// default fields
it.find('#text-content').attr('disabled', true);
it.find('#space_to_tabs').attr('disabled', true);
}
-
+
// success
if (status == 'success') {
it.addClass('success');
it.find('#percentage').html('100%');
}
-
+
// error
if (status == 'error') {
it.addClass('danger');
@@ -314,18 +314,18 @@
//
// handle ui events
//
-
+
// remove row
_removeRow: function() {
// get current status
var status = this.model.get('status');
-
+
// only remove from queue if not in processing line
if (status == 'init' || status == 'success' || status == 'error') {
this.app.collection.remove(this.model);
}
},
-
+
// attach file info popup
_showExtensionInfo : function() {
// initialize
@@ -333,7 +333,7 @@
var extension = this.model.get('extension');
var title = this.select_extension.text();
var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
+
// create popup
if (!this.extension_popup) {
this.extension_popup = new Popover.View({
@@ -341,7 +341,7 @@
container: $el
});
}
-
+
// show / hide popup
if (!this.extension_popup.visible) {
this.extension_popup.title(title);
@@ -366,7 +366,7 @@
this.settings.hide();
}
},
-
+
// template
_templateDescription: function(options) {
if (options.description) {
@@ -379,7 +379,7 @@
return 'There is no description available for this file extension.';
}
},
-
+
// template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
@@ -417,7 +417,7 @@
'</td>' +
'</tr>';
}
-
+
});
});
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e client/galaxy/scripts/mvc/upload/upload-settings.js
--- a/client/galaxy/scripts/mvc/upload/upload-settings.js
+++ b/client/galaxy/scripts/mvc/upload/upload-settings.js
@@ -8,35 +8,35 @@
class_check : 'upload-icon-button fa fa-check-square-o',
class_uncheck : 'upload-icon-button fa fa-square-o'
},
-
+
// render
initialize: function(app) {
// link app
this.app = app;
-
+
// link this
var self = this;
-
+
// set template
this.setElement(this._template());
-
+
// link model
this.model = this.app.model;
-
+
// ui event: space to tabs
this.$el.find('#upload-space-to-tabs').on('click', function() {
self._switchState('#upload-space-to-tabs', 'space_to_tabs');
});
-
+
// ui event: to posix
this.$el.find('#upload-to-posix-lines').on('click', function() {
self._switchState('#upload-to-posix-lines', 'to_posix_lines');
});
-
+
// render
this.render();
},
-
+
// events
events: {
'mousedown' : function(e) { e.preventDefault(); }
@@ -47,7 +47,7 @@
// render states
this._renderState('#upload-space-to-tabs', this.model.get('space_to_tabs'));
this._renderState('#upload-to-posix-lines', this.model.get('to_posix_lines'));
-
+
// disable options
var $cover = this.$el.find('#upload-settings-cover');
if (this.model.get('status') != 'init') {
@@ -56,7 +56,7 @@
$cover.hide();
}
},
-
+
// switch state
_switchState: function (element_id, parameter_id) {
if (this.model.get('status') == 'init') {
@@ -65,7 +65,7 @@
this._renderState(element_id, checked);
}
},
-
+
// render state
_renderState: function (element_id, checked) {
// swith icon class
@@ -77,7 +77,7 @@
$it.addClass(this.options.class_uncheck);
}
},
-
+
// load template
_template: function() {
return '<div class="upload-settings" style="position: relative;">' +
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -4,7 +4,7 @@
'mvc/upload/upload-settings',
'mvc/ui/ui-popover',
'mvc/ui/ui-select'],
-
+
function( Utils,
UploadModel,
UploadSettings,
@@ -18,7 +18,7 @@
options: {
padding : 8
},
-
+
// states
status_classes : {
init : 'upload-icon-button fa fa-trash-o',
@@ -27,36 +27,36 @@
success : 'upload-icon-button fa fa-check',
error : 'upload-icon-button fa fa-exclamation-triangle'
},
-
+
// handle for settings popover
settings: null,
-
+
// genome selector
select_genome : null,
-
+
// extension selector
select_extension : null,
-
+
// render
initialize: function(app, options) {
// link app
this.app = app;
-
+
// default value for extension of files
var default_ext = 'Auto-detect';
// link this
var self = this;
-
+
// create model
this.model = new UploadModel.Model(options);
-
+
// add upload item
this.setElement(this._template(options));
// link item
var it = this.$el;
-
+
// append popup to settings icon
this.settings = new Popover.View({
title : 'Upload configuration',
@@ -74,11 +74,11 @@
container: it.find('#genome'),
value: self.model.get('genome')
});
-
+
// initialize genome
this.model.set('genome', self.select_genome.value());
- // ensure files added after an individual row has changed
+ // ensure files added after an individual row has changed
// default to Auto-detect instead of ---
if(!(this.app.select_extension.value() === '---')){
this.default_ext = this.app.select_extension.value();
@@ -89,7 +89,7 @@
css: 'extension',
onchange : function() {
self.model.set('extension', self.select_extension.value());
- // if user has changed individual row type, then change "set all"
+ // if user has changed individual row type, then change "set all"
// type to '---'
if(!(self.select_extension.value() === app.select_extension.value()))
{
@@ -101,17 +101,17 @@
container: it.find('#extension'),
value: self.default_ext
});
-
+
// initialize extension
this.model.set('extension', self.select_extension.value());
-
+
//
// ui events
//
-
+
// handle click event
it.find('#symbol').on('click', function() { self._removeRow(); });
-
+
// handle extension info popover
it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
.on('mousedown', function(e) { e.preventDefault(); });
@@ -125,12 +125,12 @@
self.model.set('url_paste', $(e.target).val());
self.model.set('file_size', $(e.target).val().length);
});
-
+
// handle space to tabs button
it.find('#space_to_tabs').on('change', function(e) {
self.model.set('space_to_tabs', $(e.target).prop('checked'));
});
-
+
//
// model events
//
@@ -157,57 +157,57 @@
});
self.model.set('row', self);
},
-
+
// render
render: function() {
// read model
var file_name = this.model.get('file_name');
var file_size = this.model.get('file_size');
var file_mode = this.model.get('file_mode');
-
+
// link item
var it = this.$el;
-
+
// update title
it.find('#title').html(file_name);
-
+
// update info
it.find('#size').html(Utils.bytesToString (file_size));
-
+
// remove mode class
it.find('#mode').removeClass()
.addClass('mode');
-
+
// activate text field if file is new
if (file_mode == 'new') {
// get text component
var text = it.find('#text');
-
+
// get padding
var padding = this.options.padding;
-
+
// get dimensions
var width = it.width() - 2 * padding;
var height = it.height() - padding;
-
+
// set dimensions
text.css('width', width + 'px');
text.css('top', height + 'px');
it.height(height + text.height() + 2 * padding);
-
+
// show text field
text.show();
-
+
// update icon
it.find('#mode').addClass('fa fa-pencil');
}
-
+
// file from local disk
if (file_mode == 'local') {
// update icon
it.find('#mode').addClass('fa fa-laptop');
}
-
+
// file from ftp
if (file_mode == 'ftp') {
// update icon
@@ -220,7 +220,7 @@
// trigger remove event
this.select_genome.remove();
this.select_extension.remove();
-
+
// call the base class remove method
Backbone.View.prototype.remove.apply(this);
},
@@ -228,14 +228,14 @@
//
// handle model events
//
-
+
// genome
_refreshGenome: function() {
// update genome info on screen
var genome = this.model.get('genome');
this.select_genome.value(genome);
},
-
+
// progress
_refreshInfo: function() {
// write error message
@@ -246,7 +246,7 @@
this.$el.find('#info').hide();
}
},
-
+
// progress
_refreshPercentage : function() {
var percentage = parseInt(this.model.get('percentage'));
@@ -256,29 +256,29 @@
else
this.$el.find('#percentage').html('Adding to history...');
},
-
+
// status
_refreshStatus : function() {
// get element
var it = this.$el;
-
+
// identify new status
var status = this.model.get('status');
var status_class = this.status_classes[status];
-
+
// identify symbol and reset classes
var sy = this.$el.find('#symbol');
sy.removeClass();
-
+
// set new status class
sy.addClass(status_class);
-
+
// enable form fields
if (status == 'init') {
// select fields
this.select_genome.enable();
this.select_extension.enable();
-
+
// default fields
it.find('#text-content').attr('disabled', false);
it.find('#space_to_tabs').attr('disabled', false);
@@ -286,18 +286,18 @@
// select fields
this.select_genome.disable();
this.select_extension.disable();
-
+
// default fields
it.find('#text-content').attr('disabled', true);
it.find('#space_to_tabs').attr('disabled', true);
}
-
+
// success
if (status == 'success') {
it.addClass('success');
it.find('#percentage').html('100%');
}
-
+
// error
if (status == 'error') {
it.addClass('danger');
@@ -314,18 +314,18 @@
//
// handle ui events
//
-
+
// remove row
_removeRow: function() {
// get current status
var status = this.model.get('status');
-
+
// only remove from queue if not in processing line
if (status == 'init' || status == 'success' || status == 'error') {
this.app.collection.remove(this.model);
}
},
-
+
// attach file info popup
_showExtensionInfo : function() {
// initialize
@@ -333,7 +333,7 @@
var extension = this.model.get('extension');
var title = this.select_extension.text();
var description = _.findWhere(this.app.list_extensions, {'id': extension});
-
+
// create popup
if (!this.extension_popup) {
this.extension_popup = new Popover.View({
@@ -341,7 +341,7 @@
container: $el
});
}
-
+
// show / hide popup
if (!this.extension_popup.visible) {
this.extension_popup.title(title);
@@ -366,7 +366,7 @@
this.settings.hide();
}
},
-
+
// template
_templateDescription: function(options) {
if (options.description) {
@@ -379,7 +379,7 @@
return 'There is no description available for this file extension.';
}
},
-
+
// template
_template: function(options) {
return '<tr id="upload-item-' + options.id + '" class="upload-item">' +
@@ -417,7 +417,7 @@
'</td>' +
'</tr>';
}
-
+
});
});
diff -r 443f25d4608260ee699cf125166d76df003d2ef9 -r 49d651198b3a7756936c4b578ccdd824b2c55e4e static/scripts/mvc/upload/upload-settings.js
--- a/static/scripts/mvc/upload/upload-settings.js
+++ b/static/scripts/mvc/upload/upload-settings.js
@@ -8,35 +8,35 @@
class_check : 'upload-icon-button fa fa-check-square-o',
class_uncheck : 'upload-icon-button fa fa-square-o'
},
-
+
// render
initialize: function(app) {
// link app
this.app = app;
-
+
// link this
var self = this;
-
+
// set template
this.setElement(this._template());
-
+
// link model
this.model = this.app.model;
-
+
// ui event: space to tabs
this.$el.find('#upload-space-to-tabs').on('click', function() {
self._switchState('#upload-space-to-tabs', 'space_to_tabs');
});
-
+
// ui event: to posix
this.$el.find('#upload-to-posix-lines').on('click', function() {
self._switchState('#upload-to-posix-lines', 'to_posix_lines');
});
-
+
// render
this.render();
},
-
+
// events
events: {
'mousedown' : function(e) { e.preventDefault(); }
@@ -47,7 +47,7 @@
// render states
this._renderState('#upload-space-to-tabs', this.model.get('space_to_tabs'));
this._renderState('#upload-to-posix-lines', this.model.get('to_posix_lines'));
-
+
// disable options
var $cover = this.$el.find('#upload-settings-cover');
if (this.model.get('status') != 'init') {
@@ -56,7 +56,7 @@
$cover.hide();
}
},
-
+
// switch state
_switchState: function (element_id, parameter_id) {
if (this.model.get('status') == 'init') {
@@ -65,7 +65,7 @@
this._renderState(element_id, checked);
}
},
-
+
// render state
_renderState: function (element_id, checked) {
// swith icon class
@@ -77,7 +77,7 @@
$it.addClass(this.options.class_uncheck);
}
},
-
+
// load template
_template: function() {
return '<div class="upload-settings" style="position: relative;">' +
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
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/443f25d46082/
Changeset: 443f25d46082
User: guerler
Date: 2015-01-23 20:15:31+00:00
Summary: Upload: Remove spaces
Affected #: 2 files
diff -r 669da7067315a6ce236a2ee753e9af6264279c01 -r 443f25d4608260ee699cf125166d76df003d2ef9 client/galaxy/scripts/mvc/upload/upload-ftp.js
--- a/client/galaxy/scripts/mvc/upload/upload-ftp.js
+++ b/client/galaxy/scripts/mvc/upload/upload-ftp.js
@@ -122,13 +122,13 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
diff -r 669da7067315a6ce236a2ee753e9af6264279c01 -r 443f25d4608260ee699cf125166d76df003d2ef9 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -122,13 +122,13 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
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: jmchilton: Merged in nsoranzo/galaxy-central (pull request #646)
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/669da7067315/
Changeset: 669da7067315
User: jmchilton
Date: 2015-01-23 20:12:24+00:00
Summary: Merged in nsoranzo/galaxy-central (pull request #646)
Update rolling_restart.sh to treat .venv dir and GALAXY_CONFIG_FILE env variable as run.sh
Affected #: 2 files
diff -r de9bd9d7d47bfcdf45f3f170be391874b79e738f -r 669da7067315a6ce236a2ee753e9af6264279c01 rolling_restart.sh
--- a/rolling_restart.sh
+++ b/rolling_restart.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
cd `dirname $0`
check_if_not_started(){
@@ -8,7 +8,7 @@
current_pid_in_file=$(cat $2);
# If they're equivalent, then the current pid file agrees with our logs
# and we've succesfully started
- if [[ $latest_pid -eq $current_pid_in_file ]];
+ if [ $latest_pid -eq $current_pid_in_file ];
then
echo 0;
else
@@ -16,17 +16,29 @@
fi
}
+# If there is a .venv/ directory, assume it contains a virtualenv that we
+# should run this instance in.
+if [ -d .venv ];
+then
+ . .venv/bin/activate
+fi
-GALAXY_CONFIG_FILE=config/galaxy.ini
-if [ ! -f $GALAXY_CONFIG_FILE ]; then
- GALAXY_CONFIG_FILE=universe_wsgi.ini
+if [ -z "$GALAXY_CONFIG_FILE" ]; then
+ if [ -f universe_wsgi.ini ]; then
+ GALAXY_CONFIG_FILE=universe_wsgi.ini
+ elif [ -f config/galaxy.ini ]; then
+ GALAXY_CONFIG_FILE=config/galaxy.ini
+ else
+ GALAXY_CONFIG_FILE=config/galaxy.ini.sample
+ fi
+ export GALAXY_CONFIG_FILE
fi
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo`
for server in $servers;
do
# If there's a pid
- if [[ -e $server.pid ]]
+ if [ -e $server.pid ]
then
# Then kill it
echo "Killing $server"
@@ -44,12 +56,11 @@
pid=`cat $server.pid`
result=1
# Wait for the latest pid in the file to be the pid we've grabbed
- while [[ $result -eq 1 ]]
+ while [ $result -eq 1 ]
do
result=$(check_if_not_started $server.log $server.pid)
- echo -n "."
+ printf "."
sleep 1
done
- echo ""
+ echo
done
-
diff -r de9bd9d7d47bfcdf45f3f170be391874b79e738f -r 669da7067315a6ce236a2ee753e9af6264279c01 scripts/build_universe_config.py
--- a/scripts/build_universe_config.py
+++ b/scripts/build_universe_config.py
@@ -6,7 +6,10 @@
def merge():
- "Merges all .ini files in a specified directory into ./universe.ini"
+ """
+ Merges all .ini files in a specified directory into a file (defaults to
+ ./config/galaxy.ini ).
+ """
if len(argv) < 2:
message = "%s: Must specify directory to merge configuration files from." % argv[0]
raise Exception(message)
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0de04e073983/
Changeset: 0de04e073983
User: nsoranzo
Date: 2015-01-23 19:19:15+00:00
Summary: Fix merge() documentation.
Affected #: 1 file
diff -r 9ef517d8e767037e1633f6063c6edb3023f86499 -r 0de04e073983373e30775252efab83714eaa7184 scripts/build_universe_config.py
--- a/scripts/build_universe_config.py
+++ b/scripts/build_universe_config.py
@@ -6,7 +6,10 @@
def merge():
- "Merges all .ini files in a specified directory into ./universe.ini"
+ """
+ Merges all .ini files in a specified directory into a file (defaults to
+ ./config/galaxy.ini ).
+ """
if len(argv) < 2:
message = "%s: Must specify directory to merge configuration files from." % argv[0]
raise Exception(message)
https://bitbucket.org/galaxy/galaxy-central/commits/4f3f92ca8e74/
Changeset: 4f3f92ca8e74
User: nsoranzo
Date: 2015-01-23 19:23:41+00:00
Summary: Update rolling_restart.sh to treat .venv dir and GALAXY_CONFIG_FILE env variable as run.sh . Use POSIX shell syntax.
Affected #: 1 file
diff -r 0de04e073983373e30775252efab83714eaa7184 -r 4f3f92ca8e7488f4f5a90b8d57eddaeb3e1645d6 rolling_restart.sh
--- a/rolling_restart.sh
+++ b/rolling_restart.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
cd `dirname $0`
check_if_not_started(){
@@ -8,7 +8,7 @@
current_pid_in_file=$(cat $2);
# If they're equivalent, then the current pid file agrees with our logs
# and we've succesfully started
- if [[ $latest_pid -eq $current_pid_in_file ]];
+ if [ $latest_pid -eq $current_pid_in_file ];
then
echo 0;
else
@@ -16,17 +16,29 @@
fi
}
+# If there is a .venv/ directory, assume it contains a virtualenv that we
+# should run this instance in.
+if [ -d .venv ];
+then
+ . .venv/bin/activate
+fi
-GALAXY_CONFIG_FILE=config/galaxy.ini
-if [ ! -f $GALAXY_CONFIG_FILE ]; then
- GALAXY_CONFIG_FILE=universe_wsgi.ini
+if [ -z "$GALAXY_CONFIG_FILE" ]; then
+ if [ -f universe_wsgi.ini ]; then
+ GALAXY_CONFIG_FILE=universe_wsgi.ini
+ elif [ -f config/galaxy.ini ]; then
+ GALAXY_CONFIG_FILE=config/galaxy.ini
+ else
+ GALAXY_CONFIG_FILE=config/galaxy.ini.sample
+ fi
+ export GALAXY_CONFIG_FILE
fi
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo`
for server in $servers;
do
# If there's a pid
- if [[ -e $server.pid ]]
+ if [ -e $server.pid ]
then
# Then kill it
echo "Killing $server"
@@ -44,12 +56,11 @@
pid=`cat $server.pid`
result=1
# Wait for the latest pid in the file to be the pid we've grabbed
- while [[ $result -eq 1 ]]
+ while [ $result -eq 1 ]
do
result=$(check_if_not_started $server.log $server.pid)
- echo -n "."
+ printf "."
sleep 1
done
- echo ""
+ echo
done
-
https://bitbucket.org/galaxy/galaxy-central/commits/669da7067315/
Changeset: 669da7067315
User: jmchilton
Date: 2015-01-23 20:12:24+00:00
Summary: Merged in nsoranzo/galaxy-central (pull request #646)
Update rolling_restart.sh to treat .venv dir and GALAXY_CONFIG_FILE env variable as run.sh
Affected #: 2 files
diff -r de9bd9d7d47bfcdf45f3f170be391874b79e738f -r 669da7067315a6ce236a2ee753e9af6264279c01 rolling_restart.sh
--- a/rolling_restart.sh
+++ b/rolling_restart.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
cd `dirname $0`
check_if_not_started(){
@@ -8,7 +8,7 @@
current_pid_in_file=$(cat $2);
# If they're equivalent, then the current pid file agrees with our logs
# and we've succesfully started
- if [[ $latest_pid -eq $current_pid_in_file ]];
+ if [ $latest_pid -eq $current_pid_in_file ];
then
echo 0;
else
@@ -16,17 +16,29 @@
fi
}
+# If there is a .venv/ directory, assume it contains a virtualenv that we
+# should run this instance in.
+if [ -d .venv ];
+then
+ . .venv/bin/activate
+fi
-GALAXY_CONFIG_FILE=config/galaxy.ini
-if [ ! -f $GALAXY_CONFIG_FILE ]; then
- GALAXY_CONFIG_FILE=universe_wsgi.ini
+if [ -z "$GALAXY_CONFIG_FILE" ]; then
+ if [ -f universe_wsgi.ini ]; then
+ GALAXY_CONFIG_FILE=universe_wsgi.ini
+ elif [ -f config/galaxy.ini ]; then
+ GALAXY_CONFIG_FILE=config/galaxy.ini
+ else
+ GALAXY_CONFIG_FILE=config/galaxy.ini.sample
+ fi
+ export GALAXY_CONFIG_FILE
fi
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo`
for server in $servers;
do
# If there's a pid
- if [[ -e $server.pid ]]
+ if [ -e $server.pid ]
then
# Then kill it
echo "Killing $server"
@@ -44,12 +56,11 @@
pid=`cat $server.pid`
result=1
# Wait for the latest pid in the file to be the pid we've grabbed
- while [[ $result -eq 1 ]]
+ while [ $result -eq 1 ]
do
result=$(check_if_not_started $server.log $server.pid)
- echo -n "."
+ printf "."
sleep 1
done
- echo ""
+ echo
done
-
diff -r de9bd9d7d47bfcdf45f3f170be391874b79e738f -r 669da7067315a6ce236a2ee753e9af6264279c01 scripts/build_universe_config.py
--- a/scripts/build_universe_config.py
+++ b/scripts/build_universe_config.py
@@ -6,7 +6,10 @@
def merge():
- "Merges all .ini files in a specified directory into ./universe.ini"
+ """
+ Merges all .ini files in a specified directory into a file (defaults to
+ ./config/galaxy.ini ).
+ """
if len(argv) < 2:
message = "%s: Must specify directory to merge configuration files from." % argv[0]
raise Exception(message)
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: Upload: Cleanup ftp popup
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/de9bd9d7d47b/
Changeset: de9bd9d7d47b
User: guerler
Date: 2015-01-23 20:11:24+00:00
Summary: Upload: Cleanup ftp popup
Affected #: 3 files
diff -r 892da4d5dcc979919c82d4a57ce897d3e93278ce -r de9bd9d7d47bfcdf45f3f170be391874b79e738f client/galaxy/scripts/mvc/upload/upload-ftp.js
--- a/client/galaxy/scripts/mvc/upload/upload-ftp.js
+++ b/client/galaxy/scripts/mvc/upload/upload-ftp.js
@@ -6,7 +6,8 @@
// options
options: {
class_add : 'upload-icon-button fa fa-square-o',
- class_remove : 'upload-icon-button fa fa-check-square-o'
+ class_remove : 'upload-icon-button fa fa-check-square-o',
+ class_partial : 'upload-icon-button fa fa-minus-square-o'
},
// render
@@ -20,6 +21,9 @@
// set template
this.setElement(this._template());
+ // list of rows
+ this.rows = [];
+
// load extension
Utils.get({
url : galaxy_config.root + 'api/ftp_files',
@@ -35,7 +39,6 @@
// fill table
_fill: function(ftp_files) {
- var self = this;
if (ftp_files && ftp_files.length > 0) {
// add table
this.$el.find('#upload-ftp-content').html($(this._templateTable()));
@@ -43,7 +46,7 @@
// add files to table
var size = 0;
for (key in ftp_files) {
- this.add(ftp_files[key]);
+ this.rows.push(this._add(ftp_files[key]));
size += ftp_files[key].size;
}
@@ -51,37 +54,23 @@
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
- var selectAll = this.$el.find('#selectAll');
-
- // call method to determine and set selectAll status on loading
- this._updateSelectAll(selectAll);
-
- // selectAll checkbox has been clicked
- selectAll.on('click', function() {
- var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
- var len = checkboxes.length;
- $this = $(this);
- var allChecked = !($this.hasClass('fa-check-square-o'));
-
- // change state of the sub-checkboxes
- for(i = 0; i < len; i++) {
- if(allChecked) {
- // all checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-square-o')) {
- // if they are not checked, check them
- checkboxes.eq(i).trigger('updateUpBox');
- }
- } else {
- // no checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
- // if they are checked, uncheck them
- checkboxes.eq(i).trigger('updateUpBox');
- }
+ // add event handler to select/unselect all
+ this.$select_all = $('#upload-selectall');
+ this.$select_all.addClass(this.options.class_add);
+ var self = this;
+ this.$select_all.on('click', function() {
+ var add = self.$select_all.hasClass(self.options.class_add);
+ for (key in ftp_files) {
+ var ftp_file = ftp_files[key];
+ var model_index = self._find(ftp_file);
+ if(!model_index && add || model_index && !add) {
+ self.rows[key].trigger('click');
}
}
+ });
- self._updateSelectAll(selectAll);
- });
+ // refresh
+ self._refresh();
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
@@ -92,7 +81,7 @@
},
// add
- add: function(ftp_file) {
+ _add: function(ftp_file) {
// link this
var self = this;
@@ -116,8 +105,8 @@
// add icon class
$icon.addClass(icon_class);
- // add files to the uploadbox
- $it.on('updateUpBox', function() {
+ // click to add ftp files
+ $it.on('click', function() {
// find model
var model_index = self._find(ftp_file);
@@ -133,67 +122,51 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
+
+ // update select all checkbox
+ self._refresh();
});
- // click to add ftp files
- $it.on('click', function() {
- //trigger my new event
- $icon.trigger('updateUpBox');
-
- // click to add ftp files
- // modify selectAll box based on number of checkboxes checked
- var selectBox=$icon.parents().find('#selectAll');
- // determine and set state of selectAll after sub-checkbox clicked
- self._updateSelectAll(selectBox);
- });
+ // return dom handler
+ return $it;
},
- _updateSelectAll: function(selectBox) {
- // array of all checkboxes
- var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
- // array of only checked checkboxes
- var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
- var lenAll = checkboxes.length;
- var lenChecked = checkedCheckboxes.length;
-
- // determine which state the selectAll checkbox needs to be and setting it
- if(lenChecked > 0 && lenChecked !== lenAll) {
- // indeterminate state
- selectBox.removeClass('fa-square-o fa-check-square-o');
- selectBox.addClass('fa-minus-square-o');
- } else if(lenChecked === lenAll) {
- // checked state
- selectBox.removeClass('fa-square-o fa-minus-square-o');
- selectBox.addClass('fa-check-square-o');
- } else if(lenChecked === 0) {
- // unchecked state
- selectBox.removeClass('fa-check-square-o fa-minus-square-o');
- selectBox.addClass('fa-square-o');
+ // refresh
+ _refresh: function() {
+ var filtered = this.app.collection.where({file_mode : 'ftp'});
+ this.$select_all.removeClass();
+ if (filtered.length == 0) {
+ this.$select_all.addClass(this.options.class_add);
+ } else {
+ if (filtered.length == this.rows.length) {
+ this.$select_all.addClass(this.options.class_remove);
+ } else {
+ this.$select_all.addClass(this.options.class_partial);
+ }
}
},
// get model index
_find: function(ftp_file) {
- // check if exists already
- var filtered = this.app.collection.where({file_path : ftp_file.path});
- var model_index = null;
- for (var key in filtered) {
- var item = filtered[key];
- if (item.get('status') == 'init' && item.get('file_mode') == 'ftp') {
- model_index = item.get('id');
- }
+ var item = this.app.collection.findWhere({
+ file_path : ftp_file.path,
+ status : 'init',
+ file_mode : 'ftp'
+ });
+ if (item) {
+ return item.get('id');
}
- return model_index;
+ return null;
},
// template row
@@ -218,7 +191,7 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
- '<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
+ '<th><div id="upload-selectall"></th>' +
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
@@ -243,7 +216,6 @@
'<div id="upload-ftp-content"></div>' +
'<div>';
}
-
});
});
diff -r 892da4d5dcc979919c82d4a57ce897d3e93278ce -r de9bd9d7d47bfcdf45f3f170be391874b79e738f static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -6,7 +6,8 @@
// options
options: {
class_add : 'upload-icon-button fa fa-square-o',
- class_remove : 'upload-icon-button fa fa-check-square-o'
+ class_remove : 'upload-icon-button fa fa-check-square-o',
+ class_partial : 'upload-icon-button fa fa-minus-square-o'
},
// render
@@ -20,6 +21,9 @@
// set template
this.setElement(this._template());
+ // list of rows
+ this.rows = [];
+
// load extension
Utils.get({
url : galaxy_config.root + 'api/ftp_files',
@@ -35,7 +39,6 @@
// fill table
_fill: function(ftp_files) {
- var self = this;
if (ftp_files && ftp_files.length > 0) {
// add table
this.$el.find('#upload-ftp-content').html($(this._templateTable()));
@@ -43,7 +46,7 @@
// add files to table
var size = 0;
for (key in ftp_files) {
- this.add(ftp_files[key]);
+ this.rows.push(this._add(ftp_files[key]));
size += ftp_files[key].size;
}
@@ -51,37 +54,23 @@
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
- var selectAll = this.$el.find('#selectAll');
-
- // call method to determine and set selectAll status on loading
- this._updateSelectAll(selectAll);
-
- // selectAll checkbox has been clicked
- selectAll.on('click', function() {
- var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
- var len = checkboxes.length;
- $this = $(this);
- var allChecked = !($this.hasClass('fa-check-square-o'));
-
- // change state of the sub-checkboxes
- for(i = 0; i < len; i++) {
- if(allChecked) {
- // all checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-square-o')) {
- // if they are not checked, check them
- checkboxes.eq(i).trigger('updateUpBox');
- }
- } else {
- // no checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
- // if they are checked, uncheck them
- checkboxes.eq(i).trigger('updateUpBox');
- }
+ // add event handler to select/unselect all
+ this.$select_all = $('#upload-selectall');
+ this.$select_all.addClass(this.options.class_add);
+ var self = this;
+ this.$select_all.on('click', function() {
+ var add = self.$select_all.hasClass(self.options.class_add);
+ for (key in ftp_files) {
+ var ftp_file = ftp_files[key];
+ var model_index = self._find(ftp_file);
+ if(!model_index && add || model_index && !add) {
+ self.rows[key].trigger('click');
}
}
+ });
- self._updateSelectAll(selectAll);
- });
+ // refresh
+ self._refresh();
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
@@ -92,7 +81,7 @@
},
// add
- add: function(ftp_file) {
+ _add: function(ftp_file) {
// link this
var self = this;
@@ -116,8 +105,8 @@
// add icon class
$icon.addClass(icon_class);
- // add files to the uploadbox
- $it.on('updateUpBox', function() {
+ // click to add ftp files
+ $it.on('click', function() {
// find model
var model_index = self._find(ftp_file);
@@ -133,67 +122,51 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
+
+ // update select all checkbox
+ self._refresh();
});
- // click to add ftp files
- $it.on('click', function() {
- //trigger my new event
- $icon.trigger('updateUpBox');
-
- // click to add ftp files
- // modify selectAll box based on number of checkboxes checked
- var selectBox=$icon.parents().find('#selectAll');
- // determine and set state of selectAll after sub-checkbox clicked
- self._updateSelectAll(selectBox);
- });
+ // return dom handler
+ return $it;
},
- _updateSelectAll: function(selectBox) {
- // array of all checkboxes
- var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
- // array of only checked checkboxes
- var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
- var lenAll = checkboxes.length;
- var lenChecked = checkedCheckboxes.length;
-
- // determine which state the selectAll checkbox needs to be and setting it
- if(lenChecked > 0 && lenChecked !== lenAll) {
- // indeterminate state
- selectBox.removeClass('fa-square-o fa-check-square-o');
- selectBox.addClass('fa-minus-square-o');
- } else if(lenChecked === lenAll) {
- // checked state
- selectBox.removeClass('fa-square-o fa-minus-square-o');
- selectBox.addClass('fa-check-square-o');
- } else if(lenChecked === 0) {
- // unchecked state
- selectBox.removeClass('fa-check-square-o fa-minus-square-o');
- selectBox.addClass('fa-square-o');
+ // refresh
+ _refresh: function() {
+ var filtered = this.app.collection.where({file_mode : 'ftp'});
+ this.$select_all.removeClass();
+ if (filtered.length == 0) {
+ this.$select_all.addClass(this.options.class_add);
+ } else {
+ if (filtered.length == this.rows.length) {
+ this.$select_all.addClass(this.options.class_remove);
+ } else {
+ this.$select_all.addClass(this.options.class_partial);
+ }
}
},
// get model index
_find: function(ftp_file) {
- // check if exists already
- var filtered = this.app.collection.where({file_path : ftp_file.path});
- var model_index = null;
- for (var key in filtered) {
- var item = filtered[key];
- if (item.get('status') == 'init' && item.get('file_mode') == 'ftp') {
- model_index = item.get('id');
- }
+ var item = this.app.collection.findWhere({
+ file_path : ftp_file.path,
+ status : 'init',
+ file_mode : 'ftp'
+ });
+ if (item) {
+ return item.get('id');
}
- return model_index;
+ return null;
},
// template row
@@ -218,7 +191,7 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
- '<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
+ '<th><div id="upload-selectall"></th>' +
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
@@ -243,7 +216,6 @@
'<div id="upload-ftp-content"></div>' +
'<div>';
}
-
});
});
diff -r 892da4d5dcc979919c82d4a57ce897d3e93278ce -r de9bd9d7d47bfcdf45f3f170be391874b79e738f static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)},error:function(){b._fill()}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(d){var b=this;if(d&&d.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var c=0;for(key in d){this.add(d[key]);c+=d[key].size}this.$el.find("#upload-ftp-number").html(d.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(c,true));var e=this.$el.find("#selectAll");this._updateSelectAll(e);e.on("click",function(){var h=$(this).parents().find("tr.upload-ftp-row>td>div");var g=h.length;$this=$(this);var f=!($this.hasClass("fa-check-square-o"));for(i=0;i<g;i++){if(f){if(h.eq(i).hasClass("fa-square-o")){h.eq(i).trigger("updateUpBox")}}else{if(h.eq(i).hasClass("fa-check-square-o")){h.eq(i).trigger("updateUpBox")}}}b._updateSelectAll(e)})}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("updateUpBox",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}});e.on("click",function(){b.trigger("updateUpBox");var g=b.parents().find("#selectAll");d._updateSelectAll(g)})},_updateSelectAll:function(e){var d=e.parents().find("tr.upload-ftp-row>td>div");var f=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o");var c=d.length;var b=f.length;if(b>0&&b!==c){e.removeClass("fa-square-o fa-check-square-o");e.addClass("fa-minus-square-o")}else{if(b===c){e.removeClass("fa-square-o fa-minus-square-o");e.addClass("fa-check-square-o")}else{if(b===0){e.removeClass("fa-check-square-o fa-minus-square-o");e.addClass("fa-square-o")}}}},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());this.rows=[];a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)},error:function(){b._fill()}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(d){if(d&&d.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var c=0;for(key in d){this.rows.push(this._add(d[key]));c+=d[key].size}this.$el.find("#upload-ftp-number").html(d.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(c,true));this.$select_all=$("#upload-selectall");this.$select_all.addClass(this.options.class_add);var b=this;this.$select_all.on("click",function(){var g=b.$select_all.hasClass(b.options.class_add);for(key in d){var f=d[key];var e=b._find(f);if(!e&&g||e&&!g){b.rows[key].trigger("click")}}});b._refresh()}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},_add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("click",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}d._refresh()});return e},_refresh:function(){var b=this.app.collection.where({file_mode:"ftp"});this.$select_all.removeClass();if(b.length==0){this.$select_all.addClass(this.options.class_add)}else{if(b.length==this.rows.length){this.$select_all.addClass(this.options.class_remove)}else{this.$select_all.addClass(this.options.class_partial)}}},_find:function(c){var b=this.app.collection.findWhere({file_path:c.path,status:"init",file_mode:"ftp"});if(b){return b.get("id")}return null},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="upload-selectall"></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ 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
commit/galaxy-central: jmchilton: Clarify default reports template cache location.
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/892da4d5dcc9/
Changeset: 892da4d5dcc9
User: jmchilton
Date: 2015-01-23 20:08:37+00:00
Summary: Clarify default reports template cache location.
Affected #: 1 file
diff -r e361766bbcfd8976ee05cb8826ed239d0f2028f6 -r 892da4d5dcc979919c82d4a57ce897d3e93278ce config/reports_wsgi.ini.sample
--- a/config/reports_wsgi.ini.sample
+++ b/config/reports_wsgi.ini.sample
@@ -28,7 +28,7 @@
# Mako templates are compiled as needed and cached for reuse, this directory is
# used for the cache
-# template_cache_path = database/compiled_templates
+#template_cache_path = database/compiled_templates/reports
# Session support (beaker)
use_beaker_session = True
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