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 2014
- 1 participants
- 280 discussions
commit/galaxy-central: guerler: Upload: Fix tooltip text
by commits-noreply@bitbucket.org 19 Jan '14
by commits-noreply@bitbucket.org 19 Jan '14
19 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2118ad45b4d4/
Changeset: 2118ad45b4d4
User: guerler
Date: 2014-01-19 15:17:01
Summary: Upload: Fix tooltip text
Affected #: 2 files
diff -r 65777135cdee99be1682eb5422ded4a6d4e11756 -r 2118ad45b4d4e64422cb233206a06fa350913289 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -170,7 +170,7 @@
// create model
this.button_show = new ProgressButtonModel({
icon : 'fa-upload',
- tooltip : 'upload files',
+ tooltip : 'Upload files',
label : 'Upload',
onclick : function(e) {
if (e) {
diff -r 65777135cdee99be1682eb5422ded4a6d4e11756 -r 2118ad45b4d4e64422cb233206a06fa350913289 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(["galaxy.modal","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","mvc/ui","utils/uploadbox"],function(c,f,e,d){var b=Backbone.Model.extend({defaults:{percentage:0,icon:"fa-circle",label:"",status:""}});var a=Backbone.View.extend({model:null,initialize:function(h){var g=this;this.model=h;this.options=this.model.attributes;this.setElement(this._template(this.options));$(this.el).on("click",this.options.onclick);if(this.options.tooltip){$(this.el).tooltip({title:this.options.tooltip,placement:"bottom"})}this.model.on("change:percentage",function(){g._percentage(g.model.get("percentage"))});this.model.on("change:status",function(){g._status(g.model.get("status"))});var g=this;window.onbeforeunload=function(){var i="";if(g.options.onunload){i=g.options.onunload()}if(i!=""){return i}}},_status:function(h){var g=this.$el.find(".progress-bar");g.removeClass();g.addClass("progress-bar");g.addClass("progress-bar-notransition");if(h!=""){g.addClass("progress-bar-"+h)}},_percentage:function(h){var g=this.$el.find(".progress-bar");if(h){g.css({width:h+"%"})}else{g.css({width:"0%"})}},_template:function(g){return'<div class="progress-button"><div class="progress"><div class="progress-bar"></div></div><div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa '+g.icon+'"></div> '+g.label+"</div></div>"}});return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,upload_size:0,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new e.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(h){var g=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){g.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new b({icon:"fa-upload",tooltip:"upload files",label:"Upload",onclick:function(i){if(i){g._eventShow(i)}},onunload:function(){if(g.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new a(this.button_show)).$el);var g=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes",function(i){for(key in i){g.select_extension.push([i[key],i[key]])}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(i){var j=g.select_genome[0];g.select_genome=[];for(key in i){if(i[key].length>1){if(i[key][1]!==j[1]){g.select_genome.push(i[key])}}}g.select_genome.sort(function(l,k){return l[0]>k[0]?1:l[0]<k[0]?-1:0});g.select_genome.unshift(j)});if(h){this.options=_.defaults(h,this.options)}this.collection.on("remove",function(i){g._eventRemove(i)});this.collection.on("change:genome",function(j){var i=j.get("genome");g.collection.each(function(k){if(k.get("status")=="init"&&k.get("genome")=="?"){k.set("genome",i)}})})},_eventShow:function(h){h.preventDefault();if(!this.modal){var g=this;this.modal=new c.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){g.uploadbox.select()},Create:function(){g._eventCreate()},Upload:function(){g._eventStart()},Pause:function(){g._eventStop()},Reset:function(){g._eventReset()},Close:function(){g.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var g=this;this.uploadbox=this.$el.uploadbox({announce:function(i,j,k){g._eventAnnounce(i,j,k)},initialize:function(i,j,k){return g._eventInitialize(i,j,k)},progress:function(i,j,k){g._eventProgress(i,j,k)},success:function(i,j,k){g._eventSuccess(i,j,k)},error:function(i,j,k){g._eventError(i,j,k)},complete:function(){g._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(h){var g=h.get("status");if(g=="success"){this.counter.success--}else{if(g=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(h.id)},_eventAnnounce:function(g,h,j){this.counter.announce++;this._updateScreen();var i=new d(this,{id:g,file_name:h.name,file_size:h.size});this.collection.add(i.model);$(this.el).find("tbody:last").append(i.$el);i.render()},_eventInitialize:function(k,g,o){var i=this.collection.get(k);i.set("status","running");var h=i.get("extension");var l=i.get("file_name");var n=i.get("genome");var m=i.get("url_paste");var j=i.get("space_to_tabs");if(!m&&!(g.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=n;tool_input.file_type=h;tool_input["files_0|NAME"]=l;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=m;tool_input.space_to_tabs=j;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(h,i,g){var j=this.collection.get(h);j.set("percentage",g);this.button_show.set("percentage",this._upload_percentage(g,i.size))},_eventSuccess:function(h,i,k){var j=this.collection.get(h);j.set("status","success");var g=j.get("file_size");this.button_show.set("percentage",this._upload_percentage(100,g));this.upload_completed+=g*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(g,h,j){var i=this.collection.get(g);i.set("status","error");i.set("info",j);this.button_show.set("percentage",this._upload_percentage(100,h.size));this.button_show.set("status","danger");this.upload_completed+=h.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(g){if(g.get("status")=="queued"){g.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var g=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(h){if(h.get("status")=="init"){h.set("status","queued");g.upload_size+=h.get("file_size")}});this.button_show.set("percentage",0);this.button_show.set("status","success");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.button_show.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.button_show.set("percentage",0)}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_upload_percentage:function(g,h){return(this.upload_completed+(g*h))/this.upload_size},_template:function(h,g){return'<div id="'+h+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+g+'" class="upload-info"></h6>'}})});
\ No newline at end of file
+define(["galaxy.modal","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","mvc/ui","utils/uploadbox"],function(c,f,e,d){var b=Backbone.Model.extend({defaults:{percentage:0,icon:"fa-circle",label:"",status:""}});var a=Backbone.View.extend({model:null,initialize:function(h){var g=this;this.model=h;this.options=this.model.attributes;this.setElement(this._template(this.options));$(this.el).on("click",this.options.onclick);if(this.options.tooltip){$(this.el).tooltip({title:this.options.tooltip,placement:"bottom"})}this.model.on("change:percentage",function(){g._percentage(g.model.get("percentage"))});this.model.on("change:status",function(){g._status(g.model.get("status"))});var g=this;window.onbeforeunload=function(){var i="";if(g.options.onunload){i=g.options.onunload()}if(i!=""){return i}}},_status:function(h){var g=this.$el.find(".progress-bar");g.removeClass();g.addClass("progress-bar");g.addClass("progress-bar-notransition");if(h!=""){g.addClass("progress-bar-"+h)}},_percentage:function(h){var g=this.$el.find(".progress-bar");if(h){g.css({width:h+"%"})}else{g.css({width:"0%"})}},_template:function(g){return'<div class="progress-button"><div class="progress"><div class="progress-bar"></div></div><div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa '+g.icon+'"></div> '+g.label+"</div></div>"}});return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,upload_size:0,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new e.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(h){var g=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){g.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new b({icon:"fa-upload",tooltip:"Upload files",label:"Upload",onclick:function(i){if(i){g._eventShow(i)}},onunload:function(){if(g.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new a(this.button_show)).$el);var g=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes",function(i){for(key in i){g.select_extension.push([i[key],i[key]])}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(i){var j=g.select_genome[0];g.select_genome=[];for(key in i){if(i[key].length>1){if(i[key][1]!==j[1]){g.select_genome.push(i[key])}}}g.select_genome.sort(function(l,k){return l[0]>k[0]?1:l[0]<k[0]?-1:0});g.select_genome.unshift(j)});if(h){this.options=_.defaults(h,this.options)}this.collection.on("remove",function(i){g._eventRemove(i)});this.collection.on("change:genome",function(j){var i=j.get("genome");g.collection.each(function(k){if(k.get("status")=="init"&&k.get("genome")=="?"){k.set("genome",i)}})})},_eventShow:function(h){h.preventDefault();if(!this.modal){var g=this;this.modal=new c.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){g.uploadbox.select()},Create:function(){g._eventCreate()},Upload:function(){g._eventStart()},Pause:function(){g._eventStop()},Reset:function(){g._eventReset()},Close:function(){g.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var g=this;this.uploadbox=this.$el.uploadbox({announce:function(i,j,k){g._eventAnnounce(i,j,k)},initialize:function(i,j,k){return g._eventInitialize(i,j,k)},progress:function(i,j,k){g._eventProgress(i,j,k)},success:function(i,j,k){g._eventSuccess(i,j,k)},error:function(i,j,k){g._eventError(i,j,k)},complete:function(){g._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(h){var g=h.get("status");if(g=="success"){this.counter.success--}else{if(g=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(h.id)},_eventAnnounce:function(g,h,j){this.counter.announce++;this._updateScreen();var i=new d(this,{id:g,file_name:h.name,file_size:h.size});this.collection.add(i.model);$(this.el).find("tbody:last").append(i.$el);i.render()},_eventInitialize:function(k,g,o){var i=this.collection.get(k);i.set("status","running");var h=i.get("extension");var l=i.get("file_name");var n=i.get("genome");var m=i.get("url_paste");var j=i.get("space_to_tabs");if(!m&&!(g.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=n;tool_input.file_type=h;tool_input["files_0|NAME"]=l;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=m;tool_input.space_to_tabs=j;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(h,i,g){var j=this.collection.get(h);j.set("percentage",g);this.button_show.set("percentage",this._upload_percentage(g,i.size))},_eventSuccess:function(h,i,k){var j=this.collection.get(h);j.set("status","success");var g=j.get("file_size");this.button_show.set("percentage",this._upload_percentage(100,g));this.upload_completed+=g*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(g,h,j){var i=this.collection.get(g);i.set("status","error");i.set("info",j);this.button_show.set("percentage",this._upload_percentage(100,h.size));this.button_show.set("status","danger");this.upload_completed+=h.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(g){if(g.get("status")=="queued"){g.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var g=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(h){if(h.get("status")=="init"){h.set("status","queued");g.upload_size+=h.get("file_size")}});this.button_show.set("percentage",0);this.button_show.set("status","success");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.button_show.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.button_show.set("percentage",0)}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_upload_percentage:function(g,h){return(this.upload_completed+(g*h))/this.upload_size},_template:function(h,g){return'<div id="'+h+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+g+'" class="upload-info"></h6>'}})});
\ 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: Finalize Progress button, fix icon size
by commits-noreply@bitbucket.org 19 Jan '14
by commits-noreply@bitbucket.org 19 Jan '14
19 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/65777135cdee/
Changeset: 65777135cdee
User: guerler
Date: 2014-01-19 15:11:52
Summary: Upload: Finalize Progress button, fix icon size
Affected #: 7 files
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -12,6 +12,7 @@
status_classes : {
init : 'symbol fa fa-trash-o',
queued : 'symbol fa fa-spinner fa-spin',
+ running : 'symbol fa fa-spinner fa-spin',
success : 'symbol fa fa-check',
error : 'symbol fa fa-exclamation-triangle'
},
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -1,6 +1,5 @@
// dependencies
define(["galaxy.modal",
- "galaxy.masthead",
"utils/utils",
"mvc/upload/upload-model",
"mvc/upload/upload-row",
@@ -8,7 +7,6 @@
"utils/uploadbox"],
function( Modal,
- Masthead,
Utils,
UploadModel,
UploadItem
@@ -58,27 +56,45 @@
this.model.on('change:status', function() {
self._status(self.model.get('status'));
});
+
+ // unload event
+ var self = this;
+ window.onbeforeunload = function() {
+ var text = "";
+ if (self.options.onunload) {
+ text = self.options.onunload();
+ }
+ if (text != "")
+ return text;
+ };
},
// set status
_status: function(value) {
var $el = this.$el.find('.progress-bar');
+ $el.removeClass();
+ $el.addClass('progress-bar');
+ $el.addClass('progress-bar-notransition');
if (value != '') {
$el.addClass('progress-bar-' + value);
- } else {
- $el.removeClass();
- $el.addClass('progress-bar');
}
},
// set percentage
_percentage: function(value) {
- this.$el.find('.progress-bar').css({ width : value + '%' });
+ var $el = this.$el.find('.progress-bar');
+ if (value) {
+ // change to new percentage
+ $el.css({ width : value + '%' });
+ } else {
+ // reset without transition
+ $el.css({ width : '0%' });
+ }
},
// template
_template: function(options) {
- return '<div style="position: absolute; width: 100px; right: 10px; top: 7px; cursor: pointer;">' +
+ return '<div class="progress-button">' +
'<div class="progress">' +
'<div class="progress-bar"></div>' +
'</div>' +
@@ -154,7 +170,7 @@
// create model
this.button_show = new ProgressButtonModel({
icon : 'fa-upload',
- tooltip : 'Upload Files',
+ tooltip : 'upload files',
label : 'Upload',
onclick : function(e) {
if (e) {
@@ -162,8 +178,9 @@
}
},
onunload : function() {
- if (self.counter.running > 0)
+ if (self.counter.running > 0) {
return "Several uploads are still processing.";
+ }
}
});
@@ -336,7 +353,7 @@
var it = this.collection.get(index);
// update status
- it.set('state', 'running');
+ it.set('status', 'running');
// get configuration
var file_type = it.get('extension');
@@ -478,8 +495,8 @@
});
// reset progress
- this.button_show.set('progress', 0);
- this.button_show.set('status', '');
+ this.button_show.set('percentage', 0);
+ this.button_show.set('status', 'success');
// backup current history
this.current_history = Galaxy.currHistoryPanel.model.get('id');
@@ -498,7 +515,10 @@
if (this.counter.running == 0) {
return;
}
-
+
+ // show upload has paused
+ this.button_show.set('status', 'info');
+
// request pause
this.uploadbox.stop();
@@ -522,6 +542,9 @@
// remove from queue
this.uploadbox.reset();
+
+ // reset button
+ this.button_show.set('percentage', 0);
}
},
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 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(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h);b.model.set("file_size",g)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("change:genome",function(){b._refreshGenome()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshGenome:function(){var b=this.model.get("genome");this.$el.find("#genome").val(b)},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
+define(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",running:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h);b.model.set("file_size",g)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("change:genome",function(){b._refreshGenome()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshGenome:function(){var b=this.model.get("genome");this.$el.find("#genome").val(b)},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 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(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","mvc/ui","utils/uploadbox"],function(c,g,f,e,d){var b=Backbone.Model.extend({defaults:{percentage:0,icon:"fa-circle",label:"",status:""}});var a=Backbone.View.extend({model:null,initialize:function(i){var h=this;this.model=i;this.options=this.model.attributes;this.setElement(this._template(this.options));$(this.el).on("click",this.options.onclick);if(this.options.tooltip){$(this.el).tooltip({title:this.options.tooltip,placement:"bottom"})}this.model.on("change:percentage",function(){h._percentage(h.model.get("percentage"))});this.model.on("change:status",function(){h._status(h.model.get("status"))})},_status:function(i){var h=this.$el.find(".progress-bar");if(i!=""){h.addClass("progress-bar-"+i)}else{h.removeClass();h.addClass("progress-bar")}},_percentage:function(h){this.$el.find(".progress-bar").css({width:h+"%"})},_template:function(h){return'<div style="position: absolute; width: 100px; right: 10px; top: 7px; cursor: pointer;"><div class="progress"><div class="progress-bar"></div></div><div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa '+h.icon+'"></div> '+h.label+"</div></div>"}});return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,upload_size:0,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new e.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(i){var h=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){h.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new b({icon:"fa-upload",tooltip:"Upload Files",label:"Upload",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new a(this.button_show)).$el);var h=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes",function(j){for(key in j){h.select_extension.push([j[key],j[key]])}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(j){var k=h.select_genome[0];h.select_genome=[];for(key in j){if(j[key].length>1){if(j[key][1]!==k[1]){h.select_genome.push(j[key])}}}h.select_genome.sort(function(m,l){return m[0]>l[0]?1:m[0]<l[0]?-1:0});h.select_genome.unshift(k)});if(i){this.options=_.defaults(i,this.options)}this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(i){i.preventDefault();if(!this.modal){var h=this;this.modal=new c.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){h.uploadbox.select()},Create:function(){h._eventCreate()},Upload:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(j,k,l){h._eventAnnounce(j,k,l)},initialize:function(j,k,l){return h._eventInitialize(j,k,l)},progress:function(j,k,l){h._eventProgress(j,k,l)},success:function(j,k,l){h._eventSuccess(j,k,l)},error:function(j,k,l){h._eventError(j,k,l)},complete:function(){h._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new d(this,{id:h,file_name:i.name,file_size:i.size});this.collection.add(j.model);$(this.el).find("tbody:last").append(j.$el);j.render()},_eventInitialize:function(l,h,p){var j=this.collection.get(l);j.set("state","running");var i=j.get("extension");var m=j.get("file_name");var o=j.get("genome");var n=j.get("url_paste");var k=j.get("space_to_tabs");if(!n&&!(h.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=o;tool_input.file_type=i;tool_input["files_0|NAME"]=m;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=n;tool_input.space_to_tabs=k;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.button_show.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("status","success");var h=k.get("file_size");this.button_show.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("status","error");j.set("info",k);this.button_show.set("percentage",this._upload_percentage(100,i.size));this.button_show.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.button_show.set("progress",0);this.button_show.set("status","");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ No newline at end of file
+define(["galaxy.modal","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","mvc/ui","utils/uploadbox"],function(c,f,e,d){var b=Backbone.Model.extend({defaults:{percentage:0,icon:"fa-circle",label:"",status:""}});var a=Backbone.View.extend({model:null,initialize:function(h){var g=this;this.model=h;this.options=this.model.attributes;this.setElement(this._template(this.options));$(this.el).on("click",this.options.onclick);if(this.options.tooltip){$(this.el).tooltip({title:this.options.tooltip,placement:"bottom"})}this.model.on("change:percentage",function(){g._percentage(g.model.get("percentage"))});this.model.on("change:status",function(){g._status(g.model.get("status"))});var g=this;window.onbeforeunload=function(){var i="";if(g.options.onunload){i=g.options.onunload()}if(i!=""){return i}}},_status:function(h){var g=this.$el.find(".progress-bar");g.removeClass();g.addClass("progress-bar");g.addClass("progress-bar-notransition");if(h!=""){g.addClass("progress-bar-"+h)}},_percentage:function(h){var g=this.$el.find(".progress-bar");if(h){g.css({width:h+"%"})}else{g.css({width:"0%"})}},_template:function(g){return'<div class="progress-button"><div class="progress"><div class="progress-bar"></div></div><div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa '+g.icon+'"></div> '+g.label+"</div></div>"}});return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,upload_size:0,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new e.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(h){var g=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){g.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new b({icon:"fa-upload",tooltip:"upload files",label:"Upload",onclick:function(i){if(i){g._eventShow(i)}},onunload:function(){if(g.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new a(this.button_show)).$el);var g=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes",function(i){for(key in i){g.select_extension.push([i[key],i[key]])}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(i){var j=g.select_genome[0];g.select_genome=[];for(key in i){if(i[key].length>1){if(i[key][1]!==j[1]){g.select_genome.push(i[key])}}}g.select_genome.sort(function(l,k){return l[0]>k[0]?1:l[0]<k[0]?-1:0});g.select_genome.unshift(j)});if(h){this.options=_.defaults(h,this.options)}this.collection.on("remove",function(i){g._eventRemove(i)});this.collection.on("change:genome",function(j){var i=j.get("genome");g.collection.each(function(k){if(k.get("status")=="init"&&k.get("genome")=="?"){k.set("genome",i)}})})},_eventShow:function(h){h.preventDefault();if(!this.modal){var g=this;this.modal=new c.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){g.uploadbox.select()},Create:function(){g._eventCreate()},Upload:function(){g._eventStart()},Pause:function(){g._eventStop()},Reset:function(){g._eventReset()},Close:function(){g.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var g=this;this.uploadbox=this.$el.uploadbox({announce:function(i,j,k){g._eventAnnounce(i,j,k)},initialize:function(i,j,k){return g._eventInitialize(i,j,k)},progress:function(i,j,k){g._eventProgress(i,j,k)},success:function(i,j,k){g._eventSuccess(i,j,k)},error:function(i,j,k){g._eventError(i,j,k)},complete:function(){g._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(h){var g=h.get("status");if(g=="success"){this.counter.success--}else{if(g=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(h.id)},_eventAnnounce:function(g,h,j){this.counter.announce++;this._updateScreen();var i=new d(this,{id:g,file_name:h.name,file_size:h.size});this.collection.add(i.model);$(this.el).find("tbody:last").append(i.$el);i.render()},_eventInitialize:function(k,g,o){var i=this.collection.get(k);i.set("status","running");var h=i.get("extension");var l=i.get("file_name");var n=i.get("genome");var m=i.get("url_paste");var j=i.get("space_to_tabs");if(!m&&!(g.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=n;tool_input.file_type=h;tool_input["files_0|NAME"]=l;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=m;tool_input.space_to_tabs=j;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(h,i,g){var j=this.collection.get(h);j.set("percentage",g);this.button_show.set("percentage",this._upload_percentage(g,i.size))},_eventSuccess:function(h,i,k){var j=this.collection.get(h);j.set("status","success");var g=j.get("file_size");this.button_show.set("percentage",this._upload_percentage(100,g));this.upload_completed+=g*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(g,h,j){var i=this.collection.get(g);i.set("status","error");i.set("info",j);this.button_show.set("percentage",this._upload_percentage(100,h.size));this.button_show.set("status","danger");this.upload_completed+=h.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(g){if(g.get("status")=="queued"){g.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var g=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(h){if(h.get("status")=="init"){h.set("status","queued");g.upload_size+=h.get("file_size")}});this.button_show.set("percentage",0);this.button_show.set("status","success");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.button_show.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.button_show.set("percentage",0)}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_upload_percentage:function(g,h){return(this.upload_completed+(g*h))/this.upload_size},_template:function(h,g){return'<div id="'+h+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+g+'" class="upload-info"></h6>'}})});
\ No newline at end of file
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1250,6 +1250,10 @@
.galaxy-frame .frame .f-close{right:5px;top:3px}
.galaxy-frame .frame .f-pin{left:6px;top:3px}
.galaxy-frame .frame .f-resize{background:#fff;width:16px;height:16px;color:#2c3143;right:0px;bottom:0px;text-align:center;line-height:16px;border:0px}
+.progress-button{position:absolute;width:100px;right:10px;top:6px;cursor:pointer;height:19px;border:1px solid #aaa;-moz-border-radius:3px;border-radius:3px}.progress-button .progress-bar-danger{background:#f9c7c5}
+.progress-button .progress-bar-success{background:#aff1af;border:0px}
+.progress-button .progress-bar-info{background:#ffc}
+.progress-button .progress-bar-notransition{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}
.upload-info{font-weight:normal;text-align:center}
.upload-box{width:100%;height:95%;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}
@@ -1262,7 +1266,7 @@
.upload-box .size{width:60px;white-space:nowrap}
.upload-box .info{width:130px;font-size:11px}.upload-box .info .progress{top:1px;position:relative;width:100%;padding:0px;margin:0px}.upload-box .info .progress .progress-bar{border-radius:inherit;-moz-border-radius:inherit}
.upload-box .info .progress .percentage{position:absolute;text-align:center;width:100%;color:#fff}
-.upload-box .symbol{cursor:pointer}
+.upload-box .symbol{font-size:1.2em;cursor:pointer}
.libraryRow{background-color:#ebd9b2}
.datasetHighlighted{background-color:#f9f9f9}
.libraryItemDeleted-True{font-style:italic}
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 static/style/src/less/upload.less
--- a/static/style/src/less/upload.less
+++ b/static/style/src/less/upload.less
@@ -1,3 +1,37 @@
+.progress-button {
+ position: absolute;
+ width: 100px;
+ right: 10px;
+ top: 6px;
+ cursor: pointer;
+ height: 19px;
+ border: 1px solid @input-border;
+ -moz-border-radius: @border-radius-base;
+ border-radius: @border-radius-base;
+
+ .progress-bar-danger {
+ background: @state-danger-bg;
+ }
+
+ .progress-bar-success {
+ background: @state-success-bg;
+
+ border : 0px;
+ }
+
+ .progress-bar-info {
+ background: @state-running-bg;
+ }
+
+ .progress-bar-notransition {
+ -webkit-transition: none;
+ -moz-transition: none;
+ -ms-transition: none;
+ -o-transition: none;
+ transition: none;
+ }
+}
+
.upload-info
{
font-weight: normal;
@@ -99,6 +133,7 @@
}
.symbol {
+ font-size: 1.2em;
cursor: pointer;
}
}
\ No newline at end of file
diff -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 -r 65777135cdee99be1682eb5422ded4a6d4e11756 templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -102,7 +102,7 @@
});
## add upload plugin
- ##Galaxy.upload = new GalaxyUpload(masthead_config);
+ Galaxy.upload = new GalaxyUpload(masthead_config);
## set up the quota meter (And fetch the current user data from trans)
## add quota meter to masthead
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dffb40cd221d/
Changeset: dffb40cd221d
User: greg
Date: 2014-01-18 21:46:36
Summary: Debug fix.
Affected #: 1 file
diff -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 -r dffb40cd221d8531f8f131944e60f35ff0ce7e03 test/install_and_test_tool_shed_repositories/base/util.py
--- a/test/install_and_test_tool_shed_repositories/base/util.py
+++ b/test/install_and_test_tool_shed_repositories/base/util.py
@@ -1002,7 +1002,7 @@
params[ 'time_last_tested' ] = 'This entry will result in this value being set via the Tool Shed API.'
url = '%s' % ( suc.url_join( galaxy_tool_shed_url,'api', 'repository_revisions', str( metadata_revision_id ) ) )
log.debug( 'url: %s' % str( url ) )
- log.degug( 'params: %s' % str( params ) )
+ log.debug( 'params: %s' % str( params ) )
try:
return update( tool_shed_api_key, url, params, return_formatted=False )
except Exception, e:
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: Introduce progress button
by commits-noreply@bitbucket.org 18 Jan '14
by commits-noreply@bitbucket.org 18 Jan '14
18 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4a926eff735e/
Changeset: 4a926eff735e
User: guerler
Date: 2014-01-18 20:48:10
Summary: Upload: Introduce progress button
Affected #: 8 files
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -58,6 +58,7 @@
// update url paste content
self.model.set('url_paste', value);
+ self.model.set('file_size', count);
});
// handle genome selection
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -4,15 +4,89 @@
"utils/utils",
"mvc/upload/upload-model",
"mvc/upload/upload-row",
+ "mvc/ui",
"utils/uploadbox"],
- function( mod_modal,
- mod_masthead,
- mod_utils,
+ function( Modal,
+ Masthead,
+ Utils,
UploadModel,
UploadItem
) {
+// create model
+var ProgressButtonModel = Backbone.Model.extend({
+ defaults: {
+ percentage : 0,
+ icon : 'fa-circle',
+ label : '',
+ status : ''
+ }
+});
+
+// progress bar button on ui
+var ProgressButton = Backbone.View.extend({
+ // model
+ model : null,
+
+ // initialize
+ initialize : function(model) {
+ // link this
+ var self = this;
+
+ // create model
+ this.model = model;
+
+ // get options
+ this.options = this.model.attributes;
+
+ // create new element
+ this.setElement(this._template(this.options));
+
+ // add event
+ $(this.el).on('click', this.options.onclick);
+
+ // add tooltip
+ if (this.options.tooltip) {
+ $(this.el).tooltip({title: this.options.tooltip, placement: 'bottom'});
+ }
+
+ // events
+ this.model.on('change:percentage', function() {
+ self._percentage(self.model.get('percentage'));
+ });
+ this.model.on('change:status', function() {
+ self._status(self.model.get('status'));
+ });
+ },
+
+ // set status
+ _status: function(value) {
+ var $el = this.$el.find('.progress-bar');
+ if (value != '') {
+ $el.addClass('progress-bar-' + value);
+ } else {
+ $el.removeClass();
+ $el.addClass('progress-bar');
+ }
+ },
+
+ // set percentage
+ _percentage: function(value) {
+ this.$el.find('.progress-bar').css({ width : value + '%' });
+ },
+
+ // template
+ _template: function(options) {
+ return '<div style="position: absolute; width: 100px; right: 10px; top: 7px; cursor: pointer;">' +
+ '<div class="progress">' +
+ '<div class="progress-bar"></div>' +
+ '</div>' +
+ '<div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa ' + options.icon + '"></div> ' + options.label + '</div>' +
+ '</div>';
+ }
+});
+
// galaxy upload
return Backbone.View.extend(
{
@@ -28,6 +102,9 @@
// current history
current_history: null,
+ // current upload size
+ upload_size: 0,
+
// extension types
select_extension :[['Auto-detect', 'auto']],
@@ -74,32 +151,35 @@
if (!Galaxy.currUser.get('id'))
return;
- // add activate icon
- this.button_show = new mod_masthead.GalaxyMastheadIcon (
- {
- icon : 'fa-arrow-circle-o-up',
+ // create model
+ this.button_show = new ProgressButtonModel({
+ icon : 'fa-upload',
tooltip : 'Upload Files',
- on_click : function(e) { self._eventShow(e) },
- on_unload : function() {
+ label : 'Upload',
+ onclick : function(e) {
+ if (e) {
+ self._eventShow(e)
+ }
+ },
+ onunload : function() {
if (self.counter.running > 0)
return "Several uploads are still processing.";
- },
- with_number : true
+ }
});
- // add to masthead
- Galaxy.masthead.prepend(this.button_show);
+ // define location
+ $('#left .unified-panel-header-inner').append((new ProgressButton(this.button_show)).$el);
// load extension
var self = this;
- mod_utils.jsonFromUrl(galaxy_config.root + "api/datatypes",
+ Utils.jsonFromUrl(galaxy_config.root + "api/datatypes",
function(datatypes) {
for (key in datatypes)
self.select_extension.push([datatypes[key], datatypes[key]]);
});
// load genomes
- mod_utils.jsonFromUrl(galaxy_config.root + "api/genomes",
+ Utils.jsonFromUrl(galaxy_config.root + "api/genomes",
function(genomes) {
// backup default
var def = self.select_genome[0];
@@ -154,7 +234,7 @@
{
// make modal
var self = this;
- this.modal = new mod_modal.GalaxyModal(
+ this.modal = new Modal.GalaxyModal(
{
title : 'Upload files from your local drive',
body : this._template('upload-box', 'upload-info'),
@@ -257,9 +337,6 @@
// update status
it.set('state', 'running');
-
- // update on screen counter
- this.button_show.number(this.counter.announce);
// get configuration
var file_type = it.get('extension');
@@ -297,8 +374,12 @@
// progress
_eventProgress : function(index, file, percentage)
{
+ // set progress for row
var it = this.collection.get(index);
it.set('percentage', percentage);
+
+ // update ui button
+ this.button_show.set('percentage', this._upload_percentage(percentage, file.size));
},
// success
@@ -308,8 +389,14 @@
var it = this.collection.get(index);
it.set('status', 'success');
- // update on screen counter
- this.button_show.number('');
+ // file size
+ var file_size = it.get('file_size');
+
+ // update ui button
+ this.button_show.set('percentage', this._upload_percentage(100, file_size));
+
+ // update completed
+ this.upload_completed += file_size * 100;
// update counter
this.counter.announce--;
@@ -332,8 +419,12 @@
it.set('status', 'error');
it.set('info', message);
- // update on screen counter
- this.button_show.number('');
+ // update ui button
+ this.button_show.set('percentage', this._upload_percentage(100, file.size));
+ this.button_show.set('status', 'danger');
+
+ // update completed
+ this.upload_completed += file.size * 100;
// update counter
this.counter.announce--;
@@ -373,14 +464,23 @@
if (this.counter.announce == 0 || this.counter.running > 0) {
return;
}
-
+
+ // reset current size
+ var self = this;
+ this.upload_size = 0;
+ this.upload_completed = 0;
// switch icons for new uploads
this.collection.each(function(item) {
if(item.get('status') == 'init') {
item.set('status', 'queued');
+ self.upload_size += item.get('file_size');
}
});
+ // reset progress
+ this.button_show.set('progress', 0);
+ this.button_show.set('status', '');
+
// backup current history
this.current_history = Galaxy.currHistoryPanel.model.get('id');
@@ -398,7 +498,7 @@
if (this.counter.running == 0) {
return;
}
-
+
// request pause
this.uploadbox.stop();
@@ -488,6 +588,11 @@
$(this.el).find('table').hide();
},
+ // calculate percentage of all queued uploads
+ _upload_percentage: function(percentage, size) {
+ return (this.upload_completed + (percentage * size)) / this.upload_size;
+ },
+
// load html template
_template: function(id, idInfo)
{
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 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(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("change:genome",function(){b._refreshGenome()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshGenome:function(){var b=this.model.get("genome");this.$el.find("#genome").val(b)},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
+define(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h);b.model.set("file_size",g)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("change:genome",function(){b._refreshGenome()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshGenome:function(){var b=this.model.get("genome");this.$el.find("#genome").val(b)},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 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(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","utils/uploadbox"],function(a,d,e,c,b){return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new c.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(g){var f=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){f.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new d.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(h){f._eventShow(h)},on_unload:function(){if(f.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var f=this;e.jsonFromUrl(galaxy_config.root+"api/datatypes",function(h){for(key in h){f.select_extension.push([h[key],h[key]])}});e.jsonFromUrl(galaxy_config.root+"api/genomes",function(h){var i=f.select_genome[0];f.select_genome=[];for(key in h){if(h[key].length>1){if(h[key][1]!==i[1]){f.select_genome.push(h[key])}}}f.select_genome.sort(function(k,j){return k[0]>j[0]?1:k[0]<j[0]?-1:0});f.select_genome.unshift(i)});if(g){this.options=_.defaults(g,this.options)}this.collection.on("remove",function(h){f._eventRemove(h)});this.collection.on("change:genome",function(i){var h=i.get("genome");f.collection.each(function(j){if(j.get("status")=="init"&&j.get("genome")=="?"){j.set("genome",h)}})})},_eventShow:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new a.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f._eventCreate()},Upload:function(){f._eventStart()},Pause:function(){f._eventStop()},Reset:function(){f._eventReset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({announce:function(h,i,j){f._eventAnnounce(h,i,j)},initialize:function(h,i,j){return f._eventInitialize(h,i,j)},progress:function(h,i,j){f._eventProgress(h,i,j)},success:function(h,i,j){f._eventSuccess(h,i,j)},error:function(h,i,j){f._eventError(h,i,j)},complete:function(){f._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(g){var f=g.get("status");if(f=="success"){this.counter.success--}else{if(f=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(g.id)},_eventAnnounce:function(f,g,i){this.counter.announce++;this._updateScreen();var h=new b(this,{id:f,file_name:g.name,file_size:g.size});this.collection.add(h.model);$(this.el).find("tbody:last").append(h.$el);h.render()},_eventInitialize:function(j,f,n){var h=this.collection.get(j);h.set("state","running");this.button_show.number(this.counter.announce);var g=h.get("extension");var k=h.get("file_name");var m=h.get("genome");var l=h.get("url_paste");var i=h.get("space_to_tabs");if(!l&&!(f.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=g;tool_input["files_0|NAME"]=k;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(g,h,f){var i=this.collection.get(g);i.set("percentage",f)},_eventSuccess:function(f,g,i){var h=this.collection.get(f);h.set("status","success");this.button_show.number("");this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(f,g,i){var h=this.collection.get(f);h.set("status","error");h.set("info",i);this.button_show.number("");this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(f){if(f.get("status")=="queued"){f.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}this.collection.each(function(f){if(f.get("status")=="init"){f.set("status","queued")}});this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_template:function(g,f){return'<div id="'+g+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+f+'" class="upload-info"></h6>'}})});
\ No newline at end of file
+define(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","mvc/ui","utils/uploadbox"],function(c,g,f,e,d){var b=Backbone.Model.extend({defaults:{percentage:0,icon:"fa-circle",label:"",status:""}});var a=Backbone.View.extend({model:null,initialize:function(i){var h=this;this.model=i;this.options=this.model.attributes;this.setElement(this._template(this.options));$(this.el).on("click",this.options.onclick);if(this.options.tooltip){$(this.el).tooltip({title:this.options.tooltip,placement:"bottom"})}this.model.on("change:percentage",function(){h._percentage(h.model.get("percentage"))});this.model.on("change:status",function(){h._status(h.model.get("status"))})},_status:function(i){var h=this.$el.find(".progress-bar");if(i!=""){h.addClass("progress-bar-"+i)}else{h.removeClass();h.addClass("progress-bar")}},_percentage:function(h){this.$el.find(".progress-bar").css({width:h+"%"})},_template:function(h){return'<div style="position: absolute; width: 100px; right: 10px; top: 7px; cursor: pointer;"><div class="progress"><div class="progress-bar"></div></div><div id="label" class="label" style="position: absolute; top: 0px; width: inherit; text-align: center;"><div class="fa '+h.icon+'"></div> '+h.label+"</div></div>"}});return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,upload_size:0,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new e.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(i){var h=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){h.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new b({icon:"fa-upload",tooltip:"Upload Files",label:"Upload",onclick:function(j){if(j){h._eventShow(j)}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$("#left .unified-panel-header-inner").append((new a(this.button_show)).$el);var h=this;f.jsonFromUrl(galaxy_config.root+"api/datatypes",function(j){for(key in j){h.select_extension.push([j[key],j[key]])}});f.jsonFromUrl(galaxy_config.root+"api/genomes",function(j){var k=h.select_genome[0];h.select_genome=[];for(key in j){if(j[key].length>1){if(j[key][1]!==k[1]){h.select_genome.push(j[key])}}}h.select_genome.sort(function(m,l){return m[0]>l[0]?1:m[0]<l[0]?-1:0});h.select_genome.unshift(k)});if(i){this.options=_.defaults(i,this.options)}this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},_eventShow:function(i){i.preventDefault();if(!this.modal){var h=this;this.modal=new c.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){h.uploadbox.select()},Create:function(){h._eventCreate()},Upload:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(j,k,l){h._eventAnnounce(j,k,l)},initialize:function(j,k,l){return h._eventInitialize(j,k,l)},progress:function(j,k,l){h._eventProgress(j,k,l)},success:function(j,k,l){h._eventSuccess(j,k,l)},error:function(j,k,l){h._eventError(j,k,l)},complete:function(){h._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new d(this,{id:h,file_name:i.name,file_size:i.size});this.collection.add(j.model);$(this.el).find("tbody:last").append(j.$el);j.render()},_eventInitialize:function(l,h,p){var j=this.collection.get(l);j.set("state","running");var i=j.get("extension");var m=j.get("file_name");var o=j.get("genome");var n=j.get("url_paste");var k=j.get("space_to_tabs");if(!n&&!(h.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=o;tool_input.file_type=i;tool_input["files_0|NAME"]=m;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=n;tool_input.space_to_tabs=k;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.button_show.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("status","success");var h=k.get("file_size");this.button_show.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("status","error");j.set("info",k);this.button_show.set("percentage",this._upload_percentage(100,i.size));this.button_show.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.get("file_size")}});this.button_show.set("progress",0);this.button_show.set("status","");this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_upload_percentage:function(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ No newline at end of file
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/packed/utils/utils.js
--- a/static/scripts/packed/utils/utils.js
+++ b/static/scripts/packed/utils/utils.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(c){function d(g,f,e){var h=new XMLHttpRequest();h.open("GET",g,true);h.setRequestHeader("Accept","application/json");h.setRequestHeader("Cache-Control","no-cache");h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.onloadend=function(){var i=h.status;if(i==200){try{response=jQuery.parseJSON(h.responseText)}catch(j){response=h.responseText}f&&f(response)}else{e&&e(i)}};h.send()}function b(h,e){var f=$('<div class="'+h+'"></div>');f.appendTo(":eq(0)");var g=f.css(e);f.remove();return g}function a(e){if(!$('link[href^="'+e+'"]').length){$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:d}});
\ No newline at end of file
+define(["libs/underscore"],function(c){function d(h,g,f){var i=new XMLHttpRequest();i.open("GET",h,true);i.setRequestHeader("Accept","application/json");i.setRequestHeader("Cache-Control","no-cache");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.onloadend=function(){var j=i.status;if(j==200){try{response=jQuery.parseJSON(i.responseText)}catch(k){response=i.responseText}g&&g(response)}else{f&&f(j)}};i.send()}function b(i,f){var g=$('<div class="'+i+'"></div>');g.appendTo(":eq(0)");var h=g.css(f);g.remove();return h}function a(f){if(!$('link[href^="'+f+'"]').length){$('<link href="'+galaxy_config.root+f+'" rel="stylesheet">').appendTo("head")}}function e(f,g){if(f){return c.defaults(f,g)}else{return g}}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:d,merge:e}});
\ No newline at end of file
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/packed/viz/trackster.js
--- a/static/scripts/packed/viz/trackster.js
+++ b/static/scripts/packed/viz/trackster.js
@@ -1,1 +1,1 @@
-var ui=null;var view=null;var browser_router=null;require(["utils/galaxy.utils","libs/jquery/jstorage","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/select2","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating","mvc/ui"],function(a){a.cssLoadFile("static/style/jquery.rating.css");a.cssLoadFile("static/style/autocomplete_tagging.css");a.cssLoadFile("static/style/jquery-ui/smoothness/jquery-ui.css");a.cssLoadFile("static/style/library.css");a.cssLoadFile("static/style/trackster.css")});define(["libs/backbone/backbone","viz/visualization","viz/trackster_ui"],function(c,a,b){var d=Backbone.View.extend({initialize:function(){ui=new b.TracksterUI(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},set_up_router:function(e){browser_router=new a.TrackBrowserRouter(e);Backbone.history.start()},view_existing:function(){var e=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:e.title,vis_id:e.vis_id,dbkey:e.dbkey},e.viewport,e.tracks,e.bookmarks,true);this.init_editor()},view_new:function(){var e=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(f){Galaxy.modal.show({title:"New Visualization",body:e.template_view_new(f),buttons:{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){e.create_browser($("#new-title").val(),$("#new-dbkey").val());Galaxy.modal.hide()}}});if(galaxy_config.app.default_dbkey){$("#new-dbkey").val(galaxy_config.app.default_dbkey)}$("#new-title").focus();$("select[name='dbkey']").select2();$("#overlay").css("overflow","auto")}})},template_view_new:function(e){var g='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var f=0;f<e.length;f++){g+='<option value="'+e[f][1]+'">'+e[f][0]+"</option>"}g+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return g},create_browser:function(f,e){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:f,dbkey:e},galaxy_config.app.gene_region);this.init_editor();view.editor=true},init_editor:function(){$("#center .unified-panel-title").text(view.prefs.name+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(e){view.add_drawable(b.object_from_template(e,view,view))}})}$("#add-bookmark-button").click(function(){var f=view.chrom+":"+view.low+"-"+view.high,e="Bookmark description";return ui.add_bookmark(f,e,true)});ui.init_keyboard_nav(view);this.set_up_router({view:view})}});return{GalaxyApp:d}});
\ No newline at end of file
+var ui=null;var view=null;var browser_router=null;require(["utils/utils","libs/jquery/jstorage","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/select2","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating","mvc/ui"],function(a){a.cssLoadFile("static/style/jquery.rating.css");a.cssLoadFile("static/style/autocomplete_tagging.css");a.cssLoadFile("static/style/jquery-ui/smoothness/jquery-ui.css");a.cssLoadFile("static/style/library.css");a.cssLoadFile("static/style/trackster.css")});define(["libs/backbone/backbone","viz/visualization","viz/trackster_ui"],function(c,a,b){var d=Backbone.View.extend({initialize:function(){ui=new b.TracksterUI(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},set_up_router:function(e){browser_router=new a.TrackBrowserRouter(e);Backbone.history.start()},view_existing:function(){var e=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:e.title,vis_id:e.vis_id,dbkey:e.dbkey},e.viewport,e.tracks,e.bookmarks,true);this.init_editor()},view_new:function(){var e=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(f){Galaxy.modal.show({title:"New Visualization",body:e.template_view_new(f),buttons:{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){e.create_browser($("#new-title").val(),$("#new-dbkey").val());Galaxy.modal.hide()}}});if(galaxy_config.app.default_dbkey){$("#new-dbkey").val(galaxy_config.app.default_dbkey)}$("#new-title").focus();$("select[name='dbkey']").select2();$("#overlay").css("overflow","auto")}})},template_view_new:function(e){var g='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var f=0;f<e.length;f++){g+='<option value="'+e[f][1]+'">'+e[f][0]+"</option>"}g+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return g},create_browser:function(f,e){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:f,dbkey:e},galaxy_config.app.gene_region);this.init_editor();view.editor=true},init_editor:function(){$("#center .unified-panel-title").text(view.prefs.name+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(e){view.add_drawable(b.object_from_template(e,view,view))}})}$("#add-bookmark-button").click(function(){var f=view.chrom+":"+view.low+"-"+view.high,e="Bookmark description";return ui.add_bookmark(f,e,true)});ui.init_keyboard_nav(view);this.set_up_router({view:view})}});return{GalaxyApp:d}});
\ No newline at end of file
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/utils/utils.js
--- a/static/scripts/utils/utils.js
+++ b/static/scripts/utils/utils.js
@@ -63,11 +63,20 @@
$('<link href="' + galaxy_config.root + url + '" rel="stylesheet">').appendTo('head');
};
+// merge
+function merge (options, optionsDefault) {
+ if (options)
+ return _.defaults(options, optionsDefault);
+ else
+ return optionsDefault;
+};
+
// return
return {
cssLoadFile : cssLoadFile,
cssGetAttribute : cssGetAttribute,
- jsonFromUrl : jsonFromUrl
+ jsonFromUrl : jsonFromUrl,
+ merge : merge
};
});
diff -r bb5ee4189ada638491879e082d7c226bba332575 -r 4a926eff735eef13634c76c258f8a82dd17e3ea4 static/scripts/viz/trackster.js
--- a/static/scripts/viz/trackster.js
+++ b/static/scripts/viz/trackster.js
@@ -7,7 +7,7 @@
require(
[
// load js libraries
- 'utils/galaxy.utils',
+ 'utils/utils',
'libs/jquery/jstorage',
'libs/jquery/jquery.event.drag',
'libs/jquery/jquery.event.hover',
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: greg: Improved logging in the tool shed's install and test framework.
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bb5ee4189ada/
Changeset: bb5ee4189ada
User: greg
Date: 2014-01-18 02:31:47
Summary: Improved logging in the tool shed's install and test framework.
Affected #: 1 file
diff -r 05b319445babb357d57f0a00968d78a2812ef555 -r bb5ee4189ada638491879e082d7c226bba332575 test/install_and_test_tool_shed_repositories/base/util.py
--- a/test/install_and_test_tool_shed_repositories/base/util.py
+++ b/test/install_and_test_tool_shed_repositories/base/util.py
@@ -1001,6 +1001,8 @@
# Set the time_last_tested entry so that the repository_metadata.time_last_tested will be set in the tool shed.
params[ 'time_last_tested' ] = 'This entry will result in this value being set via the Tool Shed API.'
url = '%s' % ( suc.url_join( galaxy_tool_shed_url,'api', 'repository_revisions', str( metadata_revision_id ) ) )
+ log.debug( 'url: %s' % str( url ) )
+ log.degug( 'params: %s' % str( params ) )
try:
return update( tool_shed_api_key, url, params, return_formatted=False )
except Exception, e:
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: DataViewer: Remove console output
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/05b319445bab/
Changeset: 05b319445bab
User: guerler
Date: 2014-01-18 00:17:35
Summary: DataViewer: Remove console output
Affected #: 2 files
diff -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 -r 05b319445babb357d57f0a00968d78a2812ef555 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -304,27 +304,28 @@
}
// check
- if(this.col.chrom === null)
- {
- console.log("TabularButtonTrackster : Chromosome column undefined.");
+ if(this.col.chrom === null) {
return;
}
// get dataset id
- if (typeof options.model.attributes.id === "undefined")
+ if (typeof options.model.attributes.id === "undefined") {
console.log("TabularButtonTrackster : Dataset identification is missing.");
- else
+ } else {
this.dataset_id = options.model.attributes.id;
+ }
// get url
- if (typeof options.model.attributes.url_viz === "undefined")
+ if (typeof options.model.attributes.url_viz === "undefined") {
console.log("TabularButtonTrackster : Url for visualization controller is missing.");
- else
+ } else {
this.url_viz = options.model.attributes.url_viz;
+ }
// get genome_build / database key
- if (typeof options.model.attributes.genome_build !== "undefined")
+ if (typeof options.model.attributes.genome_build !== "undefined") {
this.genome_build = options.model.attributes.genome_build;
+ }
// render the icon from template
var btn_viz = new IconButtonView({ model : new IconButton({
diff -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 -r 05b319445babb357d57f0a00968d78a2812ef555 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define([],function(){var d=Backbone.Model.extend({});var e=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_config.root+"api/datasets"});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){new b(i)},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(l,i,m){var j=$("<td>").text(l);var k=this.model.get_metadata("column_types");if(m!==undefined){j.attr("colspan",m).addClass("stringalign")}else{if(k){if(i<k.length){if(k[i]==="str"||k==="list"){j.addClass("stringalign")}}}}return j},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(k){var j=k.model.attributes;var m=k.model.attributes.metadata.attributes;if(typeof j.data_type!=="undefined"){this.data_type=j.data_type}else{console.log("TabularButtonTrackster : Data type missing.")}if(this.data_type=="bed"){if(typeof m.chromCol!=="undefined"||typeof m.startCol!=="undefined"||typeof m.endCol!=="undefined"){this.col.chrom=m.chromCol-1;this.col.start=m.startCol-1;this.col.end=m.endCol-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.")}}if(this.data_type=="vcf"){function l(o,p){for(var n=0;n<p.length;n++){if(p[n].match(o)){return n}}return -1}this.col.chrom=l("Chrom",m.column_names);this.col.start=l("Pos",m.column_names);this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.")}}if(this.col.chrom===null){console.log("TabularButtonTrackster : Chromosome column undefined.");return}if(typeof k.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=k.model.attributes.id}if(typeof k.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=k.model.attributes.url_viz}if(typeof k.model.attributes.genome_build!=="undefined"){this.genome_build=k.model.attributes.genome_build}var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(n){function m(s){return !isNaN(parseFloat(s))&&isFinite(s)}if(this.col.chrom===null){return}var r=$(n.target).parent();var o=r.children().eq(this.col.chrom).html();var i=r.children().eq(this.col.start).html();var k=this.col.end?r.children().eq(this.col.end).html():i;if(!o.match("^#")&&o!==""&&m(i)){var q={dataset_id:this.dataset_id,gene_region:o+":"+i+"-"+k};var l=r.offset();var j=l.left-10;var p=l.top-$(window).scrollTop();$("#btn_viz").css({position:"fixed",top:p+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,q,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.Galaxy.modal.hide()},"View in saved visualization":function(){n.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:m,buttons:{Cancel:function(){n.Galaxy.modal.hide()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){n.Galaxy.modal.hide();var o=$(this).val();k.id=o;n.Galaxy.frame.add({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)})})}}})},"View in new visualization":function(){n.Galaxy.modal.hide();var o=i+"/trackster?"+$.param(k);n.Galaxy.frame.add({title:"Trackster",type:"url",content:o})}}})}});return false}}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ No newline at end of file
+define([],function(){var d=Backbone.Model.extend({});var e=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_config.root+"api/datasets"});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){new b(i)},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(l,i,m){var j=$("<td>").text(l);var k=this.model.get_metadata("column_types");if(m!==undefined){j.attr("colspan",m).addClass("stringalign")}else{if(k){if(i<k.length){if(k[i]==="str"||k==="list"){j.addClass("stringalign")}}}}return j},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(k){var j=k.model.attributes;var m=k.model.attributes.metadata.attributes;if(typeof j.data_type!=="undefined"){this.data_type=j.data_type}else{console.log("TabularButtonTrackster : Data type missing.")}if(this.data_type=="bed"){if(typeof m.chromCol!=="undefined"||typeof m.startCol!=="undefined"||typeof m.endCol!=="undefined"){this.col.chrom=m.chromCol-1;this.col.start=m.startCol-1;this.col.end=m.endCol-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.")}}if(this.data_type=="vcf"){function l(o,p){for(var n=0;n<p.length;n++){if(p[n].match(o)){return n}}return -1}this.col.chrom=l("Chrom",m.column_names);this.col.start=l("Pos",m.column_names);this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.")}}if(this.col.chrom===null){return}if(typeof k.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=k.model.attributes.id}if(typeof k.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=k.model.attributes.url_viz}if(typeof k.model.attributes.genome_build!=="undefined"){this.genome_build=k.model.attributes.genome_build}var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(n){function m(s){return !isNaN(parseFloat(s))&&isFinite(s)}if(this.col.chrom===null){return}var r=$(n.target).parent();var o=r.children().eq(this.col.chrom).html();var i=r.children().eq(this.col.start).html();var k=this.col.end?r.children().eq(this.col.end).html():i;if(!o.match("^#")&&o!==""&&m(i)){var q={dataset_id:this.dataset_id,gene_region:o+":"+i+"-"+k};var l=r.offset();var j=l.left-10;var p=l.top-$(window).scrollTop();$("#btn_viz").css({position:"fixed",top:p+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,q,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.Galaxy.modal.hide()},"View in saved visualization":function(){n.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:m,buttons:{Cancel:function(){n.Galaxy.modal.hide()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){n.Galaxy.modal.hide();var o=$(this).val();k.id=o;n.Galaxy.frame.add({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)})})}}})},"View in new visualization":function(){n.Galaxy.modal.hide();var o=i+"/trackster?"+$.param(k);n.Galaxy.frame.add({title:"Trackster",type:"url",content:o})}}})}});return false}}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ 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 automated genome selection
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/77529b5e5c16/
Changeset: 77529b5e5c16
User: guerler
Date: 2014-01-18 00:13:55
Summary: Upload: Add automated genome selection
Affected #: 4 files
diff -r be283631c6120086adfe98ba6e46513e119a443a -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -85,6 +85,9 @@
this.model.on('change:info', function() {
self._refreshInfo();
});
+ this.model.on('change:genome', function() {
+ self._refreshGenome();
+ });
this.model.on('remove', function() {
self.remove();
});
@@ -130,7 +133,15 @@
text.show();
}
},
-
+
+ // genome
+ _refreshGenome: function()
+ {
+ // write error message
+ var genome = this.model.get('genome');
+ this.$el.find('#genome').val(genome);
+ },
+
// progress
_refreshInfo: function()
{
diff -r be283631c6120086adfe98ba6e46513e119a443a -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -129,8 +129,13 @@
this.collection.on('remove', function(item) {
self._eventRemove(item);
});
- this.collection.on('change', function(item) {
- console.log('here');
+ 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);
+ }
+ });
});
},
diff -r be283631c6120086adfe98ba6e46513e119a443a -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 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(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
+define(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("change:genome",function(){b._refreshGenome()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshGenome:function(){var b=this.model.get("genome");this.$el.find("#genome").val(b)},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
diff -r be283631c6120086adfe98ba6e46513e119a443a -r 77529b5e5c1600bc30d92c38c2612b3abef997b4 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(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","utils/uploadbox"],function(a,d,e,c,b){return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new c.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(g){var f=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){f.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new d.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(h){f._eventShow(h)},on_unload:function(){if(f.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var f=this;e.jsonFromUrl(galaxy_config.root+"api/datatypes",function(h){for(key in h){f.select_extension.push([h[key],h[key]])}});e.jsonFromUrl(galaxy_config.root+"api/genomes",function(h){var i=f.select_genome[0];f.select_genome=[];for(key in h){if(h[key].length>1){if(h[key][1]!==i[1]){f.select_genome.push(h[key])}}}f.select_genome.sort(function(k,j){return k[0]>j[0]?1:k[0]<j[0]?-1:0});f.select_genome.unshift(i)});if(g){this.options=_.defaults(g,this.options)}this.collection.on("remove",function(h){f._eventRemove(h)});this.collection.on("change",function(h){console.log("here")})},_eventShow:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new a.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f._eventCreate()},Upload:function(){f._eventStart()},Pause:function(){f._eventStop()},Reset:function(){f._eventReset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({announce:function(h,i,j){f._eventAnnounce(h,i,j)},initialize:function(h,i,j){return f._eventInitialize(h,i,j)},progress:function(h,i,j){f._eventProgress(h,i,j)},success:function(h,i,j){f._eventSuccess(h,i,j)},error:function(h,i,j){f._eventError(h,i,j)},complete:function(){f._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(g){var f=g.get("status");if(f=="success"){this.counter.success--}else{if(f=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(g.id)},_eventAnnounce:function(f,g,i){this.counter.announce++;this._updateScreen();var h=new b(this,{id:f,file_name:g.name,file_size:g.size});this.collection.add(h.model);$(this.el).find("tbody:last").append(h.$el);h.render()},_eventInitialize:function(j,f,n){var h=this.collection.get(j);h.set("state","running");this.button_show.number(this.counter.announce);var g=h.get("extension");var k=h.get("file_name");var m=h.get("genome");var l=h.get("url_paste");var i=h.get("space_to_tabs");if(!l&&!(f.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=g;tool_input["files_0|NAME"]=k;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(g,h,f){var i=this.collection.get(g);i.set("percentage",f)},_eventSuccess:function(f,g,i){var h=this.collection.get(f);h.set("status","success");this.button_show.number("");this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(f,g,i){var h=this.collection.get(f);h.set("status","error");h.set("info",i);this.button_show.number("");this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(f){if(f.get("status")=="queued"){f.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}this.collection.each(function(f){if(f.get("status")=="init"){f.set("status","queued")}});this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_template:function(g,f){return'<div id="'+g+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+f+'" class="upload-info"></h6>'}})});
\ No newline at end of file
+define(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","utils/uploadbox"],function(a,d,e,c,b){return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new c.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(g){var f=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){f.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new d.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(h){f._eventShow(h)},on_unload:function(){if(f.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var f=this;e.jsonFromUrl(galaxy_config.root+"api/datatypes",function(h){for(key in h){f.select_extension.push([h[key],h[key]])}});e.jsonFromUrl(galaxy_config.root+"api/genomes",function(h){var i=f.select_genome[0];f.select_genome=[];for(key in h){if(h[key].length>1){if(h[key][1]!==i[1]){f.select_genome.push(h[key])}}}f.select_genome.sort(function(k,j){return k[0]>j[0]?1:k[0]<j[0]?-1:0});f.select_genome.unshift(i)});if(g){this.options=_.defaults(g,this.options)}this.collection.on("remove",function(h){f._eventRemove(h)});this.collection.on("change:genome",function(i){var h=i.get("genome");f.collection.each(function(j){if(j.get("status")=="init"&&j.get("genome")=="?"){j.set("genome",h)}})})},_eventShow:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new a.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f._eventCreate()},Upload:function(){f._eventStart()},Pause:function(){f._eventStop()},Reset:function(){f._eventReset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({announce:function(h,i,j){f._eventAnnounce(h,i,j)},initialize:function(h,i,j){return f._eventInitialize(h,i,j)},progress:function(h,i,j){f._eventProgress(h,i,j)},success:function(h,i,j){f._eventSuccess(h,i,j)},error:function(h,i,j){f._eventError(h,i,j)},complete:function(){f._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(g){var f=g.get("status");if(f=="success"){this.counter.success--}else{if(f=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(g.id)},_eventAnnounce:function(f,g,i){this.counter.announce++;this._updateScreen();var h=new b(this,{id:f,file_name:g.name,file_size:g.size});this.collection.add(h.model);$(this.el).find("tbody:last").append(h.$el);h.render()},_eventInitialize:function(j,f,n){var h=this.collection.get(j);h.set("state","running");this.button_show.number(this.counter.announce);var g=h.get("extension");var k=h.get("file_name");var m=h.get("genome");var l=h.get("url_paste");var i=h.get("space_to_tabs");if(!l&&!(f.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=g;tool_input["files_0|NAME"]=k;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(g,h,f){var i=this.collection.get(g);i.set("percentage",f)},_eventSuccess:function(f,g,i){var h=this.collection.get(f);h.set("status","success");this.button_show.number("");this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(f,g,i){var h=this.collection.get(f);h.set("status","error");h.set("info",i);this.button_show.number("");this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(f){if(f.get("status")=="queued"){f.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}this.collection.each(function(f){if(f.get("status")=="init"){f.set("status","queued")}});this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_template:function(g,f){return'<div id="'+g+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+f+'" class="upload-info"></h6>'}})});
\ 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: Separate upload javascript into files and place into mvc directory
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/be283631c612/
Changeset: be283631c612
User: guerler
Date: 2014-01-17 23:55:15
Summary: Separate upload javascript into files and place into mvc directory
Affected #: 22 files
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -46,12 +46,23 @@
// append main
this.charts_view.append(this.viewport_view.$el);
- // create
+ // set elements
+ this.setElement(this.portlet.$el);
+
+ // hide views
this.group_view.$el.hide();
this.charts_view.$el.hide();
- // set elements
- this.setElement(this.portlet.$el);
+ // events
+ var self = this;
+ this.config.on('change:current_view', function() {
+ self._showCurrent();
+ });
+ },
+
+ // current view
+ _showCurrent: function() {
+
},
// execute command
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/galaxy.library.js
--- a/static/scripts/galaxy.library.js
+++ b/static/scripts/galaxy.library.js
@@ -11,7 +11,7 @@
define([
"galaxy.modal",
"galaxy.masthead",
- "utils/galaxy.utils",
+ "utils/utils",
"libs/toastr"], function(mod_modal, mod_masthead, mod_utils, mod_toastr) {
// MMMMMMMMMMMMMMM
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/galaxy.masthead.js
--- a/static/scripts/galaxy.masthead.js
+++ b/static/scripts/galaxy.masthead.js
@@ -1,9 +1,5 @@
-/*
- galaxy masthead
-*/
-
// dependencies
-define(["utils/galaxy.utils"], function(mod_utils) {
+define([], function() {
// masthead
var GalaxyMasthead = Backbone.View.extend(
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/galaxy.upload.js
--- a/static/scripts/galaxy.upload.js
+++ /dev/null
@@ -1,703 +0,0 @@
-/*
- galaxy upload
-*/
-
-// dependencies
-define(["galaxy.modal", "galaxy.masthead", "utils/galaxy.utils", "utils/galaxy.uploadbox"], function(mod_modal, mod_masthead, mod_utils) {
-
-// galaxy upload
-var GalaxyUpload = Backbone.View.extend(
-{
- // own modal
- modal : null,
-
- // button
- button_show : null,
-
- // upload mod
- uploadbox: null,
-
- // current history
- current_history: null,
-
- // extension types
- select_extension :[['Auto-detect', 'auto']],
-
- // genomes
- select_genome : [['Unspecified (?)', '?']],
-
- // states
- state : {
- init : 'fa fa-trash-o',
- queued : 'fa fa-spinner fa-spin',
- running : '__running__',
- success : 'fa fa-check',
- error : 'fa fa-exclamation-triangle'
- },
-
- // counter
- counter : {
- // stats
- announce : 0,
- success : 0,
- error : 0,
- running : 0,
-
- // reset stats
- reset : function()
- {
- this.announce = this.success = this.error = this.running = 0;
- }
- },
-
- // options
- options : {
- nginx_upload_path : ''
- },
-
- // initialize
- initialize : function(options)
- {
- // wait for galaxy history panel (workaround due to the use of iframes)
- if (!Galaxy.currHistoryPanel)
- {
- var self = this;
- window.setTimeout(function() { self.initialize() }, 500)
- return;
- }
-
- // check if logged in
- if (!Galaxy.currUser.get('id'))
- return;
-
- // add activate icon
- var self = this;
- this.button_show = new mod_masthead.GalaxyMastheadIcon (
- {
- icon : 'fa-arrow-circle-o-up',
- tooltip : 'Upload Files',
- on_click : function(e) { self.event_show(e) },
- on_unload : function() {
- if (self.counter.running > 0)
- return "Several uploads are still processing.";
- },
- with_number : true
- });
-
- // add to masthead
- Galaxy.masthead.prepend(this.button_show);
-
- // load extension
- var self = this;
- mod_utils.jsonFromUrl(galaxy_config.root + "api/datatypes",
- function(datatypes) {
- for (key in datatypes)
- self.select_extension.push([datatypes[key], datatypes[key]]);
- });
-
- // load genomes
- mod_utils.jsonFromUrl(galaxy_config.root + "api/genomes",
- function(genomes) {
- // backup default
- var def = self.select_genome[0];
-
- // fill array
- self.select_genome = [];
- for (key in genomes)
- if (genomes[key].length > 1)
- if (genomes[key][1] !== def[1])
- self.select_genome.push(genomes[key]);
-
- // sort
- self.select_genome.sort(function(a, b) {
- return a[0] > b[0] ? 1 : a[0] < b[0] ? -1 : 0;
- });
-
- // insert default back to array
- self.select_genome.unshift(def);
- });
-
- // read in options
- if (options) {
- this.options = _.defaults(options, this.options);
- }
- },
-
- // mouse over
- event_dragover : function (e)
- {
- },
-
- // mouse left
- event_dragleave : function (e)
- {
- },
-
- // start
- event_announce : function(index, file, message)
- {
- // make id
- var id = '#upload-' + index;
-
- // add upload item
- $(this.el).find('tbody:last').append(this.template_row(id));
-
- // access upload item
- var it = this.get_upload_item(index);
-
- // fade in
- it.fadeIn();
-
- // update title
- it.find('#title').html(file.name);
-
- // update info
- it.find('#size').html(this.size_to_string (file.size));
-
- // add functionality to new row elements
- var self = this;
-
- // handle click event
- it.find('#symbol').on('click', function() { self.event_remove (index) });
-
- // handle text editing event
- it.find('#text-content').on('keyup', function() {
- var count = it.find('#text-content').val().length;
- it.find('#size').html(self.size_to_string (count));
- });
-
- // handle genome selection event
- var self = this;
- it.find('#genome').on('change', function(e) {
- // identify selected genome
- var selected_genome = $(e.target).val();
-
- // update genome
- var items = $(self.el).find('.upload-item');
- items.each(function()
- {
- var symbol = $(this).find('#symbol');
- var genome = $(this).find('#genome');
- if(symbol.hasClass(self.state.init) && genome.val() == '?') {
- genome.val(selected_genome);
- }
- });
- });
-
- // initialize progress
- this.event_progress(index, file, 0);
-
- // update counter
- this.counter.announce++;
-
- // update screen
- this.update_screen();
-
- // activate text field if file content is zero
- if (file.size == -1)
- {
- // get text component
- var text = it.find('#text');
-
- // get padding
- var padding = 8;
-
- // 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();
- }
- },
-
- // start
- event_initialize : function(index, file, message)
- {
- // update on screen counter
- this.button_show.number(this.counter.announce);
-
- // get element
- var it = this.get_upload_item(index);
-
- // update status
- var sy = it.find('#symbol');
- sy.addClass(this.state.running);
-
- // get configuration
- var file_type = it.find('#extension').val();
- var genome = it.find('#genome').val();
- var url_paste = it.find('#text-content').val();
- var space_to_tabs = it.find('#space_to_tabs').is(':checked');
-
- // validate
- if (!url_paste && !(file.size > 0))
- return null;
-
- // configure uploadbox
- this.uploadbox.configure({url : this.options.nginx_upload_path, paramname : "files_0|file_data"});
-
- // configure tool
- tool_input = {};
- tool_input['dbkey'] = genome;
- tool_input['file_type'] = file_type;
- tool_input['files_0|NAME'] = file.name;
- tool_input['files_0|type'] = 'upload_dataset';
- tool_input['files_0|url_paste'] = url_paste;
- tool_input['space_to_tabs'] = space_to_tabs;
-
- // setup data
- data = {};
- data['history_id'] = this.current_history;
- data['tool_id'] = 'upload1';
- data['inputs'] = JSON.stringify(tool_input);
-
- // return additional data to be send with file
- return data;
- },
-
- // progress
- event_progress : function(index, file, message)
- {
- // get element
- var it = this.get_upload_item(index);
-
- // get value
- var percentage = parseInt(message);
-
- // update progress
- it.find('.progress-bar').css({ width : percentage + '%' });
-
- // update value
- if (percentage != 100)
- it.find('#percentage').html(percentage + '%');
- else
- it.find('#percentage').html('Adding to history...');
- },
-
- // success
- event_success : function(index, file, message)
- {
- // make sure progress is shown correctly
- this.event_progress(index, file, 100);
-
- // update on screen counter
- this.button_show.number('');
-
- // update counter
- this.counter.announce--;
- this.counter.success++;
-
- // update on screen info
- this.update_screen();
-
- // get element
- var it = this.get_upload_item(index);
-
- // update progress frame
- it.addClass('success');
-
- // update text
- it.find('#percentage').html('100%');
-
- // update icon
- var sy = it.find('#symbol');
- sy.removeClass(this.state.running);
- sy.removeClass(this.state.queued);
- sy.addClass(this.state.success);
-
- // update galaxy history
- Galaxy.currHistoryPanel.refreshHdas();
- },
-
- // error
- event_error : function(index, file, message)
- {
- // make sure progress is shown correctly
- this.event_progress(index, file, 0);
-
- // update on screen counter
- this.button_show.number('');
-
- // update counter
- this.counter.announce--;
- this.counter.error++;
-
- // update on screen info
- this.update_screen();
-
- // get element
- var it = this.get_upload_item(index);
-
- // update progress frame
- it.addClass('danger');
-
- // remove progress bar
- it.find('.progress').remove();
-
- // write error message
- it.find('#info').html('<strong>Failed: </strong>' + message).show();
-
- // update icon
- var sy = it.find('#symbol');
- sy.removeClass(this.state.running);
- sy.removeClass(this.state.queued);
- sy.addClass(this.state.error);
- },
-
- // start upload process
- event_start : function()
- {
- // check
- if (this.counter.announce == 0 || this.counter.running > 0)
- return;
-
- // switch icons for new uploads
- var items = $(this.el).find('.upload-item');
- var self = this;
- items.each(function()
- {
- var symbol = $(this).find('#symbol');
- if(symbol.hasClass(self.state.init))
- {
- // set status
- symbol.removeClass(self.state.init);
- symbol.addClass(self.state.queued);
-
- // disable options
- $(this).find('#text-content').attr('disabled', true);
- $(this).find('#genome').attr('disabled', true);
- $(this).find('#extension').attr('disabled', true);
- $(this).find('#space_to_tabs').attr('disabled', true);
- }
- });
-
- // backup current history
- this.current_history = Galaxy.currHistoryPanel.model.get('id');
-
- // update running
- this.counter.running = this.counter.announce;
- this.update_screen();
-
- // initiate upload procedure in plugin
- this.uploadbox.start();
- },
-
- // pause upload process
- event_stop : function()
- {
- // check
- if (this.counter.running == 0)
- return;
-
- // request pause
- this.uploadbox.stop();
-
- // set html content
- $('#upload-info').html('Queue will pause after completing the current file...');
- },
-
- // queue is done
- event_complete: function()
- {
- // update running
- this.counter.running = 0;
- this.update_screen();
-
- // switch icons for new uploads
- var items = $(this.el).find('.upload-item');
- var self = this;
- items.each(function()
- {
- var symbol = $(this).find('#symbol');
- if(symbol.hasClass(self.state.queued) && !symbol.hasClass(self.state.running))
- {
- // update status
- symbol.removeClass(self.state.queued);
- symbol.addClass(self.state.init);
-
- // disable options
- $(this).find('#text-content').attr('disabled', false);
- $(this).find('#genome').attr('disabled', false);
- $(this).find('#extension').attr('disabled', false);
- $(this).find('#space_to_tabs').attr('disabled', false);
- }
- });
- },
-
- // remove all
- event_reset : function()
- {
- // make sure queue is not running
- if (this.counter.running == 0)
- {
- // remove from screen
- var items = $(this.el).find('.upload-item');
- $(this.el).find('table').fadeOut({ complete : function() { items.remove(); }});
-
- // reset counter
- this.counter.reset();
-
- // show on screen info
- this.update_screen();
-
- // remove from queue
- this.uploadbox.reset();
- }
- },
-
- // remove item from upload list
- event_remove : function(index)
- {
- // get item
- var it = this.get_upload_item(index);
- var sy = it.find('#symbol');
-
- // only remove from queue if not in processing line
- if (sy.hasClass(this.state.init) || sy.hasClass(this.state.success) || sy.hasClass(this.state.error))
- {
- // reduce counter
- if (it.hasClass('success'))
- this.counter.success--;
- else if (it.hasClass('danger'))
- this.counter.error--;
- else
- this.counter.announce--;
-
- // show on screen info
- this.update_screen();
-
- // remove from queue
- this.uploadbox.remove(index);
-
- // remove element
- it.remove();
- }
- },
-
- // create (pseudo) file
- event_create : function ()
- {
- this.uploadbox.add([{ name : 'New File', size : -1 }]);
- },
-
- // show/hide upload frame
- event_show : function (e)
- {
- // prevent default
- e.preventDefault();
-
- // create modal
- if (!this.modal)
- {
- // make modal
- var self = this;
- this.modal = new mod_modal.GalaxyModal(
- {
- title : 'Upload files from your local drive',
- body : this.template('upload-box', 'upload-info'),
- buttons : {
- 'Select' : function() {self.uploadbox.select()},
- 'Create' : function() {self.event_create()},
- 'Upload' : function() {self.event_start()},
- 'Pause' : function() {self.event_stop()},
- 'Reset' : function() {self.event_reset()},
- 'Close' : function() {self.modal.hide()},
- },
- height : '400',
- width : '900'
- });
-
- // set element
- this.setElement('#upload-box');
-
- // file upload
- var self = this;
- this.uploadbox = this.$el.uploadbox(
- {
- dragover : function() { self.event_dragover() },
- dragleave : function() { self.event_dragleave() },
- announce : function(index, file, message) { self.event_announce(index, file, message) },
- initialize : function(index, file, message) { return self.event_initialize(index, file, message) },
- success : function(index, file, message) { self.event_success(index, file, message) },
- progress : function(index, file, message) { self.event_progress(index, file, message) },
- error : function(index, file, message) { self.event_error(index, file, message) },
- complete : function() { self.event_complete() },
- });
-
- // setup info
- this.update_screen();
- }
-
- // show modal
- this.modal.show();
- },
-
- // get upload item
- get_upload_item: function(index)
- {
- // get element
- return $(this.el).find('#upload-' + index);
- },
-
- // to string
- size_to_string : function (size)
- {
- // identify unit
- var unit = "";
- if (size >= 100000000000) { size = size / 100000000000; unit = 'TB'; } else
- if (size >= 100000000) { size = size / 100000000; unit = 'GB'; } else
- if (size >= 100000) { size = size / 100000; unit = 'MB'; } else
- if (size >= 100) { size = size / 100; unit = 'KB'; } else
- if (size > 0) { size = size * 10; unit = 'b'; } else
- return '<strong>-</strong>';
-
- // return formatted string
- return '<strong>' + (Math.round(size) / 10) + '</strong> ' + unit;
- },
-
- // set screen
- update_screen: function ()
- {
- /*
- update on screen info
- */
-
- // check default message
- if(this.counter.announce == 0)
- {
- if (this.uploadbox.compatible())
- message = 'Drag&drop files into this box or click \'Select\' to select files!';
- else
- message = 'Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.'
- } else {
- if (this.counter.running == 0)
- message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \'Upload\' to proceed.';
- else
- message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';
- }
-
- // set html content
- $('#upload-info').html(message);
-
- /*
- update button status
- */
-
- // update reset button
- if (this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0)
- this.modal.enableButton('Reset');
- else
- this.modal.disableButton('Reset');
-
- // update upload button
- if (this.counter.running == 0 && this.counter.announce > 0)
- this.modal.enableButton('Upload');
- else
- this.modal.disableButton('Upload');
-
- // pause upload button
- if (this.counter.running > 0)
- this.modal.enableButton('Pause');
- else
- this.modal.disableButton('Pause');
-
- // select upload button
- if (this.counter.running == 0)
- {
- this.modal.enableButton('Select');
- this.modal.enableButton('Create');
- } else {
- this.modal.disableButton('Select');
- this.modal.disableButton('Create');
- }
-
- // table visibility
- if (this.counter.announce + this.counter.success + this.counter.error > 0)
- $(this.el).find('table').show();
- else
- $(this.el).find('table').hide();
- },
-
- // load html template
- template: function(id, idInfo)
- {
- return '<div id="' + id + '" class="upload-box">' +
- '<table class="table table-striped" style="display: none;">' +
- '<thead>' +
- '<tr>' +
- '<th>Name</th>' +
- '<th>Size</th>' +
- '<th>Type</th>' +
- '<th>Genome</th>' +
- '<th>Space→Tab</th>' +
- '<th>Status</th>' +
- '<th></th>' +
- '</tr>' +
- '</thead>' +
- '<tbody></tbody>' +
- '</table>' +
- '</div>' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>';
- },
-
- template_row: function(id)
- {
- // construct template
- var tmpl = '<tr id="' + id.substr(1) + '" class="upload-item">' +
- '<td>' +
- '<div style="position: relative;">' +
- '<div id="title" class="title"></div>' +
- '<div id="text" class="text">' +
- '<div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div>' +
- '<textarea id="text-content" class="text-content form-control"></textarea>' +
- '</div>' +
- '</div>' +
- '</td>' +
- '<td><div id="size" class="size"></div></td>';
-
- // add file type selectore
- tmpl += '<td>' +
- '<select id="extension" class="extension">';
- for (key in this.select_extension)
- tmpl += '<option value="' + this.select_extension[key][1] + '">' + this.select_extension[key][0] + '</option>';
- tmpl += '</select>' +
- '</td>';
-
- // add genome selector
- tmpl += '<td>' +
- '<select id="genome" class="genome">';
- for (key in this.select_genome)
- tmpl += '<option value="' + this.select_genome[key][1] + '">' + this.select_genome[key][0] + '</option>';
- tmpl += '</select>' +
- '</td>';
-
- // add next row
- tmpl += '<td><input id="space_to_tabs" type="checkbox"></input></td>' +
- '<td>' +
- '<div id="info" class="info">' +
- '<div class="progress">' +
- '<div class="progress-bar progress-bar-success"></div>' +
- '<div id="percentage" class="percentage">0%</div>' +
- '</div>' +
- '</div>' +
- '</td>' +
- '<td><div id="symbol" class="symbol ' + this.state.init + '"></div></td>' +
- '</tr>';
-
- // return html string
- return tmpl;
- }
-});
-
-// return
-return {
- GalaxyUpload: GalaxyUpload
-};
-
-});
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/mvc/upload/upload-model.js
--- /dev/null
+++ b/static/scripts/mvc/upload/upload-model.js
@@ -0,0 +1,27 @@
+// dependencies
+define([], function() {
+
+// model
+var Model = Backbone.Model.extend({
+ defaults: {
+ extension : 'auto',
+ genome : '?',
+ url_paste : '',
+ space_to_tabs : false,
+ status : 'init',
+ info : null
+ }
+});
+
+// collection
+var Collection = Backbone.Collection.extend({
+ model: Model
+});
+
+// return
+return {
+ Model: Model,
+ Collection : Collection
+};
+
+});
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/mvc/upload/upload-row.js
--- /dev/null
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -0,0 +1,270 @@
+// dependencies
+define(['mvc/upload/upload-model'], function(UploadModel) {
+
+// item view
+return Backbone.View.extend({
+ // options
+ options: {
+ padding : 8
+ },
+
+ // states
+ status_classes : {
+ init : 'symbol fa fa-trash-o',
+ queued : 'symbol fa fa-spinner fa-spin',
+ success : 'symbol fa fa-check',
+ error : 'symbol fa fa-exclamation-triangle'
+ },
+
+ // render
+ initialize: function(app, options) {
+ // link app
+ this.app = app;
+
+ // 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;
+
+ // handle click event
+ it.find('#symbol').on('click', function() {
+ // get current status
+ var status = self.model.get('status');
+
+ // only remove from queue if not in processing line
+ if (status == 'init' || status == 'success' || status == 'error')
+ {
+ // remove from collection
+ self.app.collection.remove(self.model);
+ }
+ });
+
+ // handle text editing event
+ it.find('#text-content').on('keyup', function() {
+ // get properties
+ var $el = it.find('#text-content');
+ var value = $el.val();
+ var count = value.length;
+
+ // update size string
+ it.find('#size').html(self._formatSize (count));
+
+ // update url paste content
+ self.model.set('url_paste', value);
+ });
+
+ // handle genome selection
+ it.find('#genome').on('change', function(e) {
+ self.model.set('genome', $(e.target).val());
+ });
+
+ // handle extension selection
+ it.find('#extension').on('change', function(e) {
+ self.model.set('extension', $(e.target).val());
+ });
+
+ // handle space to tabs button
+ it.find('#space_to_tabs').on('change', function(e) {
+ self.model.set('space_to_tabs', $(e.target).prop('checked'));
+ });
+
+ // events
+ this.model.on('change:percentage', function() {
+ self._refreshPercentage();
+ });
+ this.model.on('change:status', function() {
+ self._refreshStatus();
+ });
+ this.model.on('change:info', function() {
+ self._refreshInfo();
+ });
+ this.model.on('remove', function() {
+ self.remove();
+ });
+ this.app.collection.on('reset', function() {
+ self.remove();
+ });
+ },
+
+ // render
+ render: function() {
+ // read model
+ var file_name = this.model.get('file_name');
+ var file_size = this.model.get('file_size');
+
+ // link item
+ var it = this.$el;
+
+ // update title
+ it.find('#title').html(file_name);
+
+ // update info
+ it.find('#size').html(this._formatSize (file_size));
+
+ // activate text field if file content is zero
+ if (file_size == -1)
+ {
+ // 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();
+ }
+ },
+
+ // progress
+ _refreshInfo: function()
+ {
+ // write error message
+ var info = this.model.get('info');
+ if (info) {
+ this.$el.find('#info').html('<strong>Failed: </strong>' + info).show();
+ } else {
+ this.$el.find('#info').hide();
+ }
+ },
+
+ // progress
+ _refreshPercentage : function()
+ {
+ var percentage = parseInt(this.model.get('percentage'));
+ this.$el.find('.progress-bar').css({ width : percentage + '%' });
+ if (percentage != 100)
+ this.$el.find('#percentage').html(percentage + '%');
+ 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') {
+ it.find('#text-content').attr('disabled', false);
+ it.find('#genome').attr('disabled', false);
+ it.find('#extension').attr('disabled', false);
+ it.find('#space_to_tabs').attr('disabled', false);
+ } else {
+ it.find('#text-content').attr('disabled', true);
+ it.find('#genome').attr('disabled', true);
+ it.find('#extension').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');
+ it.find('.progress').remove();
+ }
+ },
+
+ // to string
+ _formatSize : function (size)
+ {
+ // identify unit
+ var unit = "";
+ if (size >= 100000000000) { size = size / 100000000000; unit = 'TB'; } else
+ if (size >= 100000000) { size = size / 100000000; unit = 'GB'; } else
+ if (size >= 100000) { size = size / 100000; unit = 'MB'; } else
+ if (size >= 100) { size = size / 100; unit = 'KB'; } else
+ if (size > 0) { size = size * 10; unit = 'b'; } else
+ return '<strong>-</strong>';
+
+ // return formatted string
+ return '<strong>' + (Math.round(size) / 10) + '</strong> ' + unit;
+ },
+
+ // template
+ _template: function(options)
+ {
+ // link this
+ var self = this;
+
+ // construct template
+ var tmpl = '<tr id="upload-item-' + options.id + '" class="upload-item">' +
+ '<td>' +
+ '<div style="position: relative;">' +
+ '<div id="title" class="title"></div>' +
+ '<div id="text" class="text">' +
+ '<div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div>' +
+ '<textarea id="text-content" class="text-content form-control"></textarea>' +
+ '</div>' +
+ '</div>' +
+ '</td>' +
+ '<td><div id="size" class="size"></div></td>';
+
+ // add file type selectore
+ tmpl += '<td>' +
+ '<select id="extension" class="extension">';
+ for (key in self.app.select_extension)
+ tmpl += '<option value="' + self.app.select_extension[key][1] + '">' + self.app.select_extension[key][0] + '</option>';
+ tmpl += '</select>' +
+ '</td>';
+
+ // add genome selector
+ tmpl += '<td>' +
+ '<select id="genome" class="genome">';
+ for (key in self.app.select_genome)
+ tmpl += '<option value="' + self.app.select_genome[key][1] + '">' + self.app.select_genome[key][0] + '</option>';
+ tmpl += '</select>' +
+ '</td>';
+
+ // add next row
+ tmpl += '<td><input id="space_to_tabs" type="checkbox"></input></td>' +
+ '<td>' +
+ '<div id="info" class="info">' +
+ '<div class="progress">' +
+ '<div class="progress-bar progress-bar-success"></div>' +
+ '<div id="percentage" class="percentage">0%</div>' +
+ '</div>' +
+ '</div>' +
+ '</td>' +
+ '<td><div id="symbol" class="' + this.status_classes.init + '"></div></td>' +
+ '</tr>';
+
+ // return html string
+ return tmpl;
+ }
+
+});
+
+});
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/mvc/upload/upload-view.js
--- /dev/null
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -0,0 +1,509 @@
+// dependencies
+define(["galaxy.modal",
+ "galaxy.masthead",
+ "utils/utils",
+ "mvc/upload/upload-model",
+ "mvc/upload/upload-row",
+ "utils/uploadbox"],
+
+ function( mod_modal,
+ mod_masthead,
+ mod_utils,
+ UploadModel,
+ UploadItem
+ ) {
+
+// galaxy upload
+return Backbone.View.extend(
+{
+ // own modal
+ modal : null,
+
+ // button
+ button_show : null,
+
+ // jquery uploadbox plugin
+ uploadbox: null,
+
+ // current history
+ current_history: null,
+
+ // extension types
+ select_extension :[['Auto-detect', 'auto']],
+
+ // genomes
+ select_genome : [['Unspecified (?)', '?']],
+
+ // collection
+ collection : new UploadModel.Collection(),
+
+ // counter
+ counter : {
+ // stats
+ announce : 0,
+ success : 0,
+ error : 0,
+ running : 0,
+
+ // reset stats
+ reset : function()
+ {
+ this.announce = this.success = this.error = this.running = 0;
+ }
+ },
+
+ // options
+ options : {
+ nginx_upload_path : ''
+ },
+
+ // initialize
+ initialize : function(options)
+ {
+ // link this
+ var self = this;
+
+ // wait for galaxy history panel (workaround due to the use of iframes)
+ if (!Galaxy.currHistoryPanel)
+ {
+ window.setTimeout(function() { self.initialize() }, 500)
+ return;
+ }
+
+ // check if logged in
+ if (!Galaxy.currUser.get('id'))
+ return;
+
+ // add activate icon
+ this.button_show = new mod_masthead.GalaxyMastheadIcon (
+ {
+ icon : 'fa-arrow-circle-o-up',
+ tooltip : 'Upload Files',
+ on_click : function(e) { self._eventShow(e) },
+ on_unload : function() {
+ if (self.counter.running > 0)
+ return "Several uploads are still processing.";
+ },
+ with_number : true
+ });
+
+ // add to masthead
+ Galaxy.masthead.prepend(this.button_show);
+
+ // load extension
+ var self = this;
+ mod_utils.jsonFromUrl(galaxy_config.root + "api/datatypes",
+ function(datatypes) {
+ for (key in datatypes)
+ self.select_extension.push([datatypes[key], datatypes[key]]);
+ });
+
+ // load genomes
+ mod_utils.jsonFromUrl(galaxy_config.root + "api/genomes",
+ function(genomes) {
+ // backup default
+ var def = self.select_genome[0];
+
+ // fill array
+ self.select_genome = [];
+ for (key in genomes)
+ if (genomes[key].length > 1)
+ if (genomes[key][1] !== def[1])
+ self.select_genome.push(genomes[key]);
+
+ // sort
+ self.select_genome.sort(function(a, b) {
+ return a[0] > b[0] ? 1 : a[0] < b[0] ? -1 : 0;
+ });
+
+ // insert default back to array
+ self.select_genome.unshift(def);
+ });
+
+ // read in options
+ if (options) {
+ this.options = _.defaults(options, this.options);
+ }
+
+ // events
+ this.collection.on('remove', function(item) {
+ self._eventRemove(item);
+ });
+ this.collection.on('change', function(item) {
+ console.log('here');
+ });
+ },
+
+ //
+ // event triggered by upload button
+ //
+
+ // show/hide upload frame
+ _eventShow : function (e)
+ {
+ // prevent default
+ e.preventDefault();
+
+ // create modal
+ if (!this.modal)
+ {
+ // make modal
+ var self = this;
+ this.modal = new mod_modal.GalaxyModal(
+ {
+ title : 'Upload files from your local drive',
+ body : this._template('upload-box', 'upload-info'),
+ buttons : {
+ 'Select' : function() {self.uploadbox.select()},
+ 'Create' : function() {self._eventCreate()},
+ 'Upload' : function() {self._eventStart()},
+ 'Pause' : function() {self._eventStop()},
+ 'Reset' : function() {self._eventReset()},
+ 'Close' : function() {self.modal.hide()},
+ },
+ height : '400',
+ width : '900'
+ });
+
+ // set element
+ this.setElement('#upload-box');
+
+ // file upload
+ var self = this;
+ this.uploadbox = this.$el.uploadbox(
+ {
+ announce : function(index, file, message) { self._eventAnnounce(index, file, message) },
+ initialize : function(index, file, message) { return self._eventInitialize(index, file, message) },
+ progress : function(index, file, message) { self._eventProgress(index, file, message) },
+ success : function(index, file, message) { self._eventSuccess(index, file, message) },
+ error : function(index, file, message) { self._eventError(index, file, message) },
+ complete : function() { self._eventComplete() }
+ });
+
+ // setup info
+ this._updateScreen();
+ }
+
+ // show modal
+ this.modal.show();
+ },
+
+ //
+ // events triggered by collection
+ //
+
+ // remove item from upload list
+ _eventRemove : function(item)
+ {
+ // update status
+ var status = item.get('status');
+
+ // reduce counter
+ if (status == 'success') {
+ this.counter.success--;
+ } else if (status == 'error') {
+ this.counter.error--;
+ } else {
+ this.counter.announce--;
+ }
+
+ // show on screen info
+ this._updateScreen();
+
+ // remove from queue
+ this.uploadbox.remove(item.id);
+ },
+
+ //
+ // events triggered by the upload box plugin
+ //
+
+ // a new file has been dropped/selected through the uploadbox plugin
+ _eventAnnounce : function(index, file, message)
+ {
+ // update counter
+ this.counter.announce++;
+
+ // update screen
+ this._updateScreen();
+
+ // create view/model
+ var upload_item = new UploadItem(this, {
+ id : index,
+ file_name : file.name,
+ file_size : file.size
+ });
+
+ // add to collection
+ this.collection.add(upload_item.model);
+
+ // add upload item element to table
+ $(this.el).find('tbody:last').append(upload_item.$el);
+
+ // render
+ upload_item.render();
+ },
+
+ // the uploadbox plugin is initializing the upload for this file
+ _eventInitialize : function(index, file, message)
+ {
+ // get element
+ var it = this.collection.get(index);
+
+ // update status
+ it.set('state', 'running');
+
+ // update on screen counter
+ this.button_show.number(this.counter.announce);
+
+ // get configuration
+ var file_type = it.get('extension');
+ var file_name = it.get('file_name');
+ var genome = it.get('genome');
+ var url_paste = it.get('url_paste');
+ var space_to_tabs = it.get('space_to_tabs');
+
+ // validate
+ if (!url_paste && !(file.size > 0))
+ return null;
+
+ // configure uploadbox
+ this.uploadbox.configure({url : this.options.nginx_upload_path, paramname : "files_0|file_data"});
+
+ // configure tool
+ tool_input = {};
+ tool_input['dbkey'] = genome;
+ tool_input['file_type'] = file_type;
+ tool_input['files_0|NAME'] = file_name;
+ tool_input['files_0|type'] = 'upload_dataset';
+ tool_input['files_0|url_paste'] = url_paste;
+ tool_input['space_to_tabs'] = space_to_tabs;
+
+ // setup data
+ data = {};
+ data['history_id'] = this.current_history;
+ data['tool_id'] = 'upload1';
+ data['inputs'] = JSON.stringify(tool_input);
+
+ // return additional data to be send with file
+ return data;
+ },
+
+ // progress
+ _eventProgress : function(index, file, percentage)
+ {
+ var it = this.collection.get(index);
+ it.set('percentage', percentage);
+ },
+
+ // success
+ _eventSuccess : function(index, file, message)
+ {
+ // update status
+ var it = this.collection.get(index);
+ it.set('status', 'success');
+
+ // update on screen counter
+ this.button_show.number('');
+
+ // update counter
+ this.counter.announce--;
+ this.counter.success++;
+
+ // update on screen info
+ this._updateScreen();
+
+ // update galaxy history
+ Galaxy.currHistoryPanel.refreshHdas();
+ },
+
+ // error
+ _eventError : function(index, file, message)
+ {
+ // get element
+ var it = this.collection.get(index);
+
+ // update status
+ it.set('status', 'error');
+ it.set('info', message);
+
+ // update on screen counter
+ this.button_show.number('');
+
+ // update counter
+ this.counter.announce--;
+ this.counter.error++;
+
+ // update on screen info
+ this._updateScreen();
+ },
+
+ // queue is done
+ _eventComplete: function() {
+ // reset queued upload to initial status
+ this.collection.each(function(item) {
+ if(item.get('status') == 'queued') {
+ item.set('status', 'init');
+ }
+ });
+
+ // update running
+ this.counter.running = 0;
+ this._updateScreen();
+ },
+
+ //
+ // events triggered by this view
+ //
+
+ // create (pseudo) file
+ _eventCreate : function ()
+ {
+ this.uploadbox.add([{ name : 'New File', size : -1 }]);
+ },
+
+ // start upload process
+ _eventStart : function() {
+ // check
+ if (this.counter.announce == 0 || this.counter.running > 0) {
+ return;
+ }
+
+ // switch icons for new uploads
+ this.collection.each(function(item) {
+ if(item.get('status') == 'init') {
+ item.set('status', 'queued');
+ }
+ });
+
+ // backup current history
+ this.current_history = Galaxy.currHistoryPanel.model.get('id');
+
+ // update running
+ this.counter.running = this.counter.announce;
+ this._updateScreen();
+
+ // initiate upload procedure in plugin
+ this.uploadbox.start();
+ },
+
+ // pause upload process
+ _eventStop : function() {
+ // check
+ if (this.counter.running == 0) {
+ return;
+ }
+
+ // request pause
+ this.uploadbox.stop();
+
+ // set html content
+ $('#upload-info').html('Queue will pause after completing the current file...');
+ },
+
+ // remove all
+ _eventReset : function() {
+ // make sure queue is not running
+ if (this.counter.running == 0)
+ {
+ // reset collection
+ this.collection.reset();
+
+ // reset counter
+ this.counter.reset();
+
+ // show on screen info
+ this._updateScreen();
+
+ // remove from queue
+ this.uploadbox.reset();
+ }
+ },
+
+ // set screen
+ _updateScreen: function ()
+ {
+ /*
+ update on screen info
+ */
+
+ // check default message
+ if(this.counter.announce == 0)
+ {
+ if (this.uploadbox.compatible())
+ message = 'Drag&drop files into this box or click \'Select\' to select files!';
+ else
+ message = 'Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.'
+ } else {
+ if (this.counter.running == 0)
+ message = 'You added ' + this.counter.announce + ' file(s) to the queue. Add more files or click \'Upload\' to proceed.';
+ else
+ message = 'Please wait...' + this.counter.announce + ' out of ' + this.counter.running + ' remaining.';
+ }
+
+ // set html content
+ $('#upload-info').html(message);
+
+ /*
+ update button status
+ */
+
+ // update reset button
+ if (this.counter.running == 0 && this.counter.announce + this.counter.success + this.counter.error > 0)
+ this.modal.enableButton('Reset');
+ else
+ this.modal.disableButton('Reset');
+
+ // update upload button
+ if (this.counter.running == 0 && this.counter.announce > 0)
+ this.modal.enableButton('Upload');
+ else
+ this.modal.disableButton('Upload');
+
+ // pause upload button
+ if (this.counter.running > 0)
+ this.modal.enableButton('Pause');
+ else
+ this.modal.disableButton('Pause');
+
+ // select upload button
+ if (this.counter.running == 0)
+ {
+ this.modal.enableButton('Select');
+ this.modal.enableButton('Create');
+ } else {
+ this.modal.disableButton('Select');
+ this.modal.disableButton('Create');
+ }
+
+ // table visibility
+ if (this.counter.announce + this.counter.success + this.counter.error > 0)
+ $(this.el).find('table').show();
+ else
+ $(this.el).find('table').hide();
+ },
+
+ // load html template
+ _template: function(id, idInfo)
+ {
+ return '<div id="' + id + '" class="upload-box">' +
+ '<table class="table table-striped" style="display: none;">' +
+ '<thead>' +
+ '<tr>' +
+ '<th>Name</th>' +
+ '<th>Size</th>' +
+ '<th>Type</th>' +
+ '<th>Genome</th>' +
+ '<th>Space→Tab</th>' +
+ '<th>Status</th>' +
+ '<th></th>' +
+ '</tr>' +
+ '</thead>' +
+ '<tbody></tbody>' +
+ '</table>' +
+ '</div>' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>';
+ }
+});
+
+});
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/galaxy.library.js
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1,1 +1,1 @@
-var view=null;var library_router=null;var responses=[];define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","libs/toastr"],function(k,l,h,n){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var o=Backbone.Collection.extend({url:"/api/libraries",model:f});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(r){this.full_path=r[0].full_path;this.get("folder").reset(r[1].folder_contents);return r}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var p=Backbone.Collection.extend({url:"/api/histories",model:j});var q=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var m=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var r=[];r.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');r.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');r.push('<div id="library_folder_toolbar" >');r.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');r.push(' <button id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');r.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');r.push(' <button id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');r.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');r.push(" </button>");r.push(' <ul class="dropdown-menu" role="menu">');r.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');r.push(" </ul>");r.push(" </div>");r.push("</div>");r.push('<div class="library_breadcrumb">');r.push('<a title="Return to the list of libraries" href="#">Libraries</a><b>|</b> ');r.push("<% _.each(path, function(path_item) { %>");r.push("<% if (path_item[0] != id) { %>");r.push('<a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a><b>|</b> ');r.push("<% } else { %>");r.push('<span title="You are in this folder"><%- path_item[1] %></span>');r.push("<% } %>");r.push("<% }); %>");r.push("</div>");r.push('<table id="folder_table" class="table table-condensed">');r.push(" <thead>");r.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');r.push(' <th class="button_heading">view</th>');r.push(" <th>name</th>");r.push(" <th>data type</th>");r.push(" <th>size</th>");r.push(" <th>date (UTC)</th>");r.push(" </thead>");r.push(" <tbody>");r.push(" <td></td>");r.push(' <td><button title="Go to parent folder" type="button" data-id="<%- upper_folder_id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-arrow-up"></span> .. go up</td>');r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" </tr>");r.push(" <% _.each(items, function(content_item) { %>");r.push(' <tr class="folder_row light" id="<%- content_item.id %>">');r.push(' <% if (content_item.get("type") === "folder") { %>');r.push(" <td></td>");r.push(' <td><button title="Open this folder" type="button" data-id="<%- content_item.id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-folder-open"></span> browse</td>');r.push(' <td><%- content_item.get("name") %>');r.push(' <% if (content_item.get("item_count") === 0) { %>');r.push(' <span class="muted">(empty folder)</span>');r.push(" <% } %>");r.push(" </td>");r.push(" <td>folder</td>");r.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');r.push(" <% } else { %>");r.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');r.push(" <td>");r.push(' <button title="See details of this dataset" type="button" class="library-dataset btn btn-default btn-xs">');r.push(' <span class="fa fa-eye"></span> details');r.push(" </button>");r.push(" </td>");r.push(' <td><%- content_item.get("name") %></td>');r.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');r.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');r.push(" <% } %> ");r.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');r.push(" </tr>");r.push(" <% }); %>");r.push(" ");r.push(" </tbody>");r.push("</table>");r.push("</div>");return r.join("")},templateDatasetModal:function(){var r=[];r.push('<div id="dataset_info_modal">');r.push(' <table class="table table-striped table-condensed">');r.push(" <tr>");r.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');r.push(' <td><%= _.escape(item.get("name")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Data type</th>');r.push(' <td><%= _.escape(item.get("data_type")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Genome build</th>');r.push(' <td><%= _.escape(item.get("genome_build")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Size</th>');r.push(" <td><%= _.escape(size) %></td>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Date uploaded (UTC)</th>');r.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Uploaded by</th>');r.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');r.push(" </tr>");r.push(' <tr scope="row">');r.push(' <th scope="row">Data Lines</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Comment Lines</th>');r.push(' <% if (item.get("metadata_comment_lines") === "") { %>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');r.push(" <% } else { %>");r.push(' <td scope="row">unknown</td>');r.push(" <% } %>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Number of Columns</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Column Types</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Miscellaneous information</th>');r.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');r.push(" </tr>");r.push(" </table>");r.push(' <pre class="peek">');r.push(" </pre>");r.push("</div>");return r.join("")},templateHistorySelectInModal:function(){var r=[];r.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateBulkImportInModal:function(){var r=[];r.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateProgressBar:function(){var r=[];r.push('<div class="import_text">');r.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");r.push("</div>");r.push('<div class="progress">');r.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');r.push(' <span class="completion_span">0% Complete</span>');r.push(" </div>");r.push("</div>");r.push("");return r.join("")},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click .folder_row":"selectClickedRow","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click .library-dataset":"showDatasetDetails","click #toolbtn_create_folder":"createFolderFromModal","click .btn_open_folder":"navigateToFolder"},render:function(r){$("#center").css("overflow","auto");view=this;var t=this;var s=new e({id:r.id});s.url=s.attributes.urlRoot+r.id+"/contents";s.fetch({success:function(u){for(var w=0;w<s.attributes.folder.models.length;w++){var v=s.attributes.folder.models[w];if(v.get("type")==="file"){v.set("readable_size",t.size_to_string(v.get("file_size")))}}var y=s.full_path;var z;if(y.length===1){z=0}else{z=y[y.length-2][0]}var x=_.template(t.templateFolder(),{path:s.full_path,items:s.attributes.folder.models,id:r.id,upper_folder_id:z});t.$el.html(x)},error:function(){n.error("An error occured :(")}})},size_to_string:function(r){var s="";if(r>=100000000000){r=r/100000000000;s="TB"}else{if(r>=100000000){r=r/100000000;s="GB"}else{if(r>=100000){r=r/100000;s="MB"}else{if(r>=100){r=r/100;s="KB"}else{r=r*10;s="b"}}}}return(Math.round(r)/10)+s},navigateToFolder:function(s){var r=$(s.target).attr("data-id");if(typeof r==="undefined"){return false}else{if(r==="0"){library_router.navigate("/",{trigger:true,replace:false})}else{library_router.navigate("folders/"+r,{trigger:true,replace:false})}}},showDatasetDetails:function(u){u.preventDefault();var v=$(u.target).parent().parent().attr("id");var t=new i();var s=new p();t.id=v;var r=this;t.fetch({success:function(w){s.fetch({success:function(x){r.renderModalAfterFetch(w,x)},error:function(){n.error("An error occured during fetching histories:(");r.renderModalAfterFetch(w)}})},error:function(){n.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(w,t){var u=this.size_to_string(w.get("file_size"));var v=_.template(this.templateDatasetModal(),{item:w,size:u});var s=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Dataset Details",body:v,buttons:{Import:function(){s.importCurrentIntoHistory()},Download:function(){s.downloadCurrent()},Close:function(){s.modal.hideOrDestroy()}}});$(".peek").html(w.get("peek"));if(typeof history.models!==undefined){var r=_.template(this.templateHistorySelectInModal(),{histories:t.models});$(this.modal.elMain).find(".buttons").prepend(r);if(s.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(s.lastSelectedHistory)}}this.modal.show()},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var r=[];r.push($("#id_row").attr("data-id"));var s="/api/libraries/datasets/download/uncompressed";var t={ldda_ids:r};folderContentView.processDownload(s,t);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var t=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=t;var r=$("#id_row").attr("data-id");var u=new b();var s=this;u.url=u.urlRoot+t+"/contents";u.save({content:r,source:"library"},{success:function(){n.success("Dataset imported");s.modal.enableButton("Import");s.modal.enableButton("Download")},error:function(){n.error("An error occured! Dataset not imported. Please try again.");s.modal.enableButton("Import");s.modal.enableButton("Download")}})},selectAll:function(s){var r=s.target.checked;that=this;$(":checkbox").each(function(){this.checked=r;$row=$(this.parentElement.parentElement);(r)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(s){var u="";var r;var t;if(s.target.localName==="input"){u=s.target;r=$(s.target.parentElement.parentElement);t="input"}else{if(s.target.localName==="td"){u=$("#"+s.target.parentElement.id).find(":checkbox")[0];r=$(s.target.parentElement);t="td"}}if(u===""){s.stopPropagation();return}if(u===undefined){s.stopPropagation();return}if(u.checked){if(t==="td"){u.checked="";this.makeWhiteRow(r)}else{if(t==="input"){this.makeDarkRow(r)}}}else{if(t==="td"){u.checked="selected";this.makeDarkRow(r)}else{if(t==="input"){this.makeWhiteRow(r)}}}this.checkTools()},makeDarkRow:function(r){r.removeClass("light");r.find("a").removeClass("light");r.addClass("dark");r.find("a").addClass("dark")},makeWhiteRow:function(r){r.removeClass("dark");r.find("a").removeClass("dark");r.addClass("light");r.find("a").addClass("light")},checkTools:function(){var r=$("#folder_table").find(":checked");if(r.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var s=this;var r=new p();r.fetch({success:function(t){var u=_.template(s.templateBulkImportInModal(),{histories:t.models});s.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Import into History",body:u,buttons:{Import:function(){s.importAllIntoHistory()},Close:function(){s.modal.hideOrDestroy()}}});s.modal.show()},error:function(){n.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var t=$("select[name=dataset_import_bulk] option:selected").val();var x=$("select[name=dataset_import_bulk] option:selected").text();var z=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){z.push(this.parentElement.parentElement.id)}});var y=_.template(this.templateProgressBar(),{history_name:x});$(this.modal.elMain).find(".modal-body").html(y);var u=100/z.length;this.initProgress(u);var r=[];for(var s=z.length-1;s>=0;s--){library_dataset_id=z[s];var v=new b();var w=this;v.url=v.urlRoot+t+"/contents";v.content=library_dataset_id;v.source="library";r.push(v)}this.chainCall(r)},chainCall:function(s){var r=this;var t=s.pop();if(typeof t==="undefined"){n.success("All datasets imported");this.modal.hideOrDestroy();return}var u=$.when(t.save({content:t.content,source:t.source})).done(function(v){r.updateProgress();responses.push(v);r.chainCall(s)})},initProgress:function(r){this.progress=0;this.progressStep=r},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(r,v){var t=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){t.push(this.parentElement.parentElement.id)}});var s="/api/libraries/datasets/download/"+v;var u={ldda_ids:t};this.processDownload(s,u,"get")},processDownload:function(s,t,u){if(s&&t){t=typeof t=="string"?t:$.param(t);var r="";$.each(t.split("&"),function(){var v=this.split("=");r+='<input type="hidden" name="'+v[0]+'" value="'+v[1]+'" />'});$('<form action="'+s+'" method="'+(u||"post")+'">'+r+"</form>").appendTo("body").submit().remove();n.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){r.create_new_folder_event()},Close:function(){r.modal.hideOrDestroy();r.modal=null}}});this.modal.show()},create_new_folder_event:function(){var r=this.serialize_new_folder();if(this.validate_new_folder(r)){var t=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];t.url=t.urlRoot+"/"+current_folder_id;var s=this;t.save(r,{success:function(u){s.modal.hideOrDestroy();n.success("Folder created");s.render({id:current_folder_id})},error:function(){n.error("An error occured :(")}})}else{n.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(r){return r.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},initialize:function(){},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push("");tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');tmpl_array.push('<table class="table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th class="button_heading"></th>');tmpl_array.push(" <th>name</th>");tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" <th>model type</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><button title="Open this library" type="button" data-id="<%- library.get("root_folder_id") %>" class="btn_open_folder btn btn-default btn-xs">');tmpl_array.push(' <span class="fa fa-folder-open"></span> browse</td>');tmpl_array.push(' <td><%- library.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("model_class")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("</div>");return tmpl_array.join("")},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},render:function(){$("#center").css("overflow","auto");var r=this;libraries=new o();libraries.fetch({success:function(s){var t=_.template(r.templateLibraryList(),{libraries:s.models});r.$el.html(t)},error:function(t,s){if(s.statusCode().status===403){n.info("Please log in first. Redirecting to login page in 3s.");setTimeout(r.redirectToLogin,3000)}else{n.error("An error occured. Please try again.")}}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},modal:null,show_library_modal:function(s){s.preventDefault();s.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){r.create_new_library_event()},Close:function(){r.modal.hideOrDestroy()}}});this.modal.show()},create_new_library_event:function(){var t=this.serialize_new_library();if(this.validate_new_library(t)){var s=new f();var r=this;s.save(t,{success:function(u){r.modal.hideOrDestroy();r.clear_library_modal();r.render();n.success("Library created")},error:function(){n.error("An error occured :(")}})}else{n.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(r){return r.name!==""}});var g=Backbone.View.extend({folderContentView:null,galaxyLibraryview:null,initialize:function(){folderContentView=new m();galaxyLibraryview=new a();library_router=new q();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:folder_content",function(r){folderContentView.render({id:r})});library_router.on("route:download",function(r,s){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+r,{trigger:true,replace:true})}else{folderContentView.download(r,s);library_router.navigate("folders/"+r,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:g}});
\ No newline at end of file
+var view=null;var library_router=null;var responses=[];define(["galaxy.modal","galaxy.masthead","utils/utils","libs/toastr"],function(k,l,h,n){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var o=Backbone.Collection.extend({url:"/api/libraries",model:f});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(r){this.full_path=r[0].full_path;this.get("folder").reset(r[1].folder_contents);return r}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var p=Backbone.Collection.extend({url:"/api/histories",model:j});var q=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var m=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var r=[];r.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');r.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');r.push('<div id="library_folder_toolbar" >');r.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');r.push(' <button id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');r.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');r.push(' <button id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');r.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');r.push(" </button>");r.push(' <ul class="dropdown-menu" role="menu">');r.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');r.push(" </ul>");r.push(" </div>");r.push("</div>");r.push('<div class="library_breadcrumb">');r.push('<a title="Return to the list of libraries" href="#">Libraries</a><b>|</b> ');r.push("<% _.each(path, function(path_item) { %>");r.push("<% if (path_item[0] != id) { %>");r.push('<a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a><b>|</b> ');r.push("<% } else { %>");r.push('<span title="You are in this folder"><%- path_item[1] %></span>');r.push("<% } %>");r.push("<% }); %>");r.push("</div>");r.push('<table id="folder_table" class="table table-condensed">');r.push(" <thead>");r.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');r.push(' <th class="button_heading">view</th>');r.push(" <th>name</th>");r.push(" <th>data type</th>");r.push(" <th>size</th>");r.push(" <th>date (UTC)</th>");r.push(" </thead>");r.push(" <tbody>");r.push(" <td></td>");r.push(' <td><button title="Go to parent folder" type="button" data-id="<%- upper_folder_id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-arrow-up"></span> .. go up</td>');r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" </tr>");r.push(" <% _.each(items, function(content_item) { %>");r.push(' <tr class="folder_row light" id="<%- content_item.id %>">');r.push(' <% if (content_item.get("type") === "folder") { %>');r.push(" <td></td>");r.push(' <td><button title="Open this folder" type="button" data-id="<%- content_item.id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-folder-open"></span> browse</td>');r.push(' <td><%- content_item.get("name") %>');r.push(' <% if (content_item.get("item_count") === 0) { %>');r.push(' <span class="muted">(empty folder)</span>');r.push(" <% } %>");r.push(" </td>");r.push(" <td>folder</td>");r.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');r.push(" <% } else { %>");r.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');r.push(" <td>");r.push(' <button title="See details of this dataset" type="button" class="library-dataset btn btn-default btn-xs">');r.push(' <span class="fa fa-eye"></span> details');r.push(" </button>");r.push(" </td>");r.push(' <td><%- content_item.get("name") %></td>');r.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');r.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');r.push(" <% } %> ");r.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');r.push(" </tr>");r.push(" <% }); %>");r.push(" ");r.push(" </tbody>");r.push("</table>");r.push("</div>");return r.join("")},templateDatasetModal:function(){var r=[];r.push('<div id="dataset_info_modal">');r.push(' <table class="table table-striped table-condensed">');r.push(" <tr>");r.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');r.push(' <td><%= _.escape(item.get("name")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Data type</th>');r.push(' <td><%= _.escape(item.get("data_type")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Genome build</th>');r.push(' <td><%= _.escape(item.get("genome_build")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Size</th>');r.push(" <td><%= _.escape(size) %></td>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Date uploaded (UTC)</th>');r.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Uploaded by</th>');r.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');r.push(" </tr>");r.push(' <tr scope="row">');r.push(' <th scope="row">Data Lines</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Comment Lines</th>');r.push(' <% if (item.get("metadata_comment_lines") === "") { %>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');r.push(" <% } else { %>");r.push(' <td scope="row">unknown</td>');r.push(" <% } %>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Number of Columns</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Column Types</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Miscellaneous information</th>');r.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');r.push(" </tr>");r.push(" </table>");r.push(' <pre class="peek">');r.push(" </pre>");r.push("</div>");return r.join("")},templateHistorySelectInModal:function(){var r=[];r.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateBulkImportInModal:function(){var r=[];r.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateProgressBar:function(){var r=[];r.push('<div class="import_text">');r.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");r.push("</div>");r.push('<div class="progress">');r.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');r.push(' <span class="completion_span">0% Complete</span>');r.push(" </div>");r.push("</div>");r.push("");return r.join("")},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click .folder_row":"selectClickedRow","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click .library-dataset":"showDatasetDetails","click #toolbtn_create_folder":"createFolderFromModal","click .btn_open_folder":"navigateToFolder"},render:function(r){$("#center").css("overflow","auto");view=this;var t=this;var s=new e({id:r.id});s.url=s.attributes.urlRoot+r.id+"/contents";s.fetch({success:function(u){for(var w=0;w<s.attributes.folder.models.length;w++){var v=s.attributes.folder.models[w];if(v.get("type")==="file"){v.set("readable_size",t.size_to_string(v.get("file_size")))}}var y=s.full_path;var z;if(y.length===1){z=0}else{z=y[y.length-2][0]}var x=_.template(t.templateFolder(),{path:s.full_path,items:s.attributes.folder.models,id:r.id,upper_folder_id:z});t.$el.html(x)},error:function(){n.error("An error occured :(")}})},size_to_string:function(r){var s="";if(r>=100000000000){r=r/100000000000;s="TB"}else{if(r>=100000000){r=r/100000000;s="GB"}else{if(r>=100000){r=r/100000;s="MB"}else{if(r>=100){r=r/100;s="KB"}else{r=r*10;s="b"}}}}return(Math.round(r)/10)+s},navigateToFolder:function(s){var r=$(s.target).attr("data-id");if(typeof r==="undefined"){return false}else{if(r==="0"){library_router.navigate("/",{trigger:true,replace:false})}else{library_router.navigate("folders/"+r,{trigger:true,replace:false})}}},showDatasetDetails:function(u){u.preventDefault();var v=$(u.target).parent().parent().attr("id");var t=new i();var s=new p();t.id=v;var r=this;t.fetch({success:function(w){s.fetch({success:function(x){r.renderModalAfterFetch(w,x)},error:function(){n.error("An error occured during fetching histories:(");r.renderModalAfterFetch(w)}})},error:function(){n.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(w,t){var u=this.size_to_string(w.get("file_size"));var v=_.template(this.templateDatasetModal(),{item:w,size:u});var s=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Dataset Details",body:v,buttons:{Import:function(){s.importCurrentIntoHistory()},Download:function(){s.downloadCurrent()},Close:function(){s.modal.hideOrDestroy()}}});$(".peek").html(w.get("peek"));if(typeof history.models!==undefined){var r=_.template(this.templateHistorySelectInModal(),{histories:t.models});$(this.modal.elMain).find(".buttons").prepend(r);if(s.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(s.lastSelectedHistory)}}this.modal.show()},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var r=[];r.push($("#id_row").attr("data-id"));var s="/api/libraries/datasets/download/uncompressed";var t={ldda_ids:r};folderContentView.processDownload(s,t);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var t=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=t;var r=$("#id_row").attr("data-id");var u=new b();var s=this;u.url=u.urlRoot+t+"/contents";u.save({content:r,source:"library"},{success:function(){n.success("Dataset imported");s.modal.enableButton("Import");s.modal.enableButton("Download")},error:function(){n.error("An error occured! Dataset not imported. Please try again.");s.modal.enableButton("Import");s.modal.enableButton("Download")}})},selectAll:function(s){var r=s.target.checked;that=this;$(":checkbox").each(function(){this.checked=r;$row=$(this.parentElement.parentElement);(r)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(s){var u="";var r;var t;if(s.target.localName==="input"){u=s.target;r=$(s.target.parentElement.parentElement);t="input"}else{if(s.target.localName==="td"){u=$("#"+s.target.parentElement.id).find(":checkbox")[0];r=$(s.target.parentElement);t="td"}}if(u===""){s.stopPropagation();return}if(u===undefined){s.stopPropagation();return}if(u.checked){if(t==="td"){u.checked="";this.makeWhiteRow(r)}else{if(t==="input"){this.makeDarkRow(r)}}}else{if(t==="td"){u.checked="selected";this.makeDarkRow(r)}else{if(t==="input"){this.makeWhiteRow(r)}}}this.checkTools()},makeDarkRow:function(r){r.removeClass("light");r.find("a").removeClass("light");r.addClass("dark");r.find("a").addClass("dark")},makeWhiteRow:function(r){r.removeClass("dark");r.find("a").removeClass("dark");r.addClass("light");r.find("a").addClass("light")},checkTools:function(){var r=$("#folder_table").find(":checked");if(r.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var s=this;var r=new p();r.fetch({success:function(t){var u=_.template(s.templateBulkImportInModal(),{histories:t.models});s.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Import into History",body:u,buttons:{Import:function(){s.importAllIntoHistory()},Close:function(){s.modal.hideOrDestroy()}}});s.modal.show()},error:function(){n.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var t=$("select[name=dataset_import_bulk] option:selected").val();var x=$("select[name=dataset_import_bulk] option:selected").text();var z=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){z.push(this.parentElement.parentElement.id)}});var y=_.template(this.templateProgressBar(),{history_name:x});$(this.modal.elMain).find(".modal-body").html(y);var u=100/z.length;this.initProgress(u);var r=[];for(var s=z.length-1;s>=0;s--){library_dataset_id=z[s];var v=new b();var w=this;v.url=v.urlRoot+t+"/contents";v.content=library_dataset_id;v.source="library";r.push(v)}this.chainCall(r)},chainCall:function(s){var r=this;var t=s.pop();if(typeof t==="undefined"){n.success("All datasets imported");this.modal.hideOrDestroy();return}var u=$.when(t.save({content:t.content,source:t.source})).done(function(v){r.updateProgress();responses.push(v);r.chainCall(s)})},initProgress:function(r){this.progress=0;this.progressStep=r},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(r,v){var t=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){t.push(this.parentElement.parentElement.id)}});var s="/api/libraries/datasets/download/"+v;var u={ldda_ids:t};this.processDownload(s,u,"get")},processDownload:function(s,t,u){if(s&&t){t=typeof t=="string"?t:$.param(t);var r="";$.each(t.split("&"),function(){var v=this.split("=");r+='<input type="hidden" name="'+v[0]+'" value="'+v[1]+'" />'});$('<form action="'+s+'" method="'+(u||"post")+'">'+r+"</form>").appendTo("body").submit().remove();n.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){r.create_new_folder_event()},Close:function(){r.modal.hideOrDestroy();r.modal=null}}});this.modal.show()},create_new_folder_event:function(){var r=this.serialize_new_folder();if(this.validate_new_folder(r)){var t=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];t.url=t.urlRoot+"/"+current_folder_id;var s=this;t.save(r,{success:function(u){s.modal.hideOrDestroy();n.success("Folder created");s.render({id:current_folder_id})},error:function(){n.error("An error occured :(")}})}else{n.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(r){return r.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},initialize:function(){},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push("");tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');tmpl_array.push('<table class="table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th class="button_heading"></th>');tmpl_array.push(" <th>name</th>");tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" <th>model type</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><button title="Open this library" type="button" data-id="<%- library.get("root_folder_id") %>" class="btn_open_folder btn btn-default btn-xs">');tmpl_array.push(' <span class="fa fa-folder-open"></span> browse</td>');tmpl_array.push(' <td><%- library.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("model_class")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("</div>");return tmpl_array.join("")},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},render:function(){$("#center").css("overflow","auto");var r=this;libraries=new o();libraries.fetch({success:function(s){var t=_.template(r.templateLibraryList(),{libraries:s.models});r.$el.html(t)},error:function(t,s){if(s.statusCode().status===403){n.info("Please log in first. Redirecting to login page in 3s.");setTimeout(r.redirectToLogin,3000)}else{n.error("An error occured. Please try again.")}}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},modal:null,show_library_modal:function(s){s.preventDefault();s.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){r.create_new_library_event()},Close:function(){r.modal.hideOrDestroy()}}});this.modal.show()},create_new_library_event:function(){var t=this.serialize_new_library();if(this.validate_new_library(t)){var s=new f();var r=this;s.save(t,{success:function(u){r.modal.hideOrDestroy();r.clear_library_modal();r.render();n.success("Library created")},error:function(){n.error("An error occured :(")}})}else{n.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(r){return r.name!==""}});var g=Backbone.View.extend({folderContentView:null,galaxyLibraryview:null,initialize:function(){folderContentView=new m();galaxyLibraryview=new a();library_router=new q();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:folder_content",function(r){folderContentView.render({id:r})});library_router.on("route:download",function(r,s){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+r,{trigger:true,replace:true})}else{folderContentView.download(r,s);library_router.navigate("folders/"+r,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:g}});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/galaxy.masthead.js
--- a/static/scripts/packed/galaxy.masthead.js
+++ b/static/scripts/packed/galaxy.masthead.js
@@ -1,1 +1,1 @@
-define(["utils/galaxy.utils"],function(c){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(f){this.options=f;$("body").off();this.setElement($(this._template(f)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var e=this;window.onbeforeunload=function(){var h="";for(key in e.list){if(e.list[key].options.on_unload){var g=e.list[key].options.on_unload();if(g){h+=g+" "}}}if(h!=""){return h}}},events:{click:"_click",mousedown:function(f){f.preventDefault()}},append:function(e){return this._add(e,true)},prepend:function(e){return this._add(e,false)},highlight:function(f){var e=$(this.el).find("#"+f+"> li");if(e){e.addClass("active")}},_add:function(h,f){var e=$(this.el).find("#"+h.location);if(e){var g=$(h.el);g.addClass("masthead-item");if(f){e.append(g)}else{e.prepend(g)}this.list.push(h)}return null},_click:function(h){var g=$(this.el).find(".popup");if(g){g.hide()}var f=$(h.target).closest(".masthead-item").find(".popup");if($(h.target).hasClass("head")){f.show();this.$background.show()}else{this.$background.hide()}},_template:function(e){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+e.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+e.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},location:"iconbar",initialize:function(f){if(f){this.options=_.defaults(f,this.options)}this.setElement($(this._template(this.options)));var e=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",e.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(e){$(this.el).find(".icon").removeClass(this.options.icon).addClass(e);this.options.icon=e},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(e){$(this.el).find(".number").text(e)},_template:function(f){var e='<div id="'+f.id+'" class="symbol"><div class="icon fa fa-2x '+f.icon+'"></div>';if(f.with_number){e+='<div class="number"></div>'}e+="</div>";return e}});var d=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(e){if(e){this.options=_.defaults(e,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(g){var h={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(g){h=_.defaults(g,h)}if(h.content&&h.content.indexOf("//")===-1){h.content=galaxy_config.root+h.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var f=$(this._templateMenuItem(h));this.$menu.append(f);var e=this;f.on("click",function(i){i.preventDefault();if(e.options.target==="_blank"){return true}Galaxy.frame.add(g)});if(h.divider){this.$menu.append($(this._templateDivider()))}},_head:function(f){f.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var e=$(this.el).find(".head");e.popover({html:true,content:'Please <a href="/user/login">log in</a> or <a href="/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){e.popover("hide")},5000)})},_templateMenuItem:function(e){return'<li><a href="'+e.content+'" target="'+e.target+'">'+e.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(f){var e='<ul id="'+f.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+f.target+'" href="'+f.content+'" title="'+f.title_attribute+'">'+f.title+'<b class="symbol"></b></a></li></ul>';return e}});return{GalaxyMasthead:a,GalaxyMastheadTab:d,GalaxyMastheadIcon:b}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({el_masthead:"#everything",options:null,$background:null,list:[],initialize:function(e){this.options=e;$("body").off();this.setElement($(this._template(e)));$(this.el_masthead).append($(this.el));this.$background=$(this.el).find("#masthead-background");var d=this;window.onbeforeunload=function(){var g="";for(key in d.list){if(d.list[key].options.on_unload){var f=d.list[key].options.on_unload();if(f){g+=f+" "}}}if(g!=""){return g}}},events:{click:"_click",mousedown:function(d){d.preventDefault()}},append:function(d){return this._add(d,true)},prepend:function(d){return this._add(d,false)},highlight:function(e){var d=$(this.el).find("#"+e+"> li");if(d){d.addClass("active")}},_add:function(g,e){var d=$(this.el).find("#"+g.location);if(d){var f=$(g.el);f.addClass("masthead-item");if(e){d.append(f)}else{d.prepend(f)}this.list.push(g)}return null},_click:function(g){var f=$(this.el).find(".popup");if(f){f.hide()}var d=$(g.target).closest(".masthead-item").find(".popup");if($(g.target).hasClass("head")){d.show();this.$background.show()}else{this.$background.hide()}},_template:function(d){return'<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse"><div style="position: relative; right: -50%; float: left;"><div id="navbar" style="display: block; position: relative; right: 50%;"></div></div><div class="navbar-brand"><a href="'+d.logo_url+'"><img border="0" src="'+galaxy_config.root+'static/images/galaxyIcon_noText.png"><span id="brand"> Galaxy '+d.brand+'</span></a></div><div class="quota-meter-container"></div><div id="iconbar" class="iconbar"></div></div><div id="masthead-background" style="display: none; position: absolute; top: 33px; width: 100%; height: 100%; z-index: 1010"></div></div>'}});var b=Backbone.View.extend({options:{id:"",icon:"fa-cog",tooltip:"",with_number:false,on_click:function(){alert("clicked")},on_unload:null,visible:true},location:"iconbar",initialize:function(e){if(e){this.options=_.defaults(e,this.options)}this.setElement($(this._template(this.options)));var d=this;$(this.el).find(".icon").tooltip({title:this.options.tooltip,placement:"bottom"}).on("mouseup",d.options.on_click);if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},icon:function(d){$(this.el).find(".icon").removeClass(this.options.icon).addClass(d);this.options.icon=d},toggle:function(){$(this.el).addClass("toggle")},untoggle:function(){$(this.el).removeClass("toggle")},number:function(d){$(this.el).find(".number").text(d)},_template:function(e){var d='<div id="'+e.id+'" class="symbol"><div class="icon fa fa-2x '+e.icon+'"></div>';if(e.with_number){d+='<div class="number"></div>'}d+="</div>";return d}});var c=Backbone.View.extend({options:{id:"",title:"",target:"_parent",content:"",type:"url",scratchbook:false,on_unload:null,visible:true,disabled:false,title_attribute:""},location:"navbar",$menu:null,events:{"click .head":"_head"},initialize:function(d){if(d){this.options=_.defaults(d,this.options)}if(this.options.content&&this.options.content.indexOf("//")===-1){this.options.content=galaxy_config.root+this.options.content}this.setElement($(this._template(this.options)));if(this.options.disabled){$(this.el).find(".root").addClass("disabled");this._attachPopover()}if(!this.options.visible){this.hide()}},show:function(){$(this.el).css({visibility:"visible"})},hide:function(){$(this.el).css({visibility:"hidden"})},add:function(f){var g={title:"Title",content:"",type:"url",target:"_parent",scratchbook:false,divider:false};if(f){g=_.defaults(f,g)}if(g.content&&g.content.indexOf("//")===-1){g.content=galaxy_config.root+g.content}if(!this.$menu){$(this.el).find(".root").append(this._templateMenu());$(this.el).find(".symbol").addClass("caret");this.$menu=$(this.el).find(".popup")}var e=$(this._templateMenuItem(g));this.$menu.append(e);var d=this;e.on("click",function(h){h.preventDefault();if(d.options.target==="_blank"){return true}Galaxy.frame.add(f)});if(g.divider){this.$menu.append($(this._templateDivider()))}},_head:function(d){d.preventDefault();if(this.options.disabled){return}if(!this.$menu){Galaxy.frame.add(this.options)}},_attachPopover:function(){var d=$(this.el).find(".head");d.popover({html:true,content:'Please <a href="/user/login">log in</a> or <a href="/user/create">register</a> to use this feature.',placement:"bottom"}).on("shown.bs.popover",function(){setTimeout(function(){d.popover("hide")},5000)})},_templateMenuItem:function(d){return'<li><a href="'+d.content+'" target="'+d.target+'">'+d.title+"</a></li>"},_templateMenu:function(){return'<ul class="popup dropdown-menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var d='<ul id="'+e.id+'" class="nav navbar-nav" border="0" cellspacing="0"><li class="root dropdown" style=""><a class="head dropdown-toggle" data-toggle="dropdown" target="'+e.target+'" href="'+e.content+'" title="'+e.title_attribute+'">'+e.title+'<b class="symbol"></b></a></li></ul>';return d}});return{GalaxyMasthead:a,GalaxyMastheadTab:c,GalaxyMastheadIcon:b}});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/galaxy.upload.js
--- a/static/scripts/packed/galaxy.upload.js
+++ /dev/null
@@ -1,1 +0,0 @@
-define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","utils/galaxy.uploadbox"],function(b,c,d){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],state:{init:"fa fa-trash-o",queued:"fa fa-spinner fa-spin",running:"__running__",success:"fa fa-check",error:"fa fa-exclamation-triangle"},counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(f){if(!Galaxy.currHistoryPanel){var e=this;window.setTimeout(function(){e.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}var e=this;this.button_show=new c.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(g){e.event_show(g)},on_unload:function(){if(e.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var e=this;d.jsonFromUrl(galaxy_config.root+"api/datatypes",function(g){for(key in g){e.select_extension.push([g[key],g[key]])}});d.jsonFromUrl(galaxy_config.root+"api/genomes",function(g){var h=e.select_genome[0];e.select_genome=[];for(key in g){if(g[key].length>1){if(g[key][1]!==h[1]){e.select_genome.push(g[key])}}}e.select_genome.sort(function(j,i){return j[0]>i[0]?1:j[0]<i[0]?-1:0});e.select_genome.unshift(h)});if(f){this.options=_.defaults(f,this.options)}},event_dragover:function(f){},event_dragleave:function(f){},event_announce:function(i,g,n){var f="#upload-"+i;$(this.el).find("tbody:last").append(this.template_row(f));var h=this.get_upload_item(i);h.fadeIn();h.find("#title").html(g.name);h.find("#size").html(this.size_to_string(g.size));var m=this;h.find("#symbol").on("click",function(){m.event_remove(i)});h.find("#text-content").on("keyup",function(){var o=h.find("#text-content").val().length;h.find("#size").html(m.size_to_string(o))});var m=this;h.find("#genome").on("change",function(q){var p=$(q.target).val();var o=$(m.el).find(".upload-item");o.each(function(){var s=$(this).find("#symbol");var r=$(this).find("#genome");if(s.hasClass(m.state.init)&&r.val()=="?"){r.val(p)}})});this.event_progress(i,g,0);this.counter.announce++;this.update_screen();if(g.size==-1){var l=h.find("#text");var j=8;var e=h.width()-2*j;var k=h.height()-j;l.css("width",e+"px");l.css("top",k+"px");h.height(k+l.height()+2*j);l.show()}},event_initialize:function(i,e,m){this.button_show.number(this.counter.announce);var g=this.get_upload_item(i);var j=g.find("#symbol");j.addClass(this.state.running);var f=g.find("#extension").val();var l=g.find("#genome").val();var k=g.find("#text-content").val();var h=g.find("#space_to_tabs").is(":checked");if(!k&&!(e.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=l;tool_input.file_type=f;tool_input["files_0|NAME"]=e.name;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=k;tool_input.space_to_tabs=h;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},event_progress:function(f,g,i){var h=this.get_upload_item(f);var e=parseInt(i);h.find(".progress-bar").css({width:e+"%"});if(e!=100){h.find("#percentage").html(e+"%")}else{h.find("#percentage").html("Adding to history...")}},event_success:function(e,f,h){this.event_progress(e,f,100);this.button_show.number("");this.counter.announce--;this.counter.success++;this.update_screen();var g=this.get_upload_item(e);g.addClass("success");g.find("#percentage").html("100%");var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.success);Galaxy.currHistoryPanel.refreshHdas()},event_error:function(e,f,h){this.event_progress(e,f,0);this.button_show.number("");this.counter.announce--;this.counter.error++;this.update_screen();var g=this.get_upload_item(e);g.addClass("danger");g.find(".progress").remove();g.find("#info").html("<strong>Failed: </strong>"+h).show();var i=g.find("#symbol");i.removeClass(this.state.running);i.removeClass(this.state.queued);i.addClass(this.state.error)},event_start:function(){if(this.counter.announce==0||this.counter.running>0){return}var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.init)){g.removeClass(e.state.init);g.addClass(e.state.queued);$(this).find("#text-content").attr("disabled",true);$(this).find("#genome").attr("disabled",true);$(this).find("#extension").attr("disabled",true);$(this).find("#space_to_tabs").attr("disabled",true)}});this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this.update_screen();this.uploadbox.start()},event_stop:function(){if(this.counter.running==0){return}this.uploadbox.stop();$("#upload-info").html("Queue will pause after completing the current file...")},event_complete:function(){this.counter.running=0;this.update_screen();var f=$(this.el).find(".upload-item");var e=this;f.each(function(){var g=$(this).find("#symbol");if(g.hasClass(e.state.queued)&&!g.hasClass(e.state.running)){g.removeClass(e.state.queued);g.addClass(e.state.init);$(this).find("#text-content").attr("disabled",false);$(this).find("#genome").attr("disabled",false);$(this).find("#extension").attr("disabled",false);$(this).find("#space_to_tabs").attr("disabled",false)}})},event_reset:function(){if(this.counter.running==0){var e=$(this.el).find(".upload-item");$(this.el).find("table").fadeOut({complete:function(){e.remove()}});this.counter.reset();this.update_screen();this.uploadbox.reset()}},event_remove:function(e){var f=this.get_upload_item(e);var g=f.find("#symbol");if(g.hasClass(this.state.init)||g.hasClass(this.state.success)||g.hasClass(this.state.error)){if(f.hasClass("success")){this.counter.success--}else{if(f.hasClass("danger")){this.counter.error--}else{this.counter.announce--}}this.update_screen();this.uploadbox.remove(e);f.remove()}},event_create:function(){this.uploadbox.add([{name:"New File",size:-1}])},event_show:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f.event_create()},Upload:function(){f.event_start()},Pause:function(){f.event_stop()},Reset:function(){f.event_reset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({dragover:function(){f.event_dragover()},dragleave:function(){f.event_dragleave()},announce:function(e,h,i){f.event_announce(e,h,i)},initialize:function(e,h,i){return f.event_initialize(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},complete:function(){f.event_complete()},});this.update_screen()}this.modal.show()},get_upload_item:function(e){return $(this.el).find("#upload-"+e)},size_to_string:function(e){var f="";if(e>=100000000000){e=e/100000000000;f="TB"}else{if(e>=100000000){e=e/100000000;f="GB"}else{if(e>=100000){e=e/100000;f="MB"}else{if(e>=100){e=e/100;f="KB"}else{if(e>0){e=e*10;f="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(e)/10)+"</strong> "+f},update_screen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},template:function(f,e){return'<div id="'+f+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+e+'" class="upload-info"></h6>'},template_row:function(f){var e='<tr id="'+f.substr(1)+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';e+='<td><select id="extension" class="extension">';for(key in this.select_extension){e+='<option value="'+this.select_extension[key][1]+'">'+this.select_extension[key][0]+"</option>"}e+="</select></td>";e+='<td><select id="genome" class="genome">';for(key in this.select_genome){e+='<option value="'+this.select_genome[key][1]+'">'+this.select_genome[key][0]+"</option>"}e+="</select></td>";e+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="symbol '+this.state.init+'"></div></td></tr>';return e}});return{GalaxyUpload:a}});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/mvc/upload/upload-model.js
--- /dev/null
+++ b/static/scripts/packed/mvc/upload/upload-model.js
@@ -0,0 +1,1 @@
+define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",space_to_tabs:false,status:"init",info:null}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/mvc/upload/upload-row.js
--- /dev/null
+++ b/static/scripts/packed/mvc/upload/upload-row.js
@@ -0,0 +1,1 @@
+define(["mvc/upload/upload-model"],function(a){return Backbone.View.extend({options:{padding:8},status_classes:{init:"symbol fa fa-trash-o",queued:"symbol fa fa-spinner fa-spin",success:"symbol fa fa-check",error:"symbol fa fa-exclamation-triangle"},initialize:function(e,c){this.app=e;var b=this;this.model=new a.Model(c);this.setElement(this._template(c));var d=this.$el;d.find("#symbol").on("click",function(){var f=b.model.get("status");if(f=="init"||f=="success"||f=="error"){b.app.collection.remove(b.model)}});d.find("#text-content").on("keyup",function(){var f=d.find("#text-content");var h=f.val();var g=h.length;d.find("#size").html(b._formatSize(g));b.model.set("url_paste",h)});d.find("#genome").on("change",function(f){b.model.set("genome",$(f.target).val())});d.find("#extension").on("change",function(f){b.model.set("extension",$(f.target).val())});d.find("#space_to_tabs").on("change",function(f){b.model.set("space_to_tabs",$(f.target).prop("checked"))});this.model.on("change:percentage",function(){b._refreshPercentage()});this.model.on("change:status",function(){b._refreshStatus()});this.model.on("change:info",function(){b._refreshInfo()});this.model.on("remove",function(){b.remove()});this.app.collection.on("reset",function(){b.remove()})},render:function(){var h=this.model.get("file_name");var c=this.model.get("file_size");var e=this.$el;e.find("#title").html(h);e.find("#size").html(this._formatSize(c));if(c==-1){var g=e.find("#text");var f=this.options.padding;var d=e.width()-2*f;var b=e.height()-f;g.css("width",d+"px");g.css("top",b+"px");e.height(b+g.height()+2*f);g.show()}},_refreshInfo:function(){var b=this.model.get("info");if(b){this.$el.find("#info").html("<strong>Failed: </strong>"+b).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var b=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:b+"%"});if(b!=100){this.$el.find("#percentage").html(b+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var c=this.$el;var b=this.model.get("status");var e=this.status_classes[b];var d=this.$el.find("#symbol");d.removeClass();d.addClass(e);if(b=="init"){c.find("#text-content").attr("disabled",false);c.find("#genome").attr("disabled",false);c.find("#extension").attr("disabled",false);c.find("#space_to_tabs").attr("disabled",false)}else{c.find("#text-content").attr("disabled",true);c.find("#genome").attr("disabled",true);c.find("#extension").attr("disabled",true);c.find("#space_to_tabs").attr("disabled",true)}if(b=="success"){c.addClass("success");c.find("#percentage").html("100%")}if(b=="error"){c.addClass("danger");c.find(".progress").remove()}},_formatSize:function(b){var c="";if(b>=100000000000){b=b/100000000000;c="TB"}else{if(b>=100000000){b=b/100000000;c="GB"}else{if(b>=100000){b=b/100000;c="MB"}else{if(b>=100){b=b/100;c="KB"}else{if(b>0){b=b*10;c="b"}else{return"<strong>-</strong>"}}}}}return"<strong>"+(Math.round(b)/10)+"</strong> "+c},_template:function(d){var c=this;var b='<tr id="upload-item-'+d.id+'" class="upload-item"><td><div style="position: relative;"><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You may specify a list of URLs (one per line) or paste the contents of a file.</div><textarea id="text-content" class="text-content form-control"></textarea></div></div></td><td><div id="size" class="size"></div></td>';b+='<td><select id="extension" class="extension">';for(key in c.app.select_extension){b+='<option value="'+c.app.select_extension[key][1]+'">'+c.app.select_extension[key][0]+"</option>"}b+="</select></td>";b+='<td><select id="genome" class="genome">';for(key in c.app.select_genome){b+='<option value="'+c.app.select_genome[key][1]+'">'+c.app.select_genome[key][0]+"</option>"}b+="</select></td>";b+='<td><input id="space_to_tabs" type="checkbox"></input></td><td><div id="info" class="info"><div class="progress"><div class="progress-bar progress-bar-success"></div><div id="percentage" class="percentage">0%</div></div></div></td><td><div id="symbol" class="'+this.status_classes.init+'"></div></td></tr>';return b}})});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/mvc/upload/upload-view.js
--- /dev/null
+++ b/static/scripts/packed/mvc/upload/upload-view.js
@@ -0,0 +1,1 @@
+define(["galaxy.modal","galaxy.masthead","utils/utils","mvc/upload/upload-model","mvc/upload/upload-row","utils/uploadbox"],function(a,d,e,c,b){return Backbone.View.extend({modal:null,button_show:null,uploadbox:null,current_history:null,select_extension:[["Auto-detect","auto"]],select_genome:[["Unspecified (?)","?"]],collection:new c.Collection(),counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},options:{nginx_upload_path:""},initialize:function(g){var f=this;if(!Galaxy.currHistoryPanel){window.setTimeout(function(){f.initialize()},500);return}if(!Galaxy.currUser.get("id")){return}this.button_show=new d.GalaxyMastheadIcon({icon:"fa-arrow-circle-o-up",tooltip:"Upload Files",on_click:function(h){f._eventShow(h)},on_unload:function(){if(f.counter.running>0){return"Several uploads are still processing."}},with_number:true});Galaxy.masthead.prepend(this.button_show);var f=this;e.jsonFromUrl(galaxy_config.root+"api/datatypes",function(h){for(key in h){f.select_extension.push([h[key],h[key]])}});e.jsonFromUrl(galaxy_config.root+"api/genomes",function(h){var i=f.select_genome[0];f.select_genome=[];for(key in h){if(h[key].length>1){if(h[key][1]!==i[1]){f.select_genome.push(h[key])}}}f.select_genome.sort(function(k,j){return k[0]>j[0]?1:k[0]<j[0]?-1:0});f.select_genome.unshift(i)});if(g){this.options=_.defaults(g,this.options)}this.collection.on("remove",function(h){f._eventRemove(h)});this.collection.on("change",function(h){console.log("here")})},_eventShow:function(g){g.preventDefault();if(!this.modal){var f=this;this.modal=new a.GalaxyModal({title:"Upload files from your local drive",body:this._template("upload-box","upload-info"),buttons:{Select:function(){f.uploadbox.select()},Create:function(){f._eventCreate()},Upload:function(){f._eventStart()},Pause:function(){f._eventStop()},Reset:function(){f._eventReset()},Close:function(){f.modal.hide()},},height:"400",width:"900"});this.setElement("#upload-box");var f=this;this.uploadbox=this.$el.uploadbox({announce:function(h,i,j){f._eventAnnounce(h,i,j)},initialize:function(h,i,j){return f._eventInitialize(h,i,j)},progress:function(h,i,j){f._eventProgress(h,i,j)},success:function(h,i,j){f._eventSuccess(h,i,j)},error:function(h,i,j){f._eventError(h,i,j)},complete:function(){f._eventComplete()}});this._updateScreen()}this.modal.show()},_eventRemove:function(g){var f=g.get("status");if(f=="success"){this.counter.success--}else{if(f=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(g.id)},_eventAnnounce:function(f,g,i){this.counter.announce++;this._updateScreen();var h=new b(this,{id:f,file_name:g.name,file_size:g.size});this.collection.add(h.model);$(this.el).find("tbody:last").append(h.$el);h.render()},_eventInitialize:function(j,f,n){var h=this.collection.get(j);h.set("state","running");this.button_show.number(this.counter.announce);var g=h.get("extension");var k=h.get("file_name");var m=h.get("genome");var l=h.get("url_paste");var i=h.get("space_to_tabs");if(!l&&!(f.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path,paramname:"files_0|file_data"});tool_input={};tool_input.dbkey=m;tool_input.file_type=g;tool_input["files_0|NAME"]=k;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|url_paste"]=l;tool_input.space_to_tabs=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(g,h,f){var i=this.collection.get(g);i.set("percentage",f)},_eventSuccess:function(f,g,i){var h=this.collection.get(f);h.set("status","success");this.button_show.number("");this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshHdas()},_eventError:function(f,g,i){var h=this.collection.get(f);h.set("status","error");h.set("info",i);this.button_show.number("");this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(f){if(f.get("status")=="queued"){f.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:-1}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}this.collection.each(function(f){if(f.get("status")=="init"){f.set("status","queued")}});this.current_history=Galaxy.currHistoryPanel.model.get("id");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}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()}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="Drag&drop files into this box or click 'Select' to select files!"}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."}}else{if(this.counter.running==0){message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Upload' to proceed."}else{message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining."}}$("#upload-info").html(message);if(this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0){this.modal.enableButton("Reset")}else{this.modal.disableButton("Reset")}if(this.counter.running==0&&this.counter.announce>0){this.modal.enableButton("Upload")}else{this.modal.disableButton("Upload")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Select");this.modal.enableButton("Create")}else{this.modal.disableButton("Select");this.modal.disableButton("Create")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("table").show()}else{$(this.el).find("table").hide()}},_template:function(g,f){return'<div id="'+g+'" class="upload-box"><table class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Space→Tab</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><h6 id="'+f+'" class="upload-info"></h6>'}})});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/utils/galaxy.uploadbox.js
--- a/static/scripts/packed/utils/galaxy.uploadbox.js
+++ /dev/null
@@ -1,1 +0,0 @@
-(function(c){jQuery.event.props.push("dataTransfer");var h={url:"",paramname:"content",maxfilesize:2048,maxfilenumber:20,dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(k,l,m){alert(m)},complete:function(){},error_filesize:"File exceeds 2GB. Please use an FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in.",error_missing:"No upload content available."};var a={};var e={};var f=0;var j=0;var d=false;var g=false;var b=null;var i=null;c.fn.uploadbox=function(A){a=c.extend({},h,A);b=this;b.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');b.on("drop",o);b.on("dragover",p);b.on("dragleave",x);c("#uploadbox_input").change(function(B){z(B.target.files);c(this).val("")});function o(B){if(!B.dataTransfer){return}z(B.dataTransfer.files);B.preventDefault();return false}function p(B){B.preventDefault();a.dragover.call(B)}function x(B){B.stopPropagation();a.dragleave.call(B)}function k(B){if(B.lengthComputable){a.progress(this.index,this.file,Math.round((B.loaded*100)/B.total))}}function z(D){if(d){return}for(var C=0;C<D.length;C++){if(j>=a.maxfilenumber){break}var B=String(f++);e[B]=D[C];a.announce(B,e[B],"");j++}}function r(B){if(e[B]){delete e[B];j--}}function m(){if(j==0||g){g=false;d=false;a.complete();return}else{d=true}var D=-1;for(var F in e){D=F;break}var E=e[D];r(D);var C=E.size;var B=1048576*a.maxfilesize;if(C<B){var G=a.initialize(D,E);if(G){q(D,E,G)}else{u(D,E,a.error_missing)}}else{u(D,E,a.error_filesize)}}function q(B,D,E){var F=new FormData();for(var C in E){F.append(C,E[C])}if(D.size>0){F.append(a.paramname,D,D.name)}i=new XMLHttpRequest();i.open("POST",a.url,true);i.setRequestHeader("Accept","application/json");i.setRequestHeader("Cache-Control","no-cache");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.onreadystatechange=function(){if(i.readyState!=i.DONE){return}var G=null;if(i.responseText){try{G=jQuery.parseJSON(i.responseText)}catch(H){G=i.responseText}}if(i.status<200||i.status>299){var I=i.statusText;if(i.status==403){I=a.error_login}else{if(i.status==0){I=a.error_server}else{if(!I){I=a.error_default}}}u(B,D,I+" ("+i.status+")")}else{y(B,D,G)}};i.upload.index=B;i.upload.file=D;i.upload.addEventListener("progress",k,false);i.send(F)}function y(B,C,D){a.success(B,C,D);m()}function u(B,C,D){a.error(B,C,D);m()}function w(){c("#uploadbox_input").trigger("click")}function t(B){for(B in e){r(B)}}function l(){if(!d){d=true;m()}}function v(){g=true}function n(B){a=c.extend({},a,B);return a}function s(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}return{select:w,add:z,remove:r,start:l,stop:v,reset:t,configure:n,compatible:s}}})(jQuery);
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/utils/galaxy.utils.js
--- a/static/scripts/packed/utils/galaxy.utils.js
+++ /dev/null
@@ -1,1 +0,0 @@
-define(["libs/underscore"],function(c){function d(g,f,e){var h=new XMLHttpRequest();h.open("GET",g,true);h.setRequestHeader("Accept","application/json");h.setRequestHeader("Cache-Control","no-cache");h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.onloadend=function(){var i=h.status;if(i==200){try{response=jQuery.parseJSON(h.responseText)}catch(j){response=h.responseText}f&&f(response)}else{e&&e(i)}};h.send()}function b(h,e){var f=$('<div class="'+h+'"></div>');f.appendTo(":eq(0)");var g=f.css(e);f.remove();return g}function a(e){if(!$('link[href^="'+e+'"]').length){$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:d}});
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/utils/uploadbox.js
--- /dev/null
+++ b/static/scripts/packed/utils/uploadbox.js
@@ -0,0 +1,1 @@
+(function(c){jQuery.event.props.push("dataTransfer");var h={url:"",paramname:"content",maxfilesize:2048,maxfilenumber:20,dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(k,l,m){alert(m)},complete:function(){},error_filesize:"File exceeds 2GB. Please use an FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in.",error_missing:"No upload content available."};var a={};var e={};var f=0;var j=0;var d=false;var g=false;var b=null;var i=null;c.fn.uploadbox=function(A){a=c.extend({},h,A);b=this;b.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');b.on("drop",o);b.on("dragover",p);b.on("dragleave",x);c("#uploadbox_input").change(function(B){z(B.target.files);c(this).val("")});function o(B){if(!B.dataTransfer){return}z(B.dataTransfer.files);B.preventDefault();return false}function p(B){B.preventDefault();a.dragover.call(B)}function x(B){B.stopPropagation();a.dragleave.call(B)}function k(B){if(B.lengthComputable){a.progress(this.index,this.file,Math.round((B.loaded*100)/B.total))}}function z(D){if(d){return}for(var C=0;C<D.length;C++){if(j>=a.maxfilenumber){break}var B=String(f++);e[B]=D[C];a.announce(B,e[B],"");j++}}function r(B){if(e[B]){delete e[B];j--}}function m(){if(j==0||g){g=false;d=false;a.complete();return}else{d=true}var D=-1;for(var F in e){D=F;break}var E=e[D];r(D);var C=E.size;var B=1048576*a.maxfilesize;if(C<B){var G=a.initialize(D,E);if(G){q(D,E,G)}else{u(D,E,a.error_missing)}}else{u(D,E,a.error_filesize)}}function q(B,D,E){var F=new FormData();for(var C in E){F.append(C,E[C])}if(D.size>0){F.append(a.paramname,D,D.name)}i=new XMLHttpRequest();i.open("POST",a.url,true);i.setRequestHeader("Accept","application/json");i.setRequestHeader("Cache-Control","no-cache");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.onreadystatechange=function(){if(i.readyState!=i.DONE){return}var G=null;if(i.responseText){try{G=jQuery.parseJSON(i.responseText)}catch(H){G=i.responseText}}if(i.status<200||i.status>299){var I=i.statusText;if(i.status==403){I=a.error_login}else{if(i.status==0){I=a.error_server}else{if(!I){I=a.error_default}}}u(B,D,I+" ("+i.status+")")}else{y(B,D,G)}};i.upload.index=B;i.upload.file=D;i.upload.addEventListener("progress",k,false);i.send(F)}function y(B,C,D){a.success(B,C,D);m()}function u(B,C,D){a.error(B,C,D);m()}function w(){c("#uploadbox_input").trigger("click")}function t(B){for(B in e){r(B)}}function l(){if(!d){d=true;m()}}function v(){g=true}function n(B){a=c.extend({},a,B);return a}function s(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}return{select:w,add:z,remove:r,start:l,stop:v,reset:t,configure:n,compatible:s}}})(jQuery);
\ No newline at end of file
diff -r 315dc0e1cb4889e477fd820b6455d4146ad1958d -r be283631c6120086adfe98ba6e46513e119a443a static/scripts/packed/utils/utils.js
--- /dev/null
+++ b/static/scripts/packed/utils/utils.js
@@ -0,0 +1,1 @@
+define(["libs/underscore"],function(c){function d(g,f,e){var h=new XMLHttpRequest();h.open("GET",g,true);h.setRequestHeader("Accept","application/json");h.setRequestHeader("Cache-Control","no-cache");h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.onloadend=function(){var i=h.status;if(i==200){try{response=jQuery.parseJSON(h.responseText)}catch(j){response=h.responseText}f&&f(response)}else{e&&e(i)}};h.send()}function b(h,e){var f=$('<div class="'+h+'"></div>');f.appendTo(":eq(0)");var g=f.css(e);f.remove();return g}function a(e){if(!$('link[href^="'+e+'"]').length){$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}}return{cssLoadFile:a,cssGetAttribute:b,jsonFromUrl:d}});
\ No newline at end of file
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/11a9a3eb748c/
Changeset: 11a9a3eb748c
User: jmchilton
Date: 2014-01-17 16:48:17
Summary: Provide item style access to runner params.
Affected #: 1 file
diff -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae -r 11a9a3eb748c6b650c439b18881429041cc70b28 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -41,6 +41,8 @@
def __getattr__( self, name ):
return self.params.get( name, self.specs[ name ][ 'default' ] )
+ __getitem__ = __getattr__
+
class BaseJobRunner( object ):
def __init__( self, app, nworkers, **kwargs ):
https://bitbucket.org/galaxy/galaxy-central/commits/4c77668f7673/
Changeset: 4c77668f7673
User: jmchilton
Date: 2014-01-17 16:48:17
Summary: Handle subclassed DRMAA exceptions properly.
No clue if this was a problem, but realized it might be.
Affected #: 1 file
diff -r 11a9a3eb748c6b650c439b18881429041cc70b28 -r 4c77668f767364317d1ef9958cc93180a0e67e7c lib/galaxy/jobs/runners/drmaa.py
--- a/lib/galaxy/jobs/runners/drmaa.py
+++ b/lib/galaxy/jobs/runners/drmaa.py
@@ -231,7 +231,10 @@
assert external_job_id not in ( None, 'None' ), '(%s/%s) Invalid job id' % ( galaxy_id_tag, external_job_id )
state = self.ds.jobStatus( external_job_id )
except ( drmaa.InternalException, drmaa.InvalidJobException ), e:
- ecn = e.__class__.__name__
+ if isinstance( e , drmaa.InvalidJobException ):
+ ecn = "InvalidJobException".lower()
+ else:
+ ecn = "InternalException".lower()
retry_param = ecn.lower() + '_retries'
state_param = ecn.lower() + '_state'
retries = getattr( ajs, retry_param, 0 )
https://bitbucket.org/galaxy/galaxy-central/commits/315dc0e1cb48/
Changeset: 315dc0e1cb48
User: jmchilton
Date: 2014-01-17 23:04:39
Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #300)
Potential DRMAA fixes.
Affected #: 2 files
diff -r a0de65af7094c5e9f33645b60eb14895ccacd6f1 -r 315dc0e1cb4889e477fd820b6455d4146ad1958d lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -41,6 +41,8 @@
def __getattr__( self, name ):
return self.params.get( name, self.specs[ name ][ 'default' ] )
+ __getitem__ = __getattr__
+
class BaseJobRunner( object ):
def __init__( self, app, nworkers, **kwargs ):
diff -r a0de65af7094c5e9f33645b60eb14895ccacd6f1 -r 315dc0e1cb4889e477fd820b6455d4146ad1958d lib/galaxy/jobs/runners/drmaa.py
--- a/lib/galaxy/jobs/runners/drmaa.py
+++ b/lib/galaxy/jobs/runners/drmaa.py
@@ -231,7 +231,10 @@
assert external_job_id not in ( None, 'None' ), '(%s/%s) Invalid job id' % ( galaxy_id_tag, external_job_id )
state = self.ds.jobStatus( external_job_id )
except ( drmaa.InternalException, drmaa.InvalidJobException ), e:
- ecn = e.__class__.__name__
+ if isinstance( e , drmaa.InvalidJobException ):
+ ecn = "InvalidJobException".lower()
+ else:
+ ecn = "InternalException".lower()
retry_param = ecn.lower() + '_retries'
state_param = ecn.lower() + '_state'
retries = getattr( ajs, retry_param, 0 )
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: greg: Improved logging in the tool shed's install and test framework.
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a0de65af7094/
Changeset: a0de65af7094
User: greg
Date: 2014-01-17 22:57:18
Summary: Improved logging in the tool shed's install and test framework.
Affected #: 1 file
diff -r 03f186a9801738c9cab95275038851ed95922a49 -r a0de65af7094c5e9f33645b60eb14895ccacd6f1 test/install_and_test_tool_shed_repositories/base/util.py
--- a/test/install_and_test_tool_shed_repositories/base/util.py
+++ b/test/install_and_test_tool_shed_repositories/base/util.py
@@ -402,10 +402,13 @@
log.debug( "...retrieved %d repository revisions for installation and possible testing." % len( repository_dicts ) )
log.debug( "Repository revisions for testing:" )
for repository_dict in repository_dicts:
+ repository_id = str( repository_dict.get( 'repository_id', None ) )
+ repository_metadata_id = str( repository_dict.get( 'id', None ) )
name = str( repository_dict.get( 'name', None ) )
owner = str( repository_dict.get( 'owner', None ) )
changeset_revision = str( repository_dict.get( 'changeset_revision', None ) )
- log.debug( "Revision %s of repository %s owned by %s" % ( changeset_revision, name, owner ) )
+ log.debug( "Revision %s of repository %s owned by %s with repository_id %s, (repository_metadata) id %s" % \
+ ( changeset_revision, name, owner, repository_id, repository_metadata_id ) )
return repository_dicts, error_message
def get_repository( name, owner, changeset_revision ):
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