commit/galaxy-central: guerler: Drag&drop multiple file upload: add status icon
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/6acc90746486/ Changeset: 6acc90746486 User: guerler Date: 2013-09-24 05:38:26 Summary: Drag&drop multiple file upload: add status icon Affected #: 4 files diff -r 8c464ada320ff611112d5b71febe394112a02daf -r 6acc907464869c92c4bb366f6574c52714f60ae7 static/scripts/galaxy.upload.js --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -24,6 +24,12 @@ 'ab1' : 'ab1' }, + // states + state : { + init : 'fa-icon-trash', + done : 'fa-icon-caret-down' + }, + // counter counter : { // stats @@ -80,7 +86,7 @@ event_mouseleave : function (e) { }, - + // start event_announce : function(index, file, message) { @@ -107,7 +113,7 @@ // add functionality to remove button var self = this; - it.find('.remove').on('click', function() { self.event_remove (index) }); + it.find('.symbol').on('click', function() { self.event_remove (index) }); // initialize progress this.event_progress(index, file, 0); @@ -155,7 +161,7 @@ it.find('.info').html(percentage + '% of ' + this.size_to_string (file.size)); }, - // end + // success event_success : function(index, file, message) { // get element @@ -165,6 +171,14 @@ it.addClass('panel-success'); it.removeClass('panel-default'); + // update icon + var sy = it.find('.symbol'); + sy.addClass(this.state.done); + + // remove spin + sy.removeClass('fa-icon-spin'); + sy.removeClass('fa-icon-spinner'); + // update galaxy history Galaxy.currHistoryPanel.refresh(); @@ -182,7 +196,7 @@ this.update_screen(); }, - // end + // error event_error : function(index, file, message) { // get element @@ -192,6 +206,14 @@ it.addClass('panel-danger'); it.removeClass('panel-default'); + // update icon + var sy = it.find('.symbol'); + sy.addClass(this.state.done); + + // remove spin + sy.removeClass('fa-icon-spin'); + sy.removeClass('fa-icon-spinner'); + // remove progress bar it.find('.progress').remove(); @@ -226,11 +248,16 @@ // hide configuration $(this.el).find('.panel-body').hide(); - // switch icon - $(this.el).find('.remove').each(function() + // switch icons for new uploads + var self = this; + $(this.el).find('.symbol').each(function() { - $(this).removeClass('fa-icon-trash'); - $(this).addClass('fa-icon-caret-down'); + if($(this).hasClass(self.state.init)) + { + $(this).removeClass(self.state.init); + $(this).addClass('fa-icon-spinner'); + $(this).addClass('fa-icon-spin'); + } }); // configure url @@ -273,12 +300,13 @@ // remove item from upload list event_remove : function(index) { - // only remove from queue if paused - if (this.counter.running == 0) + // 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.done)) { - // get item - var it = this.get_upload_item(index); - // reduce counter if (it.hasClass('panel-default')) this.counter.announce--; @@ -428,7 +456,7 @@ '<div class="panel-heading">' + '<h5 class="title"></h5>' + '<h5 class="info"></h5>' + - '<div class="remove fa-icon-trash"></div>' + + '<div class="symbol ' + this.state.init + '"></div>' + '</div>' + '<div class="panel-body">' + '<div class="menu">' + diff -r 8c464ada320ff611112d5b71febe394112a02daf -r 6acc907464869c92c4bb366f6574c52714f60ae7 static/scripts/utils/galaxy.uploadbox.js --- a/static/scripts/utils/galaxy.uploadbox.js +++ b/static/scripts/utils/galaxy.uploadbox.js @@ -65,6 +65,9 @@ { // add files to queue add(e.target.files); + + // reset + $(this).val(''); }); // drop event @@ -323,7 +326,7 @@ // verify browser compatibility function compatible() { - return window.File && window.FileReader && window.FormData && window.XMLHttpRequest; + return window.File && window.FileReader && window.FormData && window.XMLHttpRequest && window.FileList; } // export functions diff -r 8c464ada320ff611112d5b71febe394112a02daf -r 6acc907464869c92c4bb366f6574c52714f60ae7 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1126,7 +1126,7 @@ .upload-info{font-weight:normal;text-align:center} .upload-box{width:100%;height:250px;max-height:250px;text-align:center;overflow:scroll;font-size:12px;line-height:1.33;-moz-border-radius:5px;border-radius:5px;border:1px dashed #bfbfbf;padding:20px}.upload-box .panel{display:none}.upload-box .panel .panel-heading{position:relative;height:19px;padding:5px}.upload-box .panel .panel-heading .title{position:absolute;top:2px;font-weight:normal;text-align:left;margin:0px;max-width:300px;overflow:hidden} .upload-box .panel .panel-heading .info{position:absolute;top:3px;font-weight:normal;right:20px;text-align:right;margin:0px} -.upload-box .panel .panel-heading .remove{position:absolute;cursor:pointer;top:0px;right:3px} +.upload-box .panel .panel-heading .symbol{position:absolute;cursor:pointer;top:0px;right:3px} .upload-box .panel .panel-body{position:relative;padding:5px} .upload-box .panel .panel-footer{position:relative;height:20px;padding:0px}.upload-box .panel .panel-footer .progress{height:10px;margin:5px} .upload-box .panel .panel-footer .error{font-weight:normal;margin:2px} diff -r 8c464ada320ff611112d5b71febe394112a02daf -r 6acc907464869c92c4bb366f6574c52714f60ae7 static/style/src/less/upload.less --- a/static/style/src/less/upload.less +++ b/static/style/src/less/upload.less @@ -49,7 +49,7 @@ margin: 0px; } - .remove + .symbol { position: absolute; cursor: pointer; 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