1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/13d3054d2f52/ Changeset: 13d3054d2f52 User: guerler Date: 2013-10-10 22:55:22 Summary: Improve upload front end Affected #: 3 files diff -r 085454c899afaaf05a9c17d3818ed2b3029e7210 -r 13d3054d2f52782fb0a083af9e6e74cbc111e256 static/scripts/galaxy.modal.js --- a/static/scripts/galaxy.modal.js +++ b/static/scripts/galaxy.modal.js @@ -38,12 +38,8 @@ this.$body.css('max-height', maxHeight); // fix height if available - if (this.options.height) { - if (this.options.height < maxHeight) - this.$body.css('height', this.options.height); - else - this.$body.css('height', maxHeight); - } + if (this.options.height) + this.$body.css('height', Math.min(this.options.height, maxHeight)); // remove scroll bar if (this.options.height) diff -r 085454c899afaaf05a9c17d3818ed2b3029e7210 -r 13d3054d2f52782fb0a083af9e6e74cbc111e256 static/scripts/galaxy.upload.js --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -133,16 +133,14 @@ // get element var it = this.get_upload_item(index); - // get current history + // get configuration var current_history = Galaxy.currHistoryPanel.model.get('id'); - - // configure tool - this.uploadbox.configure({url : galaxy_config.root + "api/tools/", paramname : "files_0|file_data"}); - - // get var file_type = it.find('#extension').val(); var space_to_tabs = it.find('#space_to_tabs').is(':checked'); + // configure uploadbox + this.uploadbox.configure({url : galaxy_config.root + "api/tools/", paramname : "files_0|file_data"}); + // configure tool tool_input = {}; tool_input['dbkey'] = '?'; @@ -174,7 +172,10 @@ it.find('.progress-bar').css({ width : percentage + '%' }); // update value - it.find('#percentage').html(percentage + '%'); + if (percentage != 100) + it.find('#percentage').html(percentage + '%'); + else + it.find('#percentage').html('Adding to history...'); }, // success @@ -202,6 +203,9 @@ // update progress frame it.addClass('success'); + // update text + it.find('#percentage').html('100%'); + // update icon var sy = it.find('#symbol'); sy.removeClass('fa-icon-spin'); @@ -267,6 +271,10 @@ symbol.addClass('fa-icon-spinner'); symbol.addClass('fa-icon-spin'); } + + // disable options + $(this).find('#extension').attr('disabled', true); + $(this).find('#space_to_tabs').attr('disabled', true); }); // update running diff -r 085454c899afaaf05a9c17d3818ed2b3029e7210 -r 13d3054d2f52782fb0a083af9e6e74cbc111e256 static/scripts/utils/galaxy.uploadbox.js --- a/static/scripts/utils/galaxy.uploadbox.js +++ b/static/scripts/utils/galaxy.uploadbox.js @@ -12,6 +12,7 @@ url : '', paramname : 'content', maxfilesize : 250, + maxfilenumber : 20, dragover : function() {}, dragleave : function() {}, announce : function() {}, @@ -21,7 +22,8 @@ error : function(index, file, message) { alert(message); }, complete : function() {}, error_filesize : "File exceeds 250MB. Please use an FTP client.", - error_default : "Please make sure the file is available." + error_default : "Please make sure the file is available.", + error_toomany : "You can only queue <20 files per upload session." } // options @@ -115,20 +117,23 @@ if (queue_status) return; - // add new files to queue for (var i = 0; i < files.length; i++) { + // check + if(queue_length >= opts.maxfilenumber) + break; + // new identifier var index = String(queue_index++); // add to queue queue[index] = files[i]; + // announce + opts.announce(index, queue[index], ""); + // increase counter queue_length++; - - // announce - opts.announce(index, queue[index], ""); } } @@ -230,13 +235,6 @@ xhr.upload.file = file; xhr.upload.addEventListener('progress', progress, false); - // open request - xhr.open('POST', opts.url, true); - xhr.setRequestHeader('Accept', 'application/json'); - xhr.setRequestHeader('Cache-Control', 'no-cache'); - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - xhr.send(formData); - // onloadend xhr.onloadend = function() { @@ -266,6 +264,13 @@ // parse response success(index, file, response); } + + // open request + xhr.open('POST', opts.url, true); + xhr.setRequestHeader('Accept', 'application/json'); + xhr.setRequestHeader('Cache-Control', 'no-cache'); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.send(formData); } // success 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.