commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/58912b536756/ Changeset: 58912b536756 User: guerler Date: 2013-10-11 18:04:26 Summary: Use state event listener to queue uploads Affected #: 2 files diff -r 6634ab26b76f8da657157e8373dc5424d0b89435 -r 58912b5367565cd73078eefab4cccb5d14b88814 static/scripts/galaxy.upload.js --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -186,10 +186,7 @@ // success event_success : function(index, file, message) - { - // update galaxy history - Galaxy.currHistoryPanel.refresh(); - + { // make sure progress is shown correctly this.event_progress(index, file, 100); @@ -217,6 +214,9 @@ sy.removeClass(this.state.running); sy.removeClass(this.state.queued); sy.addClass(this.state.success); + + // update galaxy history + Galaxy.currHistoryPanel.refresh(); }, // error @@ -314,6 +314,9 @@ $(this).find('#space_to_tabs').attr('disabled', false); } }); + + // set html content + $('#upload-info').html('Queueing will pause after completing the current file.'); }, // queue is done diff -r 6634ab26b76f8da657157e8373dc5424d0b89435 -r 58912b5367565cd73078eefab4cccb5d14b88814 static/scripts/utils/galaxy.uploadbox.js --- a/static/scripts/utils/galaxy.uploadbox.js +++ b/static/scripts/utils/galaxy.uploadbox.js @@ -23,6 +23,7 @@ complete : function() {}, error_filesize : "File exceeds 250MB. Please use an FTP client.", error_default : "Please make sure the file is available.", + error_server : "The server is unavailable.", error_toomany : "You can only queue <20 files per upload session." } @@ -39,7 +40,7 @@ var queue_length = 0; // indicates if queue is currently running - var queue_status = false; + var queue_running = false; // element var el = null; @@ -114,7 +115,7 @@ function add(files) { // only allow adding file if current batch is complete - if (queue_status) + if (queue_running) return; for (var i = 0; i < files.length; i++) @@ -154,13 +155,13 @@ function process() { // validate - if (queue_length == 0 || !queue_status) + if (queue_length == 0 || !queue_running) { - queue_status = false; + queue_running = false; opts.complete(); return; } else - queue_status = true; + queue_running = true; // get an identifier from the queue var index = -1; @@ -204,6 +205,12 @@ { error(index, file, opts.error_default); }; + + // link abort + reader.onabort = function(e) + { + error(index, file, opts.error_default); + }; // read data reader.readAsDataURL(file); @@ -230,9 +237,13 @@ // prepare request var xhr = new XMLHttpRequest(); - // onloadend - xhr.onloadend = function() + // captures state changes + xhr.onreadystatechange = function() { + // check for request completed, server connection closed + if (xhr.readyState != xhr.DONE) + return; + // retrieve response var response = null; if (xhr.responseText) @@ -250,16 +261,20 @@ { // format error var text = xhr.statusText; - if (!xhr.statusText) - text = opts.error_default; + if (!xhr.statusText) { + if (xhr.status == 0) + text = opts.error_server; + else + text = opts.error_default; + } // request error - error(index, file, text + " (Server Code " + xhr.status + ")"); + error(index, file, text + " (" + xhr.status + ")"); } else // parse response success(index, file, response); } - + // prepare upload progress xhr.upload.index = index; xhr.upload.file = file; @@ -313,9 +328,9 @@ // initiate upload process function upload() { - if (!queue_status) + if (!queue_running) { - queue_status = true; + queue_running = true; process(); } } @@ -324,7 +339,7 @@ function pause() { // set global status variable to false - queue_status = false; + queue_running = false; } // set options https://bitbucket.org/galaxy/galaxy-central/commits/40164a7bdea9/ Changeset: 40164a7bdea9 User: guerler Date: 2013-10-11 18:12:19 Summary: Merge Affected #: 2 files diff -r 58912b5367565cd73078eefab4cccb5d14b88814 -r 40164a7bdea9ab383f18c82394cdb9b45bd1c50e static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -1614,7 +1614,7 @@ initialize: function(options) { // Restore tool visibility from state. if (options.tool_state !== undefined) { - this.set('hidden', options.tool_state.hidden) + this.set('hidden', options.tool_state.hidden); } // FIXME: need to restore tool values from options.tool_state @@ -2291,8 +2291,8 @@ // parseInt strips "px" from left, top measurements. +7 so that mouse pointer does not // overlap popup. var - popupX = offsetX + parseInt( tile.html_elt.css("left") ) - popup.width() / 2, - popupY = offsetY + parseInt( tile.html_elt.css("top") ) + 7; + popupX = offsetX + parseInt( tile.html_elt.css("left"), 10 ) - popup.width() / 2, + popupY = offsetY + parseInt( tile.html_elt.css("top"), 10 ) + 7; popup.css("left", popupX + "px").css("top", popupY + "px"); } else if (!e.isPropagationStopped()) { @@ -2715,20 +2715,24 @@ }) ); } - } else if (result === "no converter") { + } + else if (result === "no converter") { track.container_div.addClass("error"); track.tiles_div.text(DATA_NOCONVERTER); - } else if (result === "no data" || (result.data !== undefined && (result.data === null || result.data.length === 0))) { + } + else if (result === "no data" || (result.data !== undefined && (result.data === null || result.data.length === 0))) { track.container_div.addClass("nodata"); track.tiles_div.text(DATA_NONE); - } else if (result === "pending") { + } + else if (result === "pending") { track.container_div.addClass("pending"); track.tiles_div.html(DATA_PENDING); //$("<img/>").attr("src", image_path + "/yui/rel_interstitial_loading.gif").appendTo(track.tiles_div); setTimeout(function() { track.init(); }, track.data_query_wait); - } else if (result === "data" || result['status'] === "data") { - if (result['valid_chroms']) { - track.valid_chroms = result['valid_chroms']; + } + else if (result === "data" || result.status === "data") { + if (result.valid_chroms) { + track.valid_chroms = result.valid_chroms; track.update_icons(); } track.tiles_div.text(DATA_OK); @@ -3276,7 +3280,7 @@ } drawing_modes.push(mode); drawing_heights.push(d.get_canvas_height(data, mode, w_scale, width)); - }) + }); var canvas = track.view.canvas_manager.new_canvas(), tile_low = region.get('start'), @@ -4062,10 +4066,9 @@ /** * Update track interface to show display mode being used. */ - update_auto_mode: function( mode ) { - var mode; - if ( this.mode === "Auto" ) { - if ( mode === "no_detail" ) { + update_auto_mode: function(mode) { + if (this.mode === "Auto") { + if (mode === "no_detail") { mode = "feature spans"; } this.action_icons.mode_icon.attr("title", "Set display mode (now: Auto/" + mode + ")"); @@ -4436,10 +4439,10 @@ else { // Template is a dictionary. var - drawable_type = template['obj_type']; + drawable_type = template.obj_type; // For backward compatibility: if (!drawable_type) { - drawable_type = template['track_type']; + drawable_type = template.track_type; } return new addable_objects[ drawable_type ](view, container, template); } diff -r 58912b5367565cd73078eefab4cccb5d14b88814 -r 40164a7bdea9ab383f18c82394cdb9b45bd1c50e static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -1,5 +1,4 @@ -define( ["libs/underscore", "mvc/data", "viz/trackster/util", "utils/config"], - function(_, data_mod, util_mod, config_mod) { +define( ["libs/underscore", "mvc/data", "viz/trackster/util", "utils/config"], function(_, data_mod, util_mod, config_mod) { /** * Model, view, and controller objects for Galaxy visualization framework. @@ -409,10 +408,11 @@ // This would prevent bad extensions when zooming in/out while still preserving the behavior // below. + // Use copy of region to avoid changing actual region. + region = region.copy(); + // Use heuristic to extend region: extend relative to last data request. - var last_request = this.most_recently_added(), - // Use copy of region to avoid changing actual region. - region = region.copy(); + var last_request = this.most_recently_added(); if (!last_request || (region.get('start') > last_request.get('start'))) { // This request is after the last request, so extend right. region.set('end', region.get('start') + this.attributes.min_region_size); 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.
participants (1)
-
commits-noreply@bitbucket.org