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
commit/galaxy-central: guerler: ToolForm: Update validation
by commits-noreply@bitbucket.org 29 Jan '15
by commits-noreply@bitbucket.org 29 Jan '15
29 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2171bcc223ca/
Changeset: 2171bcc223ca
User: guerler
Date: 2015-01-29 09:30:33+00:00
Summary: ToolForm: Update validation
Affected #: 4 files
diff -r 708c937803503af156be3dde0c403095edcb1e31 -r 2171bcc223ca38613f50bba79df7739aefeb701b client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -122,15 +122,11 @@
value = patch[input.type](value);
}
- // validate value
- var skipped = field.skip && input.optional;
- var unvalidated = field.validate && !field.validate();
- if (!self.app.options.use_defaults) {
- if (skipped || unvalidated) {
- value = null;
- }
- } else {
- if (!skipped && unvalidated) {
+ // validate field value
+ if (field.skip || (field.validate && !field.validate())) {
+ if (self.app.options.use_defaults) {
+ value = input.default_value;
+ } else {
value = null;
}
}
diff -r 708c937803503af156be3dde0c403095edcb1e31 -r 2171bcc223ca38613f50bba79df7739aefeb701b lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2405,7 +2405,9 @@
pass
group_state[input.test_param.name] = value
else:
- default_value = incoming.get(key, state.get(input.name, None))
+ default_value = incoming.get(key, None)
+ if not default_value:
+ default_value = state[input.name]
value, error = check_state(trans, input, default_value, context)
if error:
errors[key] = error
@@ -2456,10 +2458,6 @@
# sanitize values
sanitize(tool_dict, 'value')
sanitize(tool_dict, 'default_value')
-
- # set default value if necessary
- if not tool_dict['value']:
- tool_dict['value'] = tool_dict['default_value']
# backup final input dictionary
group_inputs[input_index] = tool_dict
diff -r 708c937803503af156be3dde0c403095edcb1e31 -r 2171bcc223ca38613f50bba79df7739aefeb701b static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -122,15 +122,11 @@
value = patch[input.type](value);
}
- // validate value
- var skipped = field.skip && input.optional;
- var unvalidated = field.validate && !field.validate();
- if (!self.app.options.use_defaults) {
- if (skipped || unvalidated) {
- value = null;
- }
- } else {
- if (!skipped && unvalidated) {
+ // validate field value
+ if (field.skip || (field.validate && !field.validate())) {
+ if (self.app.options.use_defaults) {
+ value = input.default_value;
+ } else {
value = null;
}
}
diff -r 708c937803503af156be3dde0c403095edcb1e31 -r 2171bcc223ca38613f50bba79df7739aefeb701b static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(l,n){for(var p in n){var w=n[p];if(w.input){var s=w.input;var t=l;if(l!=""){t+="|"}t+=s.name;switch(s.type){case"repeat":var k="section-";var q=[];var m=null;for(var r in w){var o=r.indexOf(k);if(o!=-1){o+=k.length;q.push(parseInt(r.substr(o)));if(!m){m=r.substr(0,o)}}}q.sort(function(A,i){return A-i});var p=0;for(var x in q){c(t+"_"+p++,w[m+q[x]])}break;case"conditional":var v=b.app.field_list[s.id].value();if(g[s.test_param.type]){v=g[s.test_param.type](v)}d(t+"|"+s.test_param.name,s.id,v);var u=b.matchCase(s,v);if(u!=-1){c(t,n[s.id+"-section-"+u])}break;case"section":c("",w);break;default:var j=b.app.field_list[s.id];if(j&&j.value){var v=j.value();if(g[s.type]){v=g[s.type](v)}var z=j.skip&&s.optional;var h=j.validate&&!j.validate();if(!b.app.options.use_defaults){if(z||h){v=null}}else{if(!z&&h){v=null}}if(s.ignore===undefined||(v!==null&&s.ignore!=v)){d(t,s.id,v);if(s.payload){for(var y in s.payload){d(y,s.id,s.payload[y])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if(t.skip||(t.validate&&!t.validate())){if(b.app.options.use_defaults){v=u.default_value}else{v=null}}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ 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: Remove style desc from js
by commits-noreply@bitbucket.org 29 Jan '15
by commits-noreply@bitbucket.org 29 Jan '15
29 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/708c93780350/
Changeset: 708c93780350
User: guerler
Date: 2015-01-29 08:10:36+00:00
Summary: Upload: Remove style desc from js
Affected #: 5 files
diff -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 -r 708c937803503af156be3dde0c403095edcb1e31 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
@@ -171,11 +171,11 @@
// template row
_templateRow: function(options) {
- return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
+ return '<tr class="upload-ftp-row">' +
'<td><div class="icon"/></td>' +
- '<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
- '<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
- '<td style="white-space: nowrap;">' + options.ctime + '</td>' +
+ '<td class="label"><p>' + options.path + '</p></td>' +
+ '<td class="nonlabel">' + Utils.bytesToString(options.size) + '</td>' +
+ '<td class="nonlabel">' + options.ctime + '</td>' +
'</tr>';
},
diff -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 -r 708c937803503af156be3dde0c403095edcb1e31 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -171,11 +171,11 @@
// template row
_templateRow: function(options) {
- return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
+ return '<tr class="upload-ftp-row">' +
'<td><div class="icon"/></td>' +
- '<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
- '<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
- '<td style="white-space: nowrap;">' + options.ctime + '</td>' +
+ '<td class="label"><p>' + options.path + '</p></td>' +
+ '<td class="nonlabel">' + Utils.bytesToString(options.size) + '</td>' +
+ '<td class="nonlabel">' + options.ctime + '</td>' +
'</tr>';
},
diff -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 -r 708c937803503af156be3dde0c403095edcb1e31 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",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
+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"><td><div class="icon"/></td><td class="label"><p>'+b.path+'</p></td><td class="nonlabel">'+a.bytesToString(b.size)+'</td><td class="nonlabel">'+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
diff -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 -r 708c937803503af156be3dde0c403095edcb1e31 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1388,6 +1388,8 @@
.upload-ftp{height:250px;width:500px;overflow:auto}.upload-ftp .upload-ftp-wait{font-size:1.2em;position:absolute;bottom:10px;right:10px}
.upload-ftp .upload-ftp-help{margin-bottom:10px}
.upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px}
+.upload-ftp .upload-ftp-row{cursor:pointer}.upload-ftp .upload-ftp-row .label{width:240px}.upload-ftp .upload-ftp-row .label p{width:inherit;word-wrap:break-word}
+.upload-ftp .upload-ftp-row .nonlabel{white-space:nowrap}
.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-top:10px}.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}
diff -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 -r 708c937803503af156be3dde0c403095edcb1e31 static/style/src/less/upload.less
--- a/static/style/src/less/upload.less
+++ b/static/style/src/less/upload.less
@@ -198,6 +198,20 @@
text-align: center;
margin-top: 20px;
}
+
+ .upload-ftp-row {
+ cursor: pointer;
+ .label {
+ width: 240px;
+ p {
+ width: inherit;
+ word-wrap: break-word;
+ }
+ }
+ .nonlabel {
+ white-space: nowrap;
+ }
+ }
}
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
29 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b46b6068fa0e/
Changeset: b46b6068fa0e
User: guerler
Date: 2015-01-29 08:00:51+00:00
Summary: Upload: Fix comment
Affected #: 2 files
diff -r b962897b1dfe60442bf5328637cb3e23b800d53f -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 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
@@ -138,7 +138,7 @@
self.list_extensions.unshift(self.auto);
}
- // set default extensions
+ // set default extension
self.default_extension = self.list_extensions[0] && self.list_extensions[0].id;
}
});
@@ -159,7 +159,7 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // set default extensions
+ // set default genome
self.default_genome = self.list_genomes[0] && self.list_genomes[0].id;
}
});
diff -r b962897b1dfe60442bf5328637cb3e23b800d53f -r b46b6068fa0e9db3fa31f1b80a0494c3fb4d49b5 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -138,7 +138,7 @@
self.list_extensions.unshift(self.auto);
}
- // set default extensions
+ // set default extension
self.default_extension = self.list_extensions[0] && self.list_extensions[0].id;
}
});
@@ -159,7 +159,7 @@
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
- // set default extensions
+ // set default genome
self.default_genome = self.list_genomes[0] && self.list_genomes[0].id;
}
});
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: Improve user interaction
by commits-noreply@bitbucket.org 29 Jan '15
by commits-noreply@bitbucket.org 29 Jan '15
29 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b962897b1dfe/
Changeset: b962897b1dfe
User: guerler
Date: 2015-01-29 07:55:56+00:00
Summary: Upload: Improve user interaction
Affected #: 3 files
diff -r c80c4227f2250a3b891d08b2c78d654dfd650691 -r b962897b1dfe60442bf5328637cb3e23b800d53f 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
@@ -137,6 +137,9 @@
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
}
+
+ // set default extensions
+ self.default_extension = self.list_extensions[0] && self.list_extensions[0].id;
}
});
@@ -155,6 +158,9 @@
self.list_genomes.sort(function(a, b) {
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
+
+ // set default extensions
+ self.default_genome = self.list_genomes[0] && self.list_genomes[0].id;
}
});
@@ -222,9 +228,16 @@
// select extension
this.select_extension = new Select.View({
css : 'header-selection',
- data : self.list_extensions,
- container : self.$el.parent().find('#header-extension'),
- value : self.list_extensions[0]
+ data : this.list_extensions,
+ container : this.$el.parent().find('#header-extension'),
+ value : this.default_extension,
+ onchange : function(extension) {
+ self.collection.each(function(item) {
+ if (item.get('status') == 'init' && item.get('extension') == self.default_extension) {
+ item.set('extension', extension);
+ }
+ });
+ }
});
// handle extension info popover
@@ -232,16 +245,24 @@
self.showExtensionInfo({
$el : $(e.target),
title : self.select_extension.text(),
- extension : self.select_extension.value()
+ extension : self.select_extension.value(),
+ placement : 'top'
});
}).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]
+ data : this.list_genomes,
+ container : this.$el.parent().find('#header-genome'),
+ value : this.default_genome,
+ onchange : function(genome) {
+ self.collection.each(function(item) {
+ if (item.get('status') == 'init' && item.get('genome') == self.default_genome) {
+ item.set('genome', genome);
+ }
+ });
+ }
});
}
@@ -266,7 +287,7 @@
// create popup
this.extension_popup && this.extension_popup.remove();
this.extension_popup = new Popover.View({
- placement: 'bottom',
+ placement: options.placement || 'bottom',
container: $el,
destroy: true
});
@@ -403,7 +424,7 @@
it.set('percentage', percentage);
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(percentage, file.size));
+ this.ui_button.set('percentage', this._uploadPercentage(percentage, file.size));
},
// success
@@ -417,7 +438,7 @@
var file_size = it.get('file_size');
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(100, file_size));
+ this.ui_button.set('percentage', this._uploadPercentage(100, file_size));
// update completed
this.upload_completed += file_size * 100;
@@ -444,7 +465,7 @@
it.set('info', message);
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(100, file.size));
+ this.ui_button.set('percentage', this._uploadPercentage(100, file.size));
this.ui_button.set('status', 'danger');
// update completed
@@ -563,8 +584,8 @@
this.uploadbox.reset();
// reset value for universal type drop-down
- this.select_extension.value(this.list_extensions[0]);
- this.select_genome.value(this.list_genomes[0]);
+ this.select_extension.value(this.default_extension);
+ this.select_genome.value(this.default_genome);
// reset button
this.ui_button.set('percentage', 0);
@@ -652,11 +673,10 @@
},
// calculate percentage of all queued uploads
- _upload_percentage: function(percentage, size) {
+ _uploadPercentage: function(percentage, size) {
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
-
// template for extensions description
_templateDescription: function(options) {
if (options.description) {
diff -r c80c4227f2250a3b891d08b2c78d654dfd650691 -r b962897b1dfe60442bf5328637cb3e23b800d53f static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -137,6 +137,9 @@
if (!self.options.datatypes_disable_auto) {
self.list_extensions.unshift(self.auto);
}
+
+ // set default extensions
+ self.default_extension = self.list_extensions[0] && self.list_extensions[0].id;
}
});
@@ -155,6 +158,9 @@
self.list_genomes.sort(function(a, b) {
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
+
+ // set default extensions
+ self.default_genome = self.list_genomes[0] && self.list_genomes[0].id;
}
});
@@ -222,9 +228,16 @@
// select extension
this.select_extension = new Select.View({
css : 'header-selection',
- data : self.list_extensions,
- container : self.$el.parent().find('#header-extension'),
- value : self.list_extensions[0]
+ data : this.list_extensions,
+ container : this.$el.parent().find('#header-extension'),
+ value : this.default_extension,
+ onchange : function(extension) {
+ self.collection.each(function(item) {
+ if (item.get('status') == 'init' && item.get('extension') == self.default_extension) {
+ item.set('extension', extension);
+ }
+ });
+ }
});
// handle extension info popover
@@ -232,16 +245,24 @@
self.showExtensionInfo({
$el : $(e.target),
title : self.select_extension.text(),
- extension : self.select_extension.value()
+ extension : self.select_extension.value(),
+ placement : 'top'
});
}).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]
+ data : this.list_genomes,
+ container : this.$el.parent().find('#header-genome'),
+ value : this.default_genome,
+ onchange : function(genome) {
+ self.collection.each(function(item) {
+ if (item.get('status') == 'init' && item.get('genome') == self.default_genome) {
+ item.set('genome', genome);
+ }
+ });
+ }
});
}
@@ -266,7 +287,7 @@
// create popup
this.extension_popup && this.extension_popup.remove();
this.extension_popup = new Popover.View({
- placement: 'bottom',
+ placement: options.placement || 'bottom',
container: $el,
destroy: true
});
@@ -403,7 +424,7 @@
it.set('percentage', percentage);
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(percentage, file.size));
+ this.ui_button.set('percentage', this._uploadPercentage(percentage, file.size));
},
// success
@@ -417,7 +438,7 @@
var file_size = it.get('file_size');
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(100, file_size));
+ this.ui_button.set('percentage', this._uploadPercentage(100, file_size));
// update completed
this.upload_completed += file_size * 100;
@@ -444,7 +465,7 @@
it.set('info', message);
// update ui button
- this.ui_button.set('percentage', this._upload_percentage(100, file.size));
+ this.ui_button.set('percentage', this._uploadPercentage(100, file.size));
this.ui_button.set('status', 'danger');
// update completed
@@ -563,8 +584,8 @@
this.uploadbox.reset();
// reset value for universal type drop-down
- this.select_extension.value(this.list_extensions[0]);
- this.select_genome.value(this.list_genomes[0]);
+ this.select_extension.value(this.default_extension);
+ this.select_genome.value(this.default_genome);
// reset button
this.ui_button.set('percentage', 0);
@@ -652,11 +673,10 @@
},
// calculate percentage of all queued uploads
- _upload_percentage: function(percentage, size) {
+ _uploadPercentage: function(percentage, size) {
return (this.upload_completed + (percentage * size)) / this.upload_size;
},
-
// template for extensions description
_templateDescription: function(options) {
if (options.description) {
diff -r c80c4227f2250a3b891d08b2c78d654dfd650691 -r b962897b1dfe60442bf5328637cb3e23b800d53f 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,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 class="upload-top"><h6 id="'+i+'" class="upload-info"></h6></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 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>'}})});
\ 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)}i.default_extension=i.list_extensions[0]&&i.list_extensions[0].id}});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});i.default_genome=i.list_genomes[0]&&i.list_genomes[0].id}});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:this.list_extensions,container:this.$el.parent().find("#header-extension"),value:this.default_extension,onchange:function(k){i.collection.each(function(l){if(l.get("status")=="init"&&l.get("extension")==i.default_extension){l.set("extension",k)}})}});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(),placement:"top"})}).on("mousedown",function(k){k.preventDefault()});this.select_genome=new h.View({css:"header-selection",data:this.list_genomes,container:this.$el.parent().find("#header-genome"),value:this.default_genome,onchange:function(k){i.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")==i.default_genome){l.set("genome",k)}})}})}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:j.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._uploadPercentage(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._uploadPercentage(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._uploadPercentage(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.default_extension);this.select_genome.value(this.default_genome);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()}},_uploadPercentage: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 class="upload-top"><h6 id="'+i+'" class="upload-info"></h6></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 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>'}})});
\ 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: Place default selectors into footer
by commits-noreply@bitbucket.org 29 Jan '15
by commits-noreply@bitbucket.org 29 Jan '15
29 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c80c4227f225/
Changeset: c80c4227f225
User: guerler
Date: 2015-01-29 07:23:26+00:00
Summary: Upload: Place default selectors into footer
Affected #: 5 files
diff -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 -r c80c4227f2250a3b891d08b2c78d654dfd650691 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
@@ -672,12 +672,8 @@
// load html template
_template: function(id, idInfo) {
- 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"/>' +
+ return '<div class="upload-top">' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -695,9 +691,13 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="upload-footer">' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
- '</div>' ;
+ '<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>';
}
});
diff -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 -r c80c4227f2250a3b891d08b2c78d654dfd650691 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -672,12 +672,8 @@
// load html template
_template: function(id, idInfo) {
- 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"/>' +
+ return '<div class="upload-top">' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
'</div>' +
'<div id="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
@@ -695,9 +691,13 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<div class="upload-footer">' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
- '</div>' ;
+ '<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>';
}
});
diff -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 -r c80c4227f2250a3b891d08b2c78d654dfd650691 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,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
+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 class="upload-top"><h6 id="'+i+'" class="upload-info"></h6></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 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>'}})});
\ No newline at end of file
diff -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 -r c80c4227f2250a3b891d08b2c78d654dfd650691 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1389,10 +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{height:5%;text-align:left;max-height:20px;line-height:18px;margin-top:10px}.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}
+.upload-top{height:5%;text-align:center}.upload-top .upload-info{margin-top:0px;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}
diff -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 -r c80c4227f2250a3b891d08b2c78d654dfd650691 static/style/src/less/upload.less
--- a/static/style/src/less/upload.less
+++ b/static/style/src/less/upload.less
@@ -219,7 +219,7 @@
text-align:left;
max-height:20px;
line-height:18px;
- margin-bottom: 15px;
+ margin-top: 10px;
.header-title {
font-weight: bold;
padding-left: 60px;
@@ -243,10 +243,11 @@
}
}
-.upload-footer {
+.upload-top {
height:5%;
text-align:center;
.upload-info {
+ margin-top: 0px;
font-weight: normal;
text-align: center;
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Parameters: Multiselect back to optional by default
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ab754acceaf9/
Changeset: ab754acceaf9
User: guerler
Date: 2015-01-29 05:57:59+00:00
Summary: Parameters: Multiselect back to optional by default
Affected #: 1 file
diff -r c5415e67cae27304e628103d249264753ad0d7cc -r ab754acceaf9c786c7826dbd9d8316a384acdeb9 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -772,6 +772,8 @@
input_source = ensure_input_source( input_source )
ToolParameter.__init__( self, tool, input_source )
self.multiple = input_source.get_bool( 'multiple', False )
+ # Multiple selects are optional by default, single selection is the inverse.
+ self.optional = input_source.parse_optional( self.multiple )
self.display = input_source.get( 'display', None )
self.separator = input_source.get( 'separator', ',' )
self.legal_values = set()
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: Workflow: Add tool form switch to config, fix late validation check
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c5415e67cae2/
Changeset: c5415e67cae2
User: guerler
Date: 2015-01-29 05:38:02+00:00
Summary: Workflow: Add tool form switch to config, fix late validation check
Affected #: 4 files
diff -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf -r c5415e67cae27304e628103d249264753ad0d7cc config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -757,6 +757,9 @@
# Use new tool form
#toolform_upgrade = True
+# Use new tool form in workflow editor
+#workflow_toolform_upgrade = False
+
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
diff -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf -r c5415e67cae27304e628103d249264753ad0d7cc lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -945,7 +945,7 @@
# Old style dynamic options, no dependency information so there isn't
# a lot we can do: if we're dealing with workflows, have to assume
# late validation no matter what.
- if self.dynamic_options is not None and ( trans is None or trans.workflow_building_mode ):
+ if (self.dynamic_options is not None or self.is_dynamic is not None) and ( trans is None or trans.workflow_building_mode ):
return True
# If we got this far, we can actually look at the dependencies
# to see if their values will not be available until runtime.
diff -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf -r c5415e67cae27304e628103d249264753ad0d7cc templates/webapps/galaxy/workflow/editor.mako
--- a/templates/webapps/galaxy/workflow/editor.mako
+++ b/templates/webapps/galaxy/workflow/editor.mako
@@ -33,7 +33,9 @@
<script type='text/javascript'>
// Switch for new tool form
- __NEWTOOLFORM__ = false;
+ %if util.string_as_bool(trans.app.config.get('workflow_toolform_upgrade', False)):
+ __NEWTOOLFORM__ = true;
+ %endif
// Globals
workflow = null;
diff -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf -r c5415e67cae27304e628103d249264753ad0d7cc templates/webapps/galaxy/workflow/editor_tool_form.mako
--- a/templates/webapps/galaxy/workflow/editor_tool_form.mako
+++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako
@@ -1,5 +1,5 @@
## TEMPORARY SWITCH FOR THE NEW TOOL FORM
-%if False:
+%if util.string_as_bool(trans.app.config.get('workflow_toolform_upgrade', False)):
${h.js("libs/bibtex", "libs/jquery/jquery-ui")}
${h.css('jquery-ui/smoothness/jquery-ui')}
<%
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: ToolForm: Activate by default
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2de1b7c819a2/
Changeset: 2de1b7c819a2
User: guerler
Date: 2015-01-29 04:59:43+00:00
Summary: ToolForm: Activate by default
Affected #: 2 files
diff -r 052c03f52326a5755013a6b5e9d7ad746d4dd940 -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -755,7 +755,7 @@
# -- Beta features
# Use new tool form
-toolform_upgrade = True
+#toolform_upgrade = True
# Enable Galaxy to communicate directly with a sequencer
#enable_sequencer_communication = False
diff -r 052c03f52326a5755013a6b5e9d7ad746d4dd940 -r 2de1b7c819a2a1083b86d0d16ac2c6cd182578cf templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -4,7 +4,7 @@
${h.css('base', 'jquery-ui/smoothness/jquery-ui')}
## skip new tool form code if disabled
-##%if util.string_as_bool(trans.app.config.get('toolform_upgrade', False)):
+%if util.string_as_bool(trans.app.config.get('toolform_upgrade', True)):
<%
## TEMPORARY: create tool dictionary in mako while both tool forms are in use.
## This avoids making two separate requests since the classic form requires the mako anyway.
@@ -26,9 +26,9 @@
});
</script><div id="tool-form-classic" style="display: none;">
-##%else:
-## <div id="tool-form-classic">
-##%endif
+%else:
+ <div id="tool-form-classic">
+%endif
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/base_panels.mako" import="overlay" />
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: Workflow: Insert conditional tool model creation
by commits-noreply@bitbucket.org 28 Jan '15
by commits-noreply@bitbucket.org 28 Jan '15
28 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/052c03f52326/
Changeset: 052c03f52326
User: guerler
Date: 2015-01-29 04:53:19+00:00
Summary: Workflow: Insert conditional tool model creation
Affected #: 1 file
diff -r c99e026b4b0a1a1f7ac5bf15e92859085c5bdab7 -r 052c03f52326a5755013a6b5e9d7ad746d4dd940 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -618,12 +618,18 @@
'tool_state': tool_state
} )
+ # create tool model and default tool state (if missing)
+ tool_model = None
+ if type == 'tool' and not tool_state:
+ tool_model = module.tool.to_json(trans, **incoming)
+ module.state.inputs = copy.deepcopy(tool_model['state_inputs'])
+
# update module state
module.update_state( incoming )
if type == 'tool':
return {
- 'tool_model': None,
+ 'tool_model': tool_model,
'tool_state': module.get_state(),
'data_inputs': module.get_data_inputs(),
'data_outputs': module.get_data_outputs(),
@@ -653,12 +659,15 @@
"""
trans.workflow_building_mode = True
module = module_factory.new( trans, type, **kwargs )
+ tool_model = None
+ if type == 'tool':
+ tool_model = module.tool.to_json(trans)
return {
'type': module.type,
'name': module.get_name(),
'tool_id': module.get_tool_id(),
'tool_state': module.get_state(),
- 'tool_model': None,
+ 'tool_model': tool_model,
'tooltip': module.get_tooltip( static_path=url_for( '/static' ) ),
'data_inputs': module.get_data_inputs(),
'data_outputs': module.get_data_outputs(),
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
[galaxyproject/usegalaxy-playbook] 252693: Disable options that were inexplicably preventing ...
by GitHub 28 Jan '15
by GitHub 28 Jan '15
28 Jan '15
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 25269362aad6d8dc13dd7e16c45d74f5747ae05e
https://github.com/galaxyproject/usegalaxy-playbook/commit/25269362aad6d8dc…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2015-01-28 (Wed, 28 Jan 2015)
Changed paths:
M production/group_vars/galaxyservers.yml
Log Message:
-----------
Disable options that were inexplicably preventing uWSGI from starting.
1
0