commit/galaxy-central: guerler: Show file size for manually created files
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/41d3434f8506/ Changeset: 41d3434f8506 User: guerler Date: 2013-10-16 10:05:53 Summary: Show file size for manually created files Affected #: 1 file diff -r f170cf78702b3913a5e09ada1c75db2800ebc982 -r 41d3434f8506bb13380bd072e64194519e32a36e static/scripts/galaxy.upload.js --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -144,6 +144,10 @@ // add functionality to remove button var self = this; it.find('#symbol').on('click', function() { self.event_remove (index) }); + it.find('#text-content').on('keyup', function() { + var count = it.find('#text-content').val().length; + it.find('#size').html(self.size_to_string (count)); + }); // initialize progress this.event_progress(index, file, 0); @@ -437,8 +441,8 @@ } }, - // add (pseudo) file - event_add : function () + // create (pseudo) file + event_create : function () { this.uploadbox.add([{ name : 'New File', size : -1 }]); }, @@ -460,7 +464,7 @@ body : this.template('upload-box', 'upload-info'), buttons : { 'Select' : function() {self.uploadbox.select()}, - 'Create' : function() {self.event_add()}, + 'Create' : function() {self.event_create()}, 'Upload' : function() {self.event_start()}, 'Pause' : function() {self.event_stop()}, 'Reset' : function() {self.event_reset()}, @@ -511,7 +515,8 @@ 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 '?'; + if (size > 0) { size = size * 10; unit = 'b'; } else + return '<strong>-</strong>'; // return formatted string return '<strong>' + (Math.round(size) / 10) + '</strong> ' + unit; 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