commit/galaxy-central: guerler: Upload: Add additional options, revise merged pull request
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/dc3357ffb6d9/ Changeset: dc3357ffb6d9 User: guerler Date: 2015-01-24 08:49:12+00:00 Summary: Upload: Add additional options, revise merged pull request Affected #: 15 files diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/ui/ui-misc.js --- a/client/galaxy/scripts/mvc/ui/ui-misc.js +++ b/client/galaxy/scripts/mvc/ui/ui-misc.js @@ -448,6 +448,54 @@ } }); +// plugin +var CheckButton = Backbone.View.extend({ + + // default options + optionsDefault: { + class_add : 'fa fa-square-o', + class_remove : 'fa fa-check-square-o', + class_partial : 'fa fa-minus-square-o', + value : false + }, + + // initialize + initialize : function(options) { + // configure options + this.options = Utils.merge(options, this.optionsDefault); + + // create new element + this.setElement($('<div/>')); + + // set initial value + this.value(Boolean(this.options.value)); + + // add event handler + var self = this; + this.$el.on('click', function() { + self.value(!self.current); + }); + }, + + // value + value : function (new_val) { + if (new_val !== undefined) { + this.current = new_val; + if (new_val) { + this.$el.removeClass() + .addClass('ui-checkbutton') + .addClass(this.options.class_remove); + } else { + this.$el.removeClass() + .addClass('ui-checkbutton') + .addClass(this.options.class_add); + } + this.options.onchange && this.options.onchange(new_val); + } + return this.current; + } +}); + // return return { Anchor : Anchor, @@ -463,6 +511,7 @@ RadioButton : Options.RadioButton, Checkbox : Options.Checkbox, Radio : Options.Radio, + CheckButton : CheckButton, Searchbox : Searchbox, Select : Select, Hidden : Hidden, diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-model.js --- a/client/galaxy/scripts/mvc/upload/upload-model.js +++ b/client/galaxy/scripts/mvc/upload/upload-model.js @@ -14,8 +14,6 @@ file_type : null, file_path : '', percentage : 0, - row : null, - // settings space_to_tabs : false, to_posix_lines : true } diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-row.js --- a/client/galaxy/scripts/mvc/upload/upload-row.js +++ b/client/galaxy/scripts/mvc/upload/upload-row.js @@ -3,7 +3,7 @@ 'mvc/upload/upload-model', 'mvc/upload/upload-settings', 'mvc/ui/ui-popover', - 'mvc/ui/ui-select'], + 'mvc/ui/ui-select',], function( Utils, UploadModel, @@ -42,9 +42,6 @@ // link app this.app = app; - // default value for extension of files - var default_ext = 'Auto-detect'; - // link this var self = this; @@ -64,6 +61,9 @@ placement : 'bottom' }); + // initialize default genome through default select field + var default_genome = this.app.select_genome.value(); + // select genomes this.select_genome = new Select.View({ css: 'genome', @@ -72,39 +72,29 @@ }, data: self.app.list_genomes, container: it.find('#genome'), - value: self.model.get('genome') + value: default_genome }); // initialize genome - this.model.set('genome', self.select_genome.value()); + this.model.set('genome', default_genome); - // ensure files added after an individual row has changed - // default to Auto-detect instead of --- - if(!(this.app.select_extension.value() === '---')){ - this.default_ext = this.app.select_extension.value(); - } - + // initialize default extension through default select field + var default_extension = this.app.select_extension.value(); + // select extension this.select_extension = new Select.View({ css: 'extension', onchange : function() { self.model.set('extension', self.select_extension.value()); - // if user has changed individual row type, then change "set all" - // type to '---' - if(!(self.select_extension.value() === app.select_extension.value())) - { - var newExte = '---'; - app.select_extension.value(newExte); - } }, data: self.app.list_extensions, container: it.find('#extension'), - value: self.default_ext + value: default_extension }); // initialize extension - this.model.set('extension', self.select_extension.value()); - + this.model.set('extension', default_extension); + // // ui events // @@ -113,8 +103,13 @@ it.find('#symbol').on('click', function() { self._removeRow(); }); // handle extension info popover - it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); }) - .on('mousedown', function(e) { e.preventDefault(); }); + it.find('#extension-info').on('click' , function(e) { + self.app.showExtensionInfo({ + $el : $(e.target), + title : self.select_extension.text(), + extension : self.select_extension.value() + }); + }).on('mousedown', function(e) { e.preventDefault(); }); // handle settings popover it.find('#settings').on('click' , function(e) { self._showSettings(); }) @@ -130,7 +125,7 @@ it.find('#space_to_tabs').on('change', function(e) { self.model.set('space_to_tabs', $(e.target).prop('checked')); }); - + // // model events // @@ -146,6 +141,9 @@ this.model.on('change:genome', function() { self._refreshGenome(); }); + this.model.on('change:extension', function() { + self._refreshExtension(); + }); this.model.on('change:file_size', function() { self._refreshFileSize(); }); @@ -155,7 +153,6 @@ this.app.collection.on('reset', function() { self.remove(); }); - self.model.set('row', self); }, // render @@ -175,8 +172,9 @@ it.find('#size').html(Utils.bytesToString (file_size)); // remove mode class - it.find('#mode').removeClass() - .addClass('mode'); + it.find('#mode') + .removeClass() + .addClass('mode'); // activate text field if file is new if (file_mode == 'new') { @@ -229,11 +227,14 @@ // handle model events // - // genome + // update extension + _refreshExtension: function() { + this.select_extension.value(this.model.get('extension')); + }, + + // update genome _refreshGenome: function() { - // update genome info on screen - var genome = this.model.get('genome'); - this.select_genome.value(genome); + this.select_genome.value(this.model.get('genome')); }, // progress @@ -327,33 +328,6 @@ }, // attach file info popup - _showExtensionInfo : function() { - // initialize - var $el = $(this.el).find('#extension-info'); - var extension = this.model.get('extension'); - var title = this.select_extension.text(); - var description = _.findWhere(this.app.list_extensions, {'id': extension}); - - // create popup - if (!this.extension_popup) { - this.extension_popup = new Popover.View({ - placement: 'bottom', - container: $el - }); - } - - // show / hide popup - if (!this.extension_popup.visible) { - this.extension_popup.title(title); - this.extension_popup.empty(); - this.extension_popup.append(this._templateDescription(description)); - this.extension_popup.show(); - } else { - this.extension_popup.hide(); - } - }, - - // attach file info popup _showSettings : function() { // check if popover is visible if (!this.settings.visible) { @@ -368,23 +342,10 @@ }, // template - _templateDescription: function(options) { - if (options.description) { - var tmpl = options.description; - if (options.description_url) { - tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; - } - return tmpl; - } else { - return 'There is no description available for this file extension.'; - } - }, - - // template _template: function(options) { return '<tr id="upload-item-' + options.id + '" class="upload-item">' + '<td>' + - '<div style="position: relative;">' + + '<div class="name-column">' + '<div id="mode"></div>' + '<div id="title" class="title"></div>' + '<div id="text" class="text">' + diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 client/galaxy/scripts/mvc/upload/upload-view.js --- a/client/galaxy/scripts/mvc/upload/upload-view.js +++ b/client/galaxy/scripts/mvc/upload/upload-view.js @@ -23,7 +23,7 @@ return Backbone.View.extend({ // options options : { - nginx_upload_path : '' + nginx_upload_path : '' }, // own modal @@ -40,6 +40,9 @@ // extension selector select_extension : null, + + // genome selector + select_genome: null, // current upload size upload_size: 0, @@ -130,14 +133,6 @@ return a.id > b.id ? 1 : a.id < b.id ? -1 : 0; }); - // add the '---' extension for use when the row types are changed individually - self.list_extensions.push({ - id : "---", - text : "---", - description : "", - description_url : "" - }); - // add auto field if (!self.options.datatypes_disable_auto) { self.list_extensions.unshift(self.auto); @@ -167,14 +162,6 @@ this.collection.on('remove', function(item) { self._eventRemove(item); }); - 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); - } - }); - }); }, // @@ -232,28 +219,30 @@ container : button }); - // select extension + // select extension this.select_extension = new Select.View({ - css: 'extension', - onchange : function() { - var newExten = self.select_extension.value() - var len = self.collection.models.length; - // Only trigger changing the rows if the "set all" isn't set to '---' - // Prevents recursively changing the rows after an individual row has been changed - if(!(newExten === '---')){ - for(i = 0; i < len; i++){ - self.collection.models[i].attributes['row'].select_extension.value(newExten); - } - } - }, - data: self.list_extensions, - container: self.$el.parents().find('#extension'), - value: self.list_extensions[0] + css : 'header-selection', + data : self.list_extensions, + container : self.$el.parent().find('#header-extension'), + value : self.list_extensions[0] }); - + // handle extension info popover - self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); }) - .on('mousedown', function(e) { e.preventDefault(); }); + self.$el.parent().find('#header-extension-info').on('click' , function(e) { + self.showExtensionInfo({ + $el : $(e.target), + title : self.select_extension.text(), + extension : self.select_extension.value() + }); + }).on('mousedown', function(e) { e.preventDefault(); }); + + // genome extension + this.select_genome = new Select.View({ + css : 'header-selection', + data : self.list_genomes, + container : self.$el.parent().find('#header-genome'), + value : self.list_genomes[0] + }); } // show modal @@ -266,45 +255,27 @@ this._updateScreen(); }, - _showExtensionInfo : function() { + showExtensionInfo : function(options) { // initialize var self = this; - var $el = $(this.el).parents().find('#extension-info_out'); - var extension = self.select_extension.value(); - - var title = this.select_extension.text(); - + var $el = options.$el; + var extension = options.extension; + var title = options.title; var description = _.findWhere(self.list_extensions, {'id': extension}); // create popup - if (!this.extension_popup) { - this.extension_popup = new Popover.View({ - placement: 'bottom', - container: $el - }); - } - - // show / hide popup - if (!this.extension_popup.visible) { - this.extension_popup.title(title); - this.extension_popup.empty(); - this.extension_popup.append(this._templateDescription(description)); - this.extension_popup.show(); - } else { - this.extension_popup.hide(); - } - }, - - _templateDescription: function(options) { - if (options.description) { - var tmpl = options.description; - if (options.description_url) { - tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; - } - return tmpl; - } else { - return 'There is no description available for this file extension.'; - } + this.extension_popup && this.extension_popup.remove(); + this.extension_popup = new Popover.View({ + placement: 'bottom', + container: $el, + destroy: true + }); + + // add content and show popup + this.extension_popup.title(title); + this.extension_popup.empty(); + this.extension_popup.append(this._templateDescription(description)); + this.extension_popup.show(); }, // @@ -593,6 +564,7 @@ // reset value for universal type drop-down this.select_extension.value(this.list_extensions[0]); + this.select_genome.value(this.list_genomes[0]); // reset button this.ui_button.set('percentage', 0); @@ -684,12 +656,28 @@ return (this.upload_completed + (percentage * size)) / this.upload_size; }, + + // template for extensions description + _templateDescription: function(options) { + if (options.description) { + var tmpl = options.description; + if (options.description_url) { + tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; + } + return tmpl; + } else { + return 'There is no description available for this file extension.'; + } + }, + // load html template _template: function(id, idInfo) { - return '<div id="uploadhead" class="uploadhead">' + - '<span class="fftext">"Set All" Types:  </span>' + - '<span id="extension" class="extension"/>  ' + - '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' + + return '<div id="upload-header" class="upload-header">' + + '<span class="header-title">Type (default):</span>' + + '<span id="header-extension"/>' + + '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' + + '<span class="header-title">Genome (default):</span>' + + '<span id="header-genome"/>' + '</div>' + '<div id="' + id + '" class="upload-box">' + '<table id="upload-table" class="table table-striped" style="display: none;">' + @@ -707,7 +695,7 @@ '<tbody></tbody>' + '</table>' + '</div>' + - '<div class="uploadfoot">' + + '<div class="upload-footer">' + '<h6 id="' + idInfo + '" class="upload-info"></h6>' + '</div>' ; } diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/ui/ui-misc.js --- a/static/scripts/mvc/ui/ui-misc.js +++ b/static/scripts/mvc/ui/ui-misc.js @@ -448,6 +448,54 @@ } }); +// plugin +var CheckButton = Backbone.View.extend({ + + // default options + optionsDefault: { + class_add : 'fa fa-square-o', + class_remove : 'fa fa-check-square-o', + class_partial : 'fa fa-minus-square-o', + value : false + }, + + // initialize + initialize : function(options) { + // configure options + this.options = Utils.merge(options, this.optionsDefault); + + // create new element + this.setElement($('<div/>')); + + // set initial value + this.value(Boolean(this.options.value)); + + // add event handler + var self = this; + this.$el.on('click', function() { + self.value(!self.current); + }); + }, + + // value + value : function (new_val) { + if (new_val !== undefined) { + this.current = new_val; + if (new_val) { + this.$el.removeClass() + .addClass('ui-checkbutton') + .addClass(this.options.class_remove); + } else { + this.$el.removeClass() + .addClass('ui-checkbutton') + .addClass(this.options.class_add); + } + this.options.onchange && this.options.onchange(new_val); + } + return this.current; + } +}); + // return return { Anchor : Anchor, @@ -463,6 +511,7 @@ RadioButton : Options.RadioButton, Checkbox : Options.Checkbox, Radio : Options.Radio, + CheckButton : CheckButton, Searchbox : Searchbox, Select : Select, Hidden : Hidden, diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-model.js --- a/static/scripts/mvc/upload/upload-model.js +++ b/static/scripts/mvc/upload/upload-model.js @@ -14,8 +14,6 @@ file_type : null, file_path : '', percentage : 0, - row : null, - // settings space_to_tabs : false, to_posix_lines : true } diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-row.js --- a/static/scripts/mvc/upload/upload-row.js +++ b/static/scripts/mvc/upload/upload-row.js @@ -3,7 +3,7 @@ 'mvc/upload/upload-model', 'mvc/upload/upload-settings', 'mvc/ui/ui-popover', - 'mvc/ui/ui-select'], + 'mvc/ui/ui-select',], function( Utils, UploadModel, @@ -42,9 +42,6 @@ // link app this.app = app; - // default value for extension of files - var default_ext = 'Auto-detect'; - // link this var self = this; @@ -64,6 +61,9 @@ placement : 'bottom' }); + // initialize default genome through default select field + var default_genome = this.app.select_genome.value(); + // select genomes this.select_genome = new Select.View({ css: 'genome', @@ -72,39 +72,29 @@ }, data: self.app.list_genomes, container: it.find('#genome'), - value: self.model.get('genome') + value: default_genome }); // initialize genome - this.model.set('genome', self.select_genome.value()); + this.model.set('genome', default_genome); - // ensure files added after an individual row has changed - // default to Auto-detect instead of --- - if(!(this.app.select_extension.value() === '---')){ - this.default_ext = this.app.select_extension.value(); - } - + // initialize default extension through default select field + var default_extension = this.app.select_extension.value(); + // select extension this.select_extension = new Select.View({ css: 'extension', onchange : function() { self.model.set('extension', self.select_extension.value()); - // if user has changed individual row type, then change "set all" - // type to '---' - if(!(self.select_extension.value() === app.select_extension.value())) - { - var newExte = '---'; - app.select_extension.value(newExte); - } }, data: self.app.list_extensions, container: it.find('#extension'), - value: self.default_ext + value: default_extension }); // initialize extension - this.model.set('extension', self.select_extension.value()); - + this.model.set('extension', default_extension); + // // ui events // @@ -113,8 +103,13 @@ it.find('#symbol').on('click', function() { self._removeRow(); }); // handle extension info popover - it.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); }) - .on('mousedown', function(e) { e.preventDefault(); }); + it.find('#extension-info').on('click' , function(e) { + self.app.showExtensionInfo({ + $el : $(e.target), + title : self.select_extension.text(), + extension : self.select_extension.value() + }); + }).on('mousedown', function(e) { e.preventDefault(); }); // handle settings popover it.find('#settings').on('click' , function(e) { self._showSettings(); }) @@ -130,7 +125,7 @@ it.find('#space_to_tabs').on('change', function(e) { self.model.set('space_to_tabs', $(e.target).prop('checked')); }); - + // // model events // @@ -146,6 +141,9 @@ this.model.on('change:genome', function() { self._refreshGenome(); }); + this.model.on('change:extension', function() { + self._refreshExtension(); + }); this.model.on('change:file_size', function() { self._refreshFileSize(); }); @@ -155,7 +153,6 @@ this.app.collection.on('reset', function() { self.remove(); }); - self.model.set('row', self); }, // render @@ -175,8 +172,9 @@ it.find('#size').html(Utils.bytesToString (file_size)); // remove mode class - it.find('#mode').removeClass() - .addClass('mode'); + it.find('#mode') + .removeClass() + .addClass('mode'); // activate text field if file is new if (file_mode == 'new') { @@ -229,11 +227,14 @@ // handle model events // - // genome + // update extension + _refreshExtension: function() { + this.select_extension.value(this.model.get('extension')); + }, + + // update genome _refreshGenome: function() { - // update genome info on screen - var genome = this.model.get('genome'); - this.select_genome.value(genome); + this.select_genome.value(this.model.get('genome')); }, // progress @@ -327,33 +328,6 @@ }, // attach file info popup - _showExtensionInfo : function() { - // initialize - var $el = $(this.el).find('#extension-info'); - var extension = this.model.get('extension'); - var title = this.select_extension.text(); - var description = _.findWhere(this.app.list_extensions, {'id': extension}); - - // create popup - if (!this.extension_popup) { - this.extension_popup = new Popover.View({ - placement: 'bottom', - container: $el - }); - } - - // show / hide popup - if (!this.extension_popup.visible) { - this.extension_popup.title(title); - this.extension_popup.empty(); - this.extension_popup.append(this._templateDescription(description)); - this.extension_popup.show(); - } else { - this.extension_popup.hide(); - } - }, - - // attach file info popup _showSettings : function() { // check if popover is visible if (!this.settings.visible) { @@ -368,23 +342,10 @@ }, // template - _templateDescription: function(options) { - if (options.description) { - var tmpl = options.description; - if (options.description_url) { - tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; - } - return tmpl; - } else { - return 'There is no description available for this file extension.'; - } - }, - - // template _template: function(options) { return '<tr id="upload-item-' + options.id + '" class="upload-item">' + '<td>' + - '<div style="position: relative;">' + + '<div class="name-column">' + '<div id="mode"></div>' + '<div id="title" class="title"></div>' + '<div id="text" class="text">' + diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/mvc/upload/upload-view.js --- a/static/scripts/mvc/upload/upload-view.js +++ b/static/scripts/mvc/upload/upload-view.js @@ -23,7 +23,7 @@ return Backbone.View.extend({ // options options : { - nginx_upload_path : '' + nginx_upload_path : '' }, // own modal @@ -40,6 +40,9 @@ // extension selector select_extension : null, + + // genome selector + select_genome: null, // current upload size upload_size: 0, @@ -130,14 +133,6 @@ return a.id > b.id ? 1 : a.id < b.id ? -1 : 0; }); - // add the '---' extension for use when the row types are changed individually - self.list_extensions.push({ - id : "---", - text : "---", - description : "", - description_url : "" - }); - // add auto field if (!self.options.datatypes_disable_auto) { self.list_extensions.unshift(self.auto); @@ -167,14 +162,6 @@ this.collection.on('remove', function(item) { self._eventRemove(item); }); - 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); - } - }); - }); }, // @@ -232,28 +219,30 @@ container : button }); - // select extension + // select extension this.select_extension = new Select.View({ - css: 'extension', - onchange : function() { - var newExten = self.select_extension.value() - var len = self.collection.models.length; - // Only trigger changing the rows if the "set all" isn't set to '---' - // Prevents recursively changing the rows after an individual row has been changed - if(!(newExten === '---')){ - for(i = 0; i < len; i++){ - self.collection.models[i].attributes['row'].select_extension.value(newExten); - } - } - }, - data: self.list_extensions, - container: self.$el.parents().find('#extension'), - value: self.list_extensions[0] + css : 'header-selection', + data : self.list_extensions, + container : self.$el.parent().find('#header-extension'), + value : self.list_extensions[0] }); - + // handle extension info popover - self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); }) - .on('mousedown', function(e) { e.preventDefault(); }); + self.$el.parent().find('#header-extension-info').on('click' , function(e) { + self.showExtensionInfo({ + $el : $(e.target), + title : self.select_extension.text(), + extension : self.select_extension.value() + }); + }).on('mousedown', function(e) { e.preventDefault(); }); + + // genome extension + this.select_genome = new Select.View({ + css : 'header-selection', + data : self.list_genomes, + container : self.$el.parent().find('#header-genome'), + value : self.list_genomes[0] + }); } // show modal @@ -266,45 +255,27 @@ this._updateScreen(); }, - _showExtensionInfo : function() { + showExtensionInfo : function(options) { // initialize var self = this; - var $el = $(this.el).parents().find('#extension-info_out'); - var extension = self.select_extension.value(); - - var title = this.select_extension.text(); - + var $el = options.$el; + var extension = options.extension; + var title = options.title; var description = _.findWhere(self.list_extensions, {'id': extension}); // create popup - if (!this.extension_popup) { - this.extension_popup = new Popover.View({ - placement: 'bottom', - container: $el - }); - } - - // show / hide popup - if (!this.extension_popup.visible) { - this.extension_popup.title(title); - this.extension_popup.empty(); - this.extension_popup.append(this._templateDescription(description)); - this.extension_popup.show(); - } else { - this.extension_popup.hide(); - } - }, - - _templateDescription: function(options) { - if (options.description) { - var tmpl = options.description; - if (options.description_url) { - tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; - } - return tmpl; - } else { - return 'There is no description available for this file extension.'; - } + this.extension_popup && this.extension_popup.remove(); + this.extension_popup = new Popover.View({ + placement: 'bottom', + container: $el, + destroy: true + }); + + // add content and show popup + this.extension_popup.title(title); + this.extension_popup.empty(); + this.extension_popup.append(this._templateDescription(description)); + this.extension_popup.show(); }, // @@ -593,6 +564,7 @@ // reset value for universal type drop-down this.select_extension.value(this.list_extensions[0]); + this.select_genome.value(this.list_genomes[0]); // reset button this.ui_button.set('percentage', 0); @@ -684,12 +656,28 @@ return (this.upload_completed + (percentage * size)) / this.upload_size; }, + + // template for extensions description + _templateDescription: function(options) { + if (options.description) { + var tmpl = options.description; + if (options.description_url) { + tmpl += ' (<a href="' + options.description_url + '" target="_blank">read more</a>)'; + } + return tmpl; + } else { + return 'There is no description available for this file extension.'; + } + }, + // load html template _template: function(id, idInfo) { - return '<div id="uploadhead" class="uploadhead">' + - '<span class="fftext">"Set All" Types:  </span>' + - '<span id="extension" class="extension"/>  ' + - '<span id="extension-info_out" class="upload-icon-button fa fa-search"/> ' + + return '<div id="upload-header" class="upload-header">' + + '<span class="header-title">Type (default):</span>' + + '<span id="header-extension"/>' + + '<span id="header-extension-info" class="upload-icon-button fa fa-search"/> ' + + '<span class="header-title">Genome (default):</span>' + + '<span id="header-genome"/>' + '</div>' + '<div id="' + id + '" class="upload-box">' + '<table id="upload-table" class="table table-striped" style="display: none;">' + @@ -707,7 +695,7 @@ '<tbody></tbody>' + '</table>' + '</div>' + - '<div class="uploadfoot">' + + '<div class="upload-footer">' + '<h6 id="' + idInfo + '" class="upload-info"></h6>' + '</div>' ; } diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/ui/ui-misc.js --- a/static/scripts/packed/mvc/ui/ui-misc.js +++ b/static/scripts/packed/mvc/ui/ui-misc.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,o,l,q,m){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="'+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var r=this;$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick&&!r.disabled){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(r){this.$("i").removeClass(this.options.icon).addClass(r);this.options.icon=r},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="'+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var n=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(s){this.options=k.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!s.persistent){var r=this;this.timeout=window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){if(r.area){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'"></textarea>'}else{return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}}});var p=Backbone.View.extend({initialize:function(r){this.options=r;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(r){if(r!==undefined){this.$("hidden").val(r)}return this.$("hidden").val()},_template:function(s){var r='<div id="'+s.id+'" >';if(s.info){r+="<label>"+s.info+"</label>"}r+='<hidden value="'+s.value+'"/></div>';return r}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:i,Label:j,Message:n,Modal:m,RadioButton:o.RadioButton,Checkbox:o.Checkbox,Radio:o.Radio,Searchbox:a,Select:b,Hidden:p,Slider:e,Drilldown:l}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(d,g,h,l,k,r,b){var p=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return'<img class="ui-image '+s.cls+'" src="'+s.url+'"/>'}});var i=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'<label class="ui-label '+s.cls+'">'+s.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'<div><span class="fa '+s.icon+'" class="ui-icon"/> '+s.title+"</div>"}});var f=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){var t='<button id="'+s.id+'" type="submit" style="float: '+s.floating+';" type="button" class="'+s.cls+'">';if(s.icon){t+='<i class="icon fa '+s.icon+'"></i> '}t+=s.title+"</button>";return t}});var n=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var s=this;$(this.el).on("click",function(){$(".tooltip").hide();if(t.onclick&&!s.disabled){t.onclick()}});$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},setIcon:function(s){this.$("i").removeClass(this.options.icon).addClass(s);this.options.icon=s},_template:function(s){var t="";if(s.title){t="width: auto;"}var u='<div id="'+s.id+'" style="float: '+s.floating+"; "+t+'" class="'+s.cls+'">';if(s.title){u+='<div class="button"><i class="icon fa '+s.icon+'"/> <span class="title">'+s.title+"</span></div>"}else{u+='<i class="icon fa '+s.icon+'"/>'}u+="</div>";return u}});var o=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick)},_template:function(s){return'<div><a href="javascript:void(0)" class="ui-anchor '+s.cls+'">'+s.title+"</a></div>"}});var a=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:false},initialize:function(s){this.options=d.merge(s,this.optionsDefault);this.setElement("<div></div>");if(this.options.message){this.update(this.options)}},update:function(t){this.options=d.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(t.message);this.$el.fadeIn();if(this.timeout){window.clearTimeout(this.timeout)}if(!t.persistent){var s=this;this.timeout=window.setTimeout(function(){if(s.$el.is(":visible")){s.$el.fadeOut()}else{s.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(s){return'<div class="ui-message alert alert-'+s.status+'"/>'}});var e=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));var s=this;if(this.options.onclick){this.$el.on("submit",function(v){var u=s.$el.find("#search");s.options.onclick(u.val())})}},_template:function(s){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+s.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var m=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var s=this;this.$el.on("input",function(){if(s.options.onchange){s.options.onchange(s.$el.val())}})},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){if(s.area){return'<textarea id="'+s.id+'" class="ui-textarea '+s.cls+'"></textarea>'}else{return'<input id="'+s.id+'" type="'+s.type+'" value="'+s.value+'" placeholder="'+s.placeholder+'" class="ui-input '+s.cls+'">'}}});var j=Backbone.View.extend({initialize:function(s){this.options=s;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(s){if(s!==undefined){this.$("hidden").val(s)}return this.$("hidden").val()},_template:function(t){var s='<div id="'+t.id+'" >';if(t.info){s+="<label>"+t.info+"</label>"}s+='<hidden value="'+t.value+'"/></div>';return s}});var q=Backbone.View.extend({optionsDefault:{class_add:"fa fa-square-o",class_remove:"fa fa-check-square-o",class_partial:"fa fa-minus-square-o",value:false},initialize:function(t){this.options=d.merge(t,this.optionsDefault);this.setElement($("<div/>"));this.value(Boolean(this.options.value));var s=this;this.$el.on("click",function(){s.value(!s.current)})},value:function(s){if(s!==undefined){this.current=s;if(s){this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_remove)}else{this.$el.removeClass().addClass("ui-checkbutton").addClass(this.options.class_add)}this.options.onchange&&this.options.onchange(s)}return this.current}});return{Anchor:o,Button:f,ButtonIcon:n,ButtonMenu:r,Icon:c,Image:p,Input:m,Label:i,Message:a,Modal:b,RadioButton:l.RadioButton,Checkbox:l.Checkbox,Radio:l.Radio,CheckButton:q,Searchbox:e,Select:g,Hidden:j,Slider:h,Drilldown:k}}); \ No newline at end of file diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/scripts/packed/mvc/upload/upload-model.js --- a/static/scripts/packed/mvc/upload/upload-model.js +++ b/static/scripts/packed/mvc/upload/upload-model.js @@ -1,1 +1,1 @@ -define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,row:null,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}}); \ No newline at end of file +define([],function(){var b=Backbone.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_mode:"local",file_size:0,file_type:null,file_path:"",percentage:0,space_to_tabs:false,to_posix_lines:true}});var a=Backbone.Collection.extend({model:b});return{Model:b,Collection:a}}); \ No newline at end of file diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 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(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select"],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(j,h){this.app=j;var g="Auto-detect";var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var i=this.$el;this.settings=new c.View({title:"Upload configuration",container:i.find("#settings"),placement:"bottom"});this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:i.find("#genome"),value:f.model.get("genome")});this.model.set("genome",f.select_genome.value());if(!(this.app.select_extension.value()==="---")){this.default_ext=this.app.select_extension.value()}this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value());if(!(f.select_extension.value()===j.select_extension.value())){var k="---";j.select_extension.value(k)}},data:f.app.list_extensions,container:i.find("#extension"),value:f.default_ext});this.model.set("extension",f.select_extension.value());i.find("#symbol").on("click",function(){f._removeRow()});i.find("#extension-info").on("click",function(k){f._showExtensionInfo()}).on("mousedown",function(k){k.preventDefault()});i.find("#settings").on("click",function(k){f._showSettings()}).on("mousedown",function(k){k.preventDefault()});i.find("#text-content").on("keyup",function(k){f.model.set("url_paste",$(k.target).val());f.model.set("file_size",$(k.target).val().length)});i.find("#space_to_tabs").on("change",function(k){f.model.set("space_to_tabs",$(k.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()});f.model.set("row",f)},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshGenome:function(){var f=this.model.get("genome");this.select_genome.value(f)},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showExtensionInfo:function(){var f=$(this.el).find("#extension-info");var i=this.model.get("extension");var h=this.select_extension.text();var g=_.findWhere(this.app.list_extensions,{id:i});if(!this.extension_popup){this.extension_popup=new c.View({placement:"bottom",container:f})}if(!this.extension_popup.visible){this.extension_popup.title(h);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(g));this.extension_popup.show()}else{this.extension_popup.hide()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_templateDescription:function(g){if(g.description){var f=g.description;if(g.description_url){f+=' (<a href="'+g.description_url+'" target="_blank">read more</a>)'}return f}else{return"There is no description available for this file extension."}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div style="position: relative;"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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>'}})}); \ No newline at end of file +define(["utils/utils","mvc/upload/upload-model","mvc/upload/upload-settings","mvc/ui/ui-popover","mvc/ui/ui-select",],function(d,b,a,c,e){return Backbone.View.extend({options:{padding:8},status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},settings:null,select_genome:null,select_extension:null,initialize:function(k,h){this.app=k;var f=this;this.model=new b.Model(h);this.setElement(this._template(h));var j=this.$el;this.settings=new c.View({title:"Upload configuration",container:j.find("#settings"),placement:"bottom"});var i=this.app.select_genome.value();this.select_genome=new e.View({css:"genome",onchange:function(){f.model.set("genome",f.select_genome.value())},data:f.app.list_genomes,container:j.find("#genome"),value:i});this.model.set("genome",i);var g=this.app.select_extension.value();this.select_extension=new e.View({css:"extension",onchange:function(){f.model.set("extension",f.select_extension.value())},data:f.app.list_extensions,container:j.find("#extension"),value:g});this.model.set("extension",g);j.find("#symbol").on("click",function(){f._removeRow()});j.find("#extension-info").on("click",function(l){f.app.showExtensionInfo({$el:$(l.target),title:f.select_extension.text(),extension:f.select_extension.value()})}).on("mousedown",function(l){l.preventDefault()});j.find("#settings").on("click",function(l){f._showSettings()}).on("mousedown",function(l){l.preventDefault()});j.find("#text-content").on("keyup",function(l){f.model.set("url_paste",$(l.target).val());f.model.set("file_size",$(l.target).val().length)});j.find("#space_to_tabs").on("change",function(l){f.model.set("space_to_tabs",$(l.target).prop("checked"))});this.model.on("change:percentage",function(){f._refreshPercentage()});this.model.on("change:status",function(){f._refreshStatus()});this.model.on("change:info",function(){f._refreshInfo()});this.model.on("change:genome",function(){f._refreshGenome()});this.model.on("change:extension",function(){f._refreshExtension()});this.model.on("change:file_size",function(){f._refreshFileSize()});this.model.on("remove",function(){f.remove()});this.app.collection.on("reset",function(){f.remove()})},render:function(){var m=this.model.get("file_name");var g=this.model.get("file_size");var j=this.model.get("file_mode");var i=this.$el;i.find("#title").html(m);i.find("#size").html(d.bytesToString(g));i.find("#mode").removeClass().addClass("mode");if(j=="new"){var l=i.find("#text");var k=this.options.padding;var h=i.width()-2*k;var f=i.height()-k;l.css("width",h+"px");l.css("top",f+"px");i.height(f+l.height()+2*k);l.show();i.find("#mode").addClass("fa fa-pencil")}if(j=="local"){i.find("#mode").addClass("fa fa-laptop")}if(j=="ftp"){i.find("#mode").addClass("fa fa-code-fork")}},remove:function(){this.select_genome.remove();this.select_extension.remove();Backbone.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var f=this.model.get("info");if(f){this.$el.find("#info").html("<strong>Failed: </strong>"+f).show()}else{this.$el.find("#info").hide()}},_refreshPercentage:function(){var f=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:f+"%"});if(f!=100){this.$el.find("#percentage").html(f+"%")}else{this.$el.find("#percentage").html("Adding to history...")}},_refreshStatus:function(){var g=this.$el;var f=this.model.get("status");var i=this.status_classes[f];var h=this.$el.find("#symbol");h.removeClass();h.addClass(i);if(f=="init"){this.select_genome.enable();this.select_extension.enable();g.find("#text-content").attr("disabled",false);g.find("#space_to_tabs").attr("disabled",false)}else{this.select_genome.disable();this.select_extension.disable();g.find("#text-content").attr("disabled",true);g.find("#space_to_tabs").attr("disabled",true)}if(f=="success"){g.addClass("success");g.find("#percentage").html("100%")}if(f=="error"){g.addClass("danger");g.find(".progress").remove()}},_refreshFileSize:function(){var f=this.model.get("file_size");this.$el.find("#size").html(d.bytesToString(f))},_removeRow:function(){var f=this.model.get("status");if(f=="init"||f=="success"||f=="error"){this.app.collection.remove(this.model)}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new a(this)).$el);this.settings.show()}else{this.settings.hide()}},_template:function(f){return'<tr id="upload-item-'+f.id+'" class="upload-item"><td><div class="name-column"><div id="mode"></div><div id="title" class="title"></div><div id="text" class="text"><div class="text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly 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><td><div id="extension" class="extension" style="float: left;"/>  <div id="extension-info" class="upload-icon-button fa fa-search"/></td><td><div id="genome" class="genome" /></td><td><div id="settings" class="upload-icon-button fa fa-gear"></div><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>'}})}); \ No newline at end of file diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 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(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(k){var j=this;if(k){this.options=_.defaults(k,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(l){if(l){l.preventDefault();j.show()}},onunload:function(){if(j.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var j=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(l){for(key in l){j.list_extensions.push({id:l[key].extension,text:l[key].extension,description:l[key].description,description_url:l[key].description_url})}j.list_extensions.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0});j.list_extensions.push({id:"---",text:"---",description:"",description_url:""});if(!j.options.datatypes_disable_auto){j.list_extensions.unshift(j.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(l){for(key in l){j.list_genomes.push({id:l[key][1],text:l[key][0]})}j.list_genomes.sort(function(n,m){return n.id>m.id?1:n.id<m.id?-1:0})}});this.collection.on("remove",function(l){j._eventRemove(l)});this.collection.on("change:genome",function(m){var l=m.get("genome");j.collection.each(function(n){if(n.get("status")=="init"&&n.get("genome")=="?"){n.set("genome",l)}})})},show:function(){var j=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){j.show()},500);return}if(!this.modal){var j=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){j.uploadbox.select()},"Choose FTP file":function(){j._eventFtp()},"Paste/Fetch data":function(){j._eventCreate()},Start:function(){j._eventStart()},Pause:function(){j._eventStop()},Reset:function(){j._eventReset()},Close:function(){j.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var j=this;this.uploadbox=this.$el.uploadbox({announce:function(l,m,n){j._eventAnnounce(l,m,n)},initialize:function(l,m,n){return j._eventInitialize(l,m,n)},progress:function(l,m,n){j._eventProgress(l,m,n)},success:function(l,m,n){j._eventSuccess(l,m,n)},error:function(l,m,n){j._eventError(l,m,n)},complete:function(){j._eventComplete()}});var k=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:k});this.select_extension=new h.View({css:"extension",onchange:function(){var m=j.select_extension.value();var l=j.collection.models.length;if(!(m==="---")){for(i=0;i<l;i++){j.collection.models[i].attributes.row.select_extension.value(m)}}},data:j.list_extensions,container:j.$el.parents().find("#extension"),value:j.list_extensions[0]});j.$el.parents().find("#extension-info_out").on("click",function(l){j._showExtensionInfo()}).on("mousedown",function(l){l.preventDefault()})}this.modal.show();this._updateUser();this._updateScreen()},_showExtensionInfo:function(){var j=this;var k=$(this.el).parents().find("#extension-info_out");var n=j.select_extension.value();var m=this.select_extension.text();var l=_.findWhere(j.list_extensions,{id:n});if(!this.extension_popup){this.extension_popup=new d.View({placement:"bottom",container:k})}if(!this.extension_popup.visible){this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()}else{this.extension_popup.hide()}},_templateDescription:function(k){if(k.description){var j=k.description;if(k.description_url){j+=' (<a href="'+k.description_url+'" target="_blank">read more</a>)'}return j}else{return"There is no description available for this file extension."}},_eventRemove:function(k){var j=k.get("status");if(j=="success"){this.counter.success--}else{if(j=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(k.id)},_eventAnnounce:function(j,k,m){this.counter.announce++;this._updateScreen();var l=new b(this,{id:j,file_name:k.name,file_size:k.size,file_mode:k.mode,file_path:k.path});this.collection.add(l.model);$(this.el).find("tbody:first").append(l.$el);l.render()},_eventInitialize:function(o,l,u){var m=this.collection.get(o);m.set("status","running");var q=m.get("file_name");var p=m.get("file_path");var j=m.get("file_mode");var r=m.get("extension");var t=m.get("genome");var s=m.get("url_paste");var n=m.get("space_to_tabs");var k=m.get("to_posix_lines");if(!s&&!(l.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(j=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(j=="new"){tool_input["files_0|url_paste"]=s}if(j=="ftp"){tool_input["files_0|ftp_files"]=p}tool_input.dbkey=t;tool_input.file_type=r;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=n&&"Yes"||null;tool_input["files_0|to_posix_lines"]=k&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(k,l,j){var m=this.collection.get(k);m.set("percentage",j);this.ui_button.set("percentage",this._upload_percentage(j,l.size))},_eventSuccess:function(k,l,n){var m=this.collection.get(k);m.set("percentage",100);m.set("status","success");var j=m.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,j));this.upload_completed+=j*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","error");l.set("info",m);this.ui_button.set("percentage",this._upload_percentage(100,k.size));this.ui_button.set("status","danger");this.upload_completed+=k.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(j){if(j.get("status")=="queued"){j.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var j=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(k){if(k.get("status")=="init"){k.set("status","queued");j.upload_size+=k.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.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.select_extension.value(this.list_extensions[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: 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 'Start' 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("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(j,k){return(this.upload_completed+(j*k))/this.upload_size},_template:function(k,j){return'<div id="uploadhead" class="uploadhead"><span class="fftext">"Set All" Types:  </span><span id="extension" class="extension"/>  <span id="extension-info_out" class="upload-icon-button fa fa-search"/></div><div id="'+k+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="uploadfoot"><h6 id="'+j+'" class="upload-info"></h6></div>'}})}); \ No newline at end of file +define(["utils/utils","mvc/upload/upload-button","mvc/upload/upload-model","mvc/upload/upload-row","mvc/upload/upload-ftp","mvc/ui/ui-popover","mvc/ui/ui-modal","mvc/ui/ui-select","utils/uploadbox"],function(f,e,c,b,g,d,a,h){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history:null,select_extension:null,select_genome:null,upload_size:0,list_extensions:[],list_genomes:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},collection:new c.Collection(),ftp:null,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(j){var i=this;if(j){this.options=_.defaults(j,this.options)}this.ui_button=new e.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(k){if(k){k.preventDefault();i.show()}},onunload:function(){if(i.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var i=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(k){for(key in k){i.list_extensions.push({id:k[key].extension,text:k[key].extension,description:k[key].description,description_url:k[key].description_url})}i.list_extensions.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0});if(!i.options.datatypes_disable_auto){i.list_extensions.unshift(i.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(k){for(key in k){i.list_genomes.push({id:k[key][1],text:k[key][0]})}i.list_genomes.sort(function(m,l){return m.id>l.id?1:m.id<l.id?-1:0})}});this.collection.on("remove",function(k){i._eventRemove(k)})},show:function(){var i=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){i.show()},500);return}if(!this.modal){var i=this;this.modal=new a.View({title:"Download data directly from web or upload files from your disk",body:this._template("upload-box","upload-info"),buttons:{"Choose local file":function(){i.uploadbox.select()},"Choose FTP file":function(){i._eventFtp()},"Paste/Fetch data":function(){i._eventCreate()},Start:function(){i._eventStart()},Pause:function(){i._eventStop()},Reset:function(){i._eventReset()},Close:function(){i.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var i=this;this.uploadbox=this.$el.uploadbox({announce:function(k,l,m){i._eventAnnounce(k,l,m)},initialize:function(k,l,m){return i._eventInitialize(k,l,m)},progress:function(k,l,m){i._eventProgress(k,l,m)},success:function(k,l,m){i._eventSuccess(k,l,m)},error:function(k,l,m){i._eventError(k,l,m)},complete:function(){i._eventComplete()}});var j=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:j});this.select_extension=new h.View({css:"header-selection",data:i.list_extensions,container:i.$el.parent().find("#header-extension"),value:i.list_extensions[0]});i.$el.parent().find("#header-extension-info").on("click",function(k){i.showExtensionInfo({$el:$(k.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(k){k.preventDefault()});this.select_genome=new h.View({css:"header-selection",data:i.list_genomes,container:i.$el.parent().find("#header-genome"),value:i.list_genomes[0]})}this.modal.show();this._updateUser();this._updateScreen()},showExtensionInfo:function(j){var i=this;var k=j.$el;var n=j.extension;var m=j.title;var l=_.findWhere(i.list_extensions,{id:n});this.extension_popup&&this.extension_popup.remove();this.extension_popup=new d.View({placement:"bottom",container:k,destroy:true});this.extension_popup.title(m);this.extension_popup.empty();this.extension_popup.append(this._templateDescription(l));this.extension_popup.show()},_eventRemove:function(j){var i=j.get("status");if(i=="success"){this.counter.success--}else{if(i=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(j.id)},_eventAnnounce:function(i,j,l){this.counter.announce++;this._updateScreen();var k=new b(this,{id:i,file_name:j.name,file_size:j.size,file_mode:j.mode,file_path:j.path});this.collection.add(k.model);$(this.el).find("tbody:first").append(k.$el);k.render()},_eventInitialize:function(n,k,t){var l=this.collection.get(n);l.set("status","running");var p=l.get("file_name");var o=l.get("file_path");var i=l.get("file_mode");var q=l.get("extension");var s=l.get("genome");var r=l.get("url_paste");var m=l.get("space_to_tabs");var j=l.get("to_posix_lines");if(!r&&!(k.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(i=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(i=="new"){tool_input["files_0|url_paste"]=r}if(i=="ftp"){tool_input["files_0|ftp_files"]=o}tool_input.dbkey=s;tool_input.file_type=q;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=m&&"Yes"||null;tool_input["files_0|to_posix_lines"]=j&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(j,k,i){var l=this.collection.get(j);l.set("percentage",i);this.ui_button.set("percentage",this._upload_percentage(i,k.size))},_eventSuccess:function(j,k,m){var l=this.collection.get(j);l.set("percentage",100);l.set("status","success");var i=l.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,i));this.upload_completed+=i*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","error");k.set("info",l);this.ui_button.set("percentage",this._upload_percentage(100,j.size));this.ui_button.set("status","danger");this.upload_completed+=j.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(i){if(i.get("status")=="queued"){i.set("status","init")}});this.counter.running=0;this._updateScreen()},_eventFtp:function(){if(!this.ftp.visible){this.ftp.empty();this.ftp.append((new g(this)).$el);this.ftp.show()}else{this.ftp.hide()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(this.counter.announce==0||this.counter.running>0){return}var i=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(j){if(j.get("status")=="init"){j.set("status","queued");i.upload_size+=j.get("file_size")}});this.ui_button.set("percentage",0);this.ui_button.set("status","success");this.counter.running=this.counter.announce;this._updateScreen();this.uploadbox.start()},_eventStop:function(){if(this.counter.running==0){return}this.ui_button.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.select_extension.value(this.list_extensions[0]);this.select_genome.value(this.list_genomes[0]);this.ui_button.set("percentage",0)}},_updateUser:function(){this.current_user=Galaxy.currUser.get("id");this.current_history=null;if(this.current_user){this.current_history=Galaxy.currHistoryPanel.model.get("id")}},_updateScreen:function(){if(this.counter.announce==0){if(this.uploadbox.compatible()){message="You can Drag & Drop files into this box."}else{message="Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Some supported browsers are: 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 'Start' 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("Start")}else{this.modal.disableButton("Start")}if(this.counter.running>0){this.modal.enableButton("Pause")}else{this.modal.disableButton("Pause")}if(this.counter.running==0){this.modal.enableButton("Choose local file");this.modal.enableButton("Choose FTP file");this.modal.enableButton("Paste/Fetch data")}else{this.modal.disableButton("Choose local file");this.modal.disableButton("Choose FTP file");this.modal.disableButton("Paste/Fetch data")}if(this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site){this.modal.showButton("Choose FTP file")}else{this.modal.hideButton("Choose FTP file")}if(this.counter.announce+this.counter.success+this.counter.error>0){$(this.el).find("#upload-table").show()}else{$(this.el).find("#upload-table").hide()}},_upload_percentage:function(i,j){return(this.upload_completed+(i*j))/this.upload_size},_templateDescription:function(j){if(j.description){var i=j.description;if(j.description_url){i+=' (<a href="'+j.description_url+'" target="_blank">read more</a>)'}return i}else{return"There is no description available for this file extension."}},_template:function(j,i){return'<div id="upload-header" class="upload-header"><span class="header-title">Type (default):</span><span id="header-extension"/><span id="header-extension-info" class="upload-icon-button fa fa-search"/><span class="header-title">Genome (default):</span><span id="header-genome"/></div><div id="'+j+'" class="upload-box"><table id="upload-table" class="table table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th></th></tr></thead><tbody></tbody></table></div><div class="upload-footer"><h6 id="'+i+'" class="upload-info"></h6></div>'}})}); \ No newline at end of file diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -119,12 +119,6 @@ .table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0} .table tbody+tbody{border-top:2px solid #d6b161} .table .table{background-color:#fff} -.uploadhead{height:10%; text-align:left; max-height:20px; line-height:18px; margin-bottom: 5px;} -.uploadfoot{height:5%; text-align:center;} -.uploadhead .fftext{font-weight: bold;} -.uploadhead .select2-container .select2-choice .select2-arrow b{background-position:0 -3px} -.uploadhead .extension{width:100px;min-width:100px;font-size:11px} -.uploadhead .select2-container .select2-choice{max-height:20px;line-height:18px;text-align:center; font-weight: normal;} .table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px} .table-bordered{border:1px solid #d6b161}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #d6b161} .table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px} @@ -1375,13 +1369,13 @@ .upload-button .label{position:absolute;top:2px;width:inherit;text-align:center;line-height:19px;font-size:1.2em} .upload-icon{font-size:1.2em;width:1.2em} .upload-icon-button{font-size:1.2em;width:1.2em;cursor:pointer} -.upload-info{font-weight:normal;text-align:center} -.upload-box{width:100%;height:85%;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{width:100%;height:90%;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} .upload-box .table td{margin:0px} .upload-box .upload-item .select2-arrow b{background-position:0 -3px} .upload-box .upload-item .select2-choice{max-height:20px;line-height:18px;background:transparent} .upload-box .upload-item .select2-container-disabled .select2-arrow{background:transparent} +.upload-box .name-column{position:relative} .upload-box .mode{float:left;font-size:1.2em;width:1.2em;color:#555} .upload-box .title{width:130px;word-wrap:break-word;font-size:11px;float:left} .upload-box .text{position:absolute;display:none}.upload-box .text .text-content{font-size:11px;width:100%;height:50px;resize:none;background:inherit;color:#000} @@ -1395,6 +1389,10 @@ .upload-ftp .upload-ftp-help{margin-bottom:10px} .upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px} .upload-settings .upload-settings-cover{position:absolute;width:100%;height:100%;top:0px;left:0px;background:#fff;opacity:0.4;cursor:no-drop} +.upload-header{height:5%;text-align:left;max-height:20px;line-height:18px;margin-bottom:15px}.upload-header .header-title{font-weight:bold;padding-left:60px;padding-right:20px} +.upload-header .header-selection{width:200px;min-width:200px;font-size:11px;padding-right:10px} +.upload-header .select2-choice{max-height:20px;line-height:18px;background:transparent;text-align:center;font-weight:normal}.upload-header .select2-choice .select2-arrow b{background-position:0 -3px} +.upload-footer{height:5%;text-align:center}.upload-footer .upload-info{font-weight:normal;text-align:center} .no-highlight,.ui-button-icon,.ui-portlet,.ui-portlet-slim,.ui-portlet-repeat,.ui-portlet-section{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;} .ui-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px} .ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px} @@ -1435,6 +1433,7 @@ .ui-form-slider .ui-form-slider-element{width:calc(100% - 110px);float:left;top:8px;left:10px} .ui-radiobutton{width:100%}.ui-radiobutton label{height:23px;line-height:1em} .ui-radiobutton i{padding-right:5px} +.ui-checkbutton{font-size:1.2em;width:1.2em;cursor:pointer} .ui-select{position:relative}.ui-select .button{position:absolute;top:5px;right:5px} .ui-select .select2-container{width:100%} .ui-select select{position:relative;top:0px;height:27px;width:100%;padding-left:5px;padding-right:20px;cursor:pointer;background:transparent;-webkit-appearance:none;border:1px solid #bfbfbf;-moz-border-radius:3px;border-radius:3px} diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/ui.less --- a/static/style/src/less/ui.less +++ b/static/style/src/less/ui.less @@ -298,6 +298,12 @@ } } +.ui-checkbutton { + font-size: 1.2em; + width: 1.2em; + cursor: pointer; +} + .ui-select { position: relative; .button { diff -r 49d651198b3a7756936c4b578ccdd824b2c55e4e -r dc3357ffb6d9100b5a6eac4b774b70e180ab0e22 static/style/src/less/upload.less --- a/static/style/src/less/upload.less +++ b/static/style/src/less/upload.less @@ -52,14 +52,9 @@ cursor: pointer; } -.upload-info { - font-weight: normal; - text-align: center; -} - .upload-box { width : 100%; - height : 95%; + height : 90%; text-align : center; overflow : scroll; font-size : @font-size-base; @@ -102,6 +97,10 @@ } } + .name-column { + position: relative; + } + .mode { float: left; font-size: 1.2em; @@ -214,3 +213,41 @@ cursor: no-drop; } } + +.upload-header { + height:5%; + text-align:left; + max-height:20px; + line-height:18px; + margin-bottom: 15px; + .header-title { + font-weight: bold; + padding-left: 60px; + padding-right: 20px; + } + .header-selection{ + width:200px; + min-width:200px; + font-size:11px; + padding-right: 10px; + } + .select2-choice { + .select2-arrow b { + background-position: 0 -3px; + } + max-height: 20px; + line-height: 18px; + background: transparent; + text-align:center; + font-weight: normal; + } +} + +.upload-footer { + height:5%; + text-align:center; + .upload-info { + font-weight: normal; + text-align: center; + } +} \ 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.
participants (1)
-
commits-noreply@bitbucket.org