Upload: Add file extension descriptions

This commit is contained in:
Aysam Guerler
2014-02-04 14:53:26 -05:00
parent 832d0c7985
commit 96536ecf27
8 changed files with 167 additions and 8 deletions
@@ -0,0 +1,110 @@
// dependencies
define([], function() {
var dictionary = {
auto : {
text: 'The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. 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'
},
ab1 : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Ab1',
text: 'A binary sequence file in \'ab1\' format with a \'.ab1\' file extension. You must manually select this \'File Format\' when uploading the file.'
},
axt : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Axt',
text: 'blastz pairwise alignment format. Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields.'
},
bam : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#BAM',
text: 'A binary file compressed in the BGZF format with a \'.bam\' file extension.'
},
bed : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Bed',
text: 'BED format provides a flexible way to define the data lines that are displayed in an annotation track. BED lines have three required columns and nine additional optional columns. The three required columns are chrom, chromStart and chromEnd.'
},
fasta : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Fasta',
text: 'A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than (">") symbol in the first column. All lines should be shorter than 80 characters.'
},
fastq : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Fastq',
text: 'FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores. '
},
fastqsolexa : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#FastqSolexa',
text: 'FastqSolexa is the Illumina (Solexa) variant of the Fastq format, which stores sequences and quality scores in a single file.'
},
gff : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF',
text: 'GFF lines have nine required fields that must be tab-separated.'
},
gff3 : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3',
text: 'The GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats.'
},
interval : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3',
text: 'File must start with definition line in the following format (columns may be in any order).'
},
lav : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#GFF3',
text: 'Lav is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav..'
},
maf : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#MAF',
text: 'TBA and multiz multiple alignment format. The first line of a .maf file begins with ##maf. This word is followed by white-space-separated "variable=value" pairs. There should be no white space surrounding the "=".'
},
scf : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Scf',
text: 'A binary sequence file in \'scf\' format with a \'.scf\' file extension. You must manually select this \'File Format\' when uploading the file.'
},
sff : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Sff',
text: 'A binary file in \'Standard Flowgram Format\' with a \'.sff\' file extension.'
},
tabular : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Tabular_.28tab_delimited.29',
text: 'Any data in tab delimited format (tabular).'
},
wig : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Wig',
text: 'The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track.'
},
txt : {
url : 'https://wiki.galaxyproject.org/Learn/Datatypes#Plain_text',
text: 'Any text file.'
},
};
// create description content
return function(key) {
var description = dictionary[key];
if (description) {
var tmpl = description.text;
if (description.url) {
tmpl += '&nbsp;(<a href="' + description.url + '" target="_blank">read more</a>)';
}
return tmpl;
} else {
return 'There is no description available for this file extension.';
}
}
});
+45 -3
View File
@@ -1,11 +1,12 @@
// dependencies
define(['mvc/upload/upload-model'], function(UploadModel) {
define(['mvc/upload/upload-model', 'mvc/upload/upload-extensions'], function(UploadModel, UploadExtensions) {
// item view
return Backbone.View.extend({
// options
options: {
padding : 8
padding : 8,
timeout : 2000
},
// states
@@ -46,6 +47,10 @@ return Backbone.View.extend({
self.app.collection.remove(self.model);
}
});
// handle mouse over
it.find('#extension_info').on('mouseover' , function() { self._showExtensionInfo(); })
.on('mouseleave', function() { self._hideExtensionInfo(); });
// handle text editing event
it.find('#text-content').on('keyup', function() {
@@ -70,6 +75,7 @@ return Backbone.View.extend({
// handle extension selection
it.find('#extension').on('change', function(e) {
self.model.set('extension', $(e.target).val());
self.$el.find('#extension_info').popover('destroy');
});
// handle space to tabs button
@@ -139,7 +145,7 @@ return Backbone.View.extend({
// genome
_refreshGenome: function()
{
// write error message
// update genome info on screen
var genome = this.model.get('genome');
this.$el.find('#genome').val(genome);
},
@@ -226,6 +232,41 @@ return Backbone.View.extend({
return '<strong>' + (Math.round(size) / 10) + '</strong> ' + unit;
},
// attach file info popup
_showExtensionInfo : function()
{
// initialize
var self = this;
var $el = $(this.el).find('#extension_info');
var extension = this.model.get('extension');
var title = $(this.el).find('#extension').find('option:selected').text();
// create popup
$el.popover({
html: true,
title: title,
content: UploadExtensions(extension),
placement: 'bottom',
container: self.$el.parent()
});
// show popup
$el.popover('show');
// clear previous timers
clearTimeout(this.popover_timeout);
},
// attach file info popup
_hideExtensionInfo : function()
{
// remove popup
var self = this
this.popover_timeout = setTimeout(function() {
self.$el.find('#extension_info').popover('destroy');
}, this.options.timeout);
},
// template
_template: function(options)
{
@@ -251,6 +292,7 @@ return Backbone.View.extend({
for (key in self.app.select_extension)
tmpl += '<option value="' + self.app.select_extension[key][1] + '">' + self.app.select_extension[key][0] + '</option>';
tmpl += '</select>' +
'&nbsp;<i id="extension_info" class="fa fa-question" style="cursor: pointer;"/>' +
'</td>';
// add genome selector
@@ -0,0 +1 @@
define([],function(){var a={auto:{text:"The system will attempt to detect Axt, Fasta, Fastqsolexa, Gff, Gff3, Html, Lav, Maf, Tabular, Wiggle, Bed and Interval (Bed with headers) formats. 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"},ab1:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Ab1",text:"A binary sequence file in 'ab1' format with a '.ab1' file extension. You must manually select this 'File Format' when uploading the file."},axt:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Axt",text:"blastz pairwise alignment format. Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields."},bam:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#BAM",text:"A binary file compressed in the BGZF format with a '.bam' file extension."},bed:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Bed",text:"BED format provides a flexible way to define the data lines that are displayed in an annotation track. BED lines have three required columns and nine additional optional columns. The three required columns are chrom, chromStart and chromEnd."},fasta:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Fasta",text:'A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than (">") symbol in the first column. All lines should be shorter than 80 characters.'},fastq:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Fastq",text:"FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores. "},fastqsolexa:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#FastqSolexa",text:"FastqSolexa is the Illumina (Solexa) variant of the Fastq format, which stores sequences and quality scores in a single file."},gff:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF",text:"GFF lines have nine required fields that must be tab-separated."},gff3:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"The GFF3 format addresses the most common extensions to GFF, while preserving backward compatibility with previous formats."},interval:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"File must start with definition line in the following format (columns may be in any order)."},lav:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#GFF3",text:"Lav is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav.."},maf:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#MAF",text:'TBA and multiz multiple alignment format. The first line of a .maf file begins with ##maf. This word is followed by white-space-separated "variable=value" pairs. There should be no white space surrounding the "=".'},scf:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Scf",text:"A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file."},sff:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Sff",text:"A binary file in 'Standard Flowgram Format' with a '.sff' file extension."},tabular:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Tabular_.28tab_delimited.29",text:"Any data in tab delimited format (tabular)."},wig:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Wig",text:"The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track."},txt:{url:"https://wiki.galaxyproject.org/Learn/Datatypes#Plain_text",text:"Any text file."},};return function(c){var d=a[c];if(d){var b=d.text;if(d.url){b+='&nbsp;(<a href="'+d.url+'" target="_blank">read more</a>)'}return b}else{return"There is no description available for this file extension."}}});
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
(function(c){jQuery.event.props.push("dataTransfer");var h={url:"",paramname:"content",maxfilesize:2048,maxfilenumber:20,dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(k,l,m){alert(m)},complete:function(){},error_filesize:"File exceeds 2GB. Please use an FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in.",error_missing:"No upload content available."};var a={};var e={};var f=0;var j=0;var d=false;var g=false;var b=null;var i=null;c.fn.uploadbox=function(A){a=c.extend({},h,A);b=this;b.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');b.on("drop",o);b.on("dragover",p);b.on("dragleave",x);c("#uploadbox_input").change(function(B){z(B.target.files);c(this).val("")});function o(B){if(!B.dataTransfer){return}z(B.dataTransfer.files);B.preventDefault();return false}function p(B){B.preventDefault();a.dragover.call(B)}function x(B){B.stopPropagation();a.dragleave.call(B)}function k(B){if(B.lengthComputable){a.progress(this.index,this.file,Math.round((B.loaded*100)/B.total))}}function z(D){if(d){return}for(var C=0;C<D.length;C++){if(j>=a.maxfilenumber){break}var B=String(f++);e[B]=D[C];a.announce(B,e[B],"");j++}}function r(B){if(e[B]){delete e[B];j--}}function m(){if(j==0||g){g=false;d=false;a.complete();return}else{d=true}var D=-1;for(var F in e){D=F;break}var E=e[D];r(D);var C=E.size;var B=1048576*a.maxfilesize;if(C<B){var G=a.initialize(D,E);if(G){q(D,E,G)}else{u(D,E,a.error_missing)}}else{u(D,E,a.error_filesize)}}function q(B,D,E){var F=new FormData();for(var C in E){F.append(C,E[C])}if(D.size>0){F.append(a.paramname,D,D.name)}i=new XMLHttpRequest();i.open("POST",a.url,true);i.setRequestHeader("Accept","application/json");i.setRequestHeader("Cache-Control","no-cache");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.onreadystatechange=function(){if(i.readyState!=i.DONE){return}var G=null;if(i.responseText){try{G=jQuery.parseJSON(i.responseText)}catch(H){G=i.responseText}}if(i.status<200||i.status>299){var I=i.statusText;if(i.status==403){I=a.error_login}else{if(i.status==0){I=a.error_server}else{if(!I){I=a.error_default}}}u(B,D,I+" ("+i.status+")")}else{y(B,D,G)}};i.upload.index=B;i.upload.file=D;i.upload.addEventListener("progress",k,false);i.send(F)}function y(B,C,D){a.success(B,C,D);m()}function u(B,C,D){a.error(B,C,D);m()}function w(){c("#uploadbox_input").trigger("click")}function t(B){for(B in e){r(B)}}function l(){if(!d){d=true;m()}}function v(){g=true}function n(B){a=c.extend({},a,B);return a}function s(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}return{select:w,add:z,remove:r,start:l,stop:v,reset:t,configure:n,compatible:s}}})(jQuery);
(function(c){jQuery.event.props.push("dataTransfer");var h={url:"",paramname:"content",maxfilesize:2048,maxfilenumber:50,dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(k,l,m){alert(m)},complete:function(){},error_filesize:"File exceeds 2GB. Please use an FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in.",error_missing:"No upload content available."};var a={};var e={};var f=0;var j=0;var d=false;var g=false;var b=null;var i=null;c.fn.uploadbox=function(A){a=c.extend({},h,A);b=this;b.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');b.on("drop",o);b.on("dragover",p);b.on("dragleave",x);c("#uploadbox_input").change(function(B){z(B.target.files);c(this).val("")});function o(B){if(!B.dataTransfer){return}z(B.dataTransfer.files);B.preventDefault();return false}function p(B){B.preventDefault();a.dragover.call(B)}function x(B){B.stopPropagation();a.dragleave.call(B)}function k(B){if(B.lengthComputable){a.progress(this.index,this.file,Math.round((B.loaded*100)/B.total))}}function z(D){if(d){return}for(var C=0;C<D.length;C++){if(j>=a.maxfilenumber){break}var B=String(f++);e[B]=D[C];a.announce(B,e[B],"");j++}}function r(B){if(e[B]){delete e[B];j--}}function m(){if(j==0||g){g=false;d=false;a.complete();return}else{d=true}var D=-1;for(var F in e){D=F;break}var E=e[D];r(D);var C=E.size;var B=1048576*a.maxfilesize;if(C<B){var G=a.initialize(D,E);if(G){q(D,E,G)}else{u(D,E,a.error_missing)}}else{u(D,E,a.error_filesize)}}function q(B,D,E){var F=new FormData();for(var C in E){F.append(C,E[C])}if(D.size>0){F.append(a.paramname,D,D.name)}i=new XMLHttpRequest();i.open("POST",a.url,true);i.setRequestHeader("Accept","application/json");i.setRequestHeader("Cache-Control","no-cache");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.onreadystatechange=function(){if(i.readyState!=i.DONE){return}var G=null;if(i.responseText){try{G=jQuery.parseJSON(i.responseText)}catch(H){G=i.responseText}}if(i.status<200||i.status>299){var I=i.statusText;if(i.status==403){I=a.error_login}else{if(i.status==0){I=a.error_server}else{if(!I){I=a.error_default}}}u(B,D,I+" ("+i.status+")")}else{y(B,D,G)}};i.upload.index=B;i.upload.file=D;i.upload.addEventListener("progress",k,false);i.send(F)}function y(B,C,D){a.success(B,C,D);m()}function u(B,C,D){a.error(B,C,D);m()}function w(){c("#uploadbox_input").trigger("click")}function t(B){for(B in e){r(B)}}function l(){if(!d){d=true;m()}}function v(){g=true}function n(B){a=c.extend({},a,B);return a}function s(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}return{select:w,add:z,remove:r,start:l,stop:v,reset:t,configure:n,compatible:s}}})(jQuery);
+1 -1
View File
@@ -12,7 +12,7 @@
url : '',
paramname : 'content',
maxfilesize : 2048,
maxfilenumber : 20,
maxfilenumber : 50,
dragover : function() {},
dragleave : function() {},
announce : function() {},
+2 -1
View File
@@ -1257,7 +1257,8 @@ label{font-weight:normal}
.progress-button .progress-bar-notransition{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}
.progress-button .label{position:absolute;top:0px;width:inherit;text-align:center;line-height:19px}
.upload-info{font-weight:normal;text-align:center}
.upload-box{width:100%;height:95%;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:95%;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 .popover{max-width:600px;width:auto}
.upload-box .table{width:100%}
.upload-box .table th{text-align:center;white-space:nowrap}
.upload-box .table td{margin:0px;paddign:0px}
.upload-box .title{width:130px;word-wrap:break-word;font-size:11px}
+6 -1
View File
@@ -61,7 +61,12 @@
padding : 10px;
overflow-x : hidden;
-ms-overflow-style: none;
.popover {
max-width: 500px;
width: auto;
}
.table {
width : 100%;
}