commit/galaxy-central: guerler: Add genome selector to file upload
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/443c97b1017e/ Changeset: 443c97b1017e User: guerler Date: 2013-10-16 03:04:47 Summary: Add genome selector to file upload Affected #: 4 files diff -r 9da85b79e0000f83e0232c06188ce89fd0e969a8 -r 443c97b1017eae9374ab91c0d87a19252db8a0e0 static/scripts/galaxy.modal.js --- a/static/scripts/galaxy.modal.js +++ b/static/scripts/galaxy.modal.js @@ -15,7 +15,9 @@ optionsDefault: { title : "galaxy-modal", body : "", - backdrop : true + backdrop : true, + height : null, + width : null }, // options @@ -23,7 +25,6 @@ // initialize initialize : function(options) { - // create if (options) this.create(options); }, @@ -32,18 +33,18 @@ show: function(options) { // create this.initialize(options); + + // fix height + if (this.options.height) + { + this.$body.css('height', this.options.height); + this.$body.css('overflow', 'hidden'); + } else + this.$body.css('max-height', $(window).height() / 2); - // fix height - var maxHeight = $(document).height() / 2; - this.$body.css('max-height', maxHeight); - - // fix height if available - if (this.options.height) - this.$body.css('height', Math.min(this.options.height, maxHeight)); - - // remove scroll bar - if (this.options.height) - this.$body.css('overflow', 'hidden'); + // fix width + if (this.options.width) + this.$dialog.css('width', this.options.width); // show if (this.visible) @@ -81,6 +82,7 @@ this.setElement(this.template(this.options.title)); // link elements + this.$dialog = (this.$el).find('.modal-dialog'); this.$body = (this.$el).find('.modal-body'); this.$footer = (this.$el).find('.modal-footer'); this.$buttons = (this.$el).find('.buttons'); @@ -89,9 +91,6 @@ // append body this.$body.html(this.options.body); - // fix min-width so that modal cannot shrink considerably if new content is loaded. - this.$body.css('min-width', this.$body.width()); - // configure background if (!this.options.backdrop) this.$backdrop.removeClass('in'); diff -r 9da85b79e0000f83e0232c06188ce89fd0e969a8 -r 443c97b1017eae9374ab91c0d87a19252db8a0e0 static/scripts/galaxy.upload.js --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -22,6 +22,11 @@ 'auto' : 'Auto-detect' }, + // genomes + select_genome : { + '?' : 'Unspecified' + }, + // states state : { init : 'fa-icon-trash', @@ -82,10 +87,15 @@ var self = this; mod_util.jsonFromUrl(galaxy_config.root + "api/datatypes", function(datatypes) { - for (key in datatypes) { - var filetype = datatypes[key]; - self.select_extension[filetype] = filetype; - } + for (key in datatypes) + self.select_extension[datatypes[key]] = datatypes[key]; + }); + + // load genomes + mod_util.jsonFromUrl(galaxy_config.root + "api/genomes", + function(genomes) { + for (key in genomes) + self.select_genome[genomes[key][1]] = genomes[key][0]; }); }, @@ -106,7 +116,7 @@ var id = '#upload-' + index; // add upload item - $(this.el).find('tbody:last').append(this.template_row(id, this.select_extension)); + $(this.el).find('tbody:last').append(this.template_row(id)); // scroll to bottom //$(this.el).scrollTop($(this.el).prop('scrollHeight')); @@ -153,6 +163,7 @@ // get configuration var current_history = Galaxy.currHistoryPanel.model.get('id'); var file_type = it.find('#extension').val(); + var genome = it.find('#genome').val(); var space_to_tabs = it.find('#space_to_tabs').is(':checked'); // configure uploadbox @@ -160,7 +171,7 @@ // configure tool tool_input = {}; - tool_input['dbkey'] = '?'; + tool_input['dbkey'] = genome; tool_input['file_type'] = file_type; tool_input['files_0|NAME'] = file.name; tool_input['files_0|type'] = 'upload_dataset'; @@ -285,6 +296,7 @@ symbol.addClass(self.state.queued); // disable options + $(this).find('#genome').attr('disabled', true); $(this).find('#extension').attr('disabled', true); $(this).find('#space_to_tabs').attr('disabled', true); } @@ -332,6 +344,7 @@ symbol.addClass(self.state.init); // disable options + $(this).find('#genome').attr('disabled', false); $(this).find('#extension').attr('disabled', false); $(this).find('#space_to_tabs').attr('disabled', false); } @@ -410,7 +423,8 @@ 'Reset' : function() {self.event_reset()}, 'Close' : function() {self.modal.hide()} }, - height : '350' + height : '350', + width : '850' }); // set element @@ -528,6 +542,7 @@ '<th>Name</th>' + '<th>Size</th>' + '<th>Type</th>' + + '<th>Genome</th>' + '<th>Space→Tab</th>' + '<th>Status</th>' + '<th></th>' + @@ -539,22 +554,31 @@ '<h6 id="' + idInfo + '" class="upload-info"></h6>'; }, - template_row: function(id, select_extension) + template_row: function(id) { // construct template var tmpl = '<tr id="' + id.substr(1) + '" class="upload-item">' + '<td><div id="title" class="title"></div></td>' + - '<td><div id="size" class="size"></div></td>' + - '<td>' + + '<td><div id="size" class="size"></div></td>'; + + // add file type selectore + tmpl += '<td>' + '<select id="extension" class="extension">'; + for (key in this.select_extension) + tmpl += '<option value="' + key + '">' + this.select_extension[key] + '</option>'; + tmpl += '</select>' + + '</td>'; - // add file types to selection - for (key in select_extension) - tmpl += '<option value="' + key + '">' + select_extension[key] + '</option>'; - + // add genome selector + tmpl += '<td>' + + '<select id="genome" class="genome">'; + for (key in this.select_genome) + tmpl += '<option value="' + key + '">' + this.select_genome[key] + '</option>'; tmpl += '</select>' + - '</td>' + - '<td><input id="space_to_tabs" type="checkbox"></input></td>' + + '</td>'; + + // add next row + tmpl += '<td><input id="space_to_tabs" type="checkbox"></input></td>' + '<td>' + '<div id="info" class="info">' + '<div class="progress">' + diff -r 9da85b79e0000f83e0232c06188ce89fd0e969a8 -r 443c97b1017eae9374ab91c0d87a19252db8a0e0 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1130,6 +1130,7 @@ .upload-box .table td{margin:0px;paddign:0px} .upload-box .title{width:130px;word-wrap:break-word;font-size:11px} .upload-box .extension{width:100px;font-size:11px} +.upload-box .genome{width:150px;font-size:11px} .upload-box .size{width:60px;white-space:nowrap} .upload-box .info{width:130px;font-size:11px}.upload-box .info .progress{top:1px;position:relative;width:100%;padding:0px;margin:0px}.upload-box .info .progress .progress-bar{border-radius:inherit;-moz-border-radius:inherit} .upload-box .info .progress .percentage{position:absolute;text-align:center;width:100%;color:#fff} diff -r 9da85b79e0000f83e0232c06188ce89fd0e969a8 -r 443c97b1017eae9374ab91c0d87a19252db8a0e0 static/style/src/less/upload.less --- a/static/style/src/less/upload.less +++ b/static/style/src/less/upload.less @@ -44,6 +44,11 @@ font-size : @font-size-small; } + .genome { + width: 150px; + font-size : @font-size-small; + } + .size { width: 60px; white-space: nowrap; 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