galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
January 2015
- 2 participants
- 248 discussions
commit/galaxy-central: jmchilton: Merged in BjoernGruening/galaxy-central-1/snpeff_datatype (pull request #640)
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/482d85dda5d3/
Changeset: 482d85dda5d3
User: jmchilton
Date: 2015-01-23 17:12:43+00:00
Summary: Merged in BjoernGruening/galaxy-central-1/snpeff_datatype (pull request #640)
Add SnpEff datatypes
Affected #: 3 files
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba config/datatypes_conf.xml.sample
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -113,7 +113,7 @@
<converter file="interval_to_bed12_converter.xml" target_datatype="bed12"/><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/><converter file="interval_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/><!-- <display file="ucsc/interval_as_bed.xml" inherit="True" /> --><display file="ensembl/ensembl_interval_as_bed.xml" inherit="True"/><display file="gbrowse/gbrowse_interval_as_bed.xml" inherit="True"/>
@@ -152,11 +152,11 @@
<datatype extension="mafcustomtrack" type="galaxy.datatypes.sequence:MafCustomTrack"><display file="ucsc/maf_customtrack.xml" /></datatype>
- <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
- <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
- <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
+ <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
+ <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
+ <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="pdf" type="galaxy.datatypes.images:Pdf" mimetype="application/pdf"/><datatype extension="pileup" type="galaxy.datatypes.tabular:Pileup" display_in_upload="true"><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/>
@@ -172,11 +172,16 @@
<datatype extension="qual454" type="galaxy.datatypes.qualityscore:QualityScore454" display_in_upload="true"/><datatype extension="Roadmaps" type="galaxy.datatypes.assembly:Roadmaps" display_in_upload="false"/><datatype extension="sam" type="galaxy.datatypes.tabular:Sam" display_in_upload="true">
- <converter file="sam_to_bam.xml" target_datatype="bam"/>
- <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <converter file="sam_to_bam.xml" target_datatype="bam"/>
+ <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/>
+ <datatype extension="snpeffdb" type="galaxy.datatypes.text:SnpEffDb" display_in_upload="True"/>
+ <datatype extension="snpsiftdbnsfp" type="galaxy.datatypes.txt:SnpSiftDbNSFP" display_in_upload="True"/>
+ <datatype extension="dbnsfp.tabular" type="galaxy.datatypes.tabular:Tabular" subclass="True" display_in_upload="True">
+ <converter file="tabular_to_dbnsfp.xml" target_datatype="snpsiftdbnsfp"/>
+ </datatype><datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true" description="A binary file in 'Standard Flowgram Format' with a '.sff' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Sff"/><datatype extension="svg" type="galaxy.datatypes.images:Image" mimetype="image/svg+xml"/><datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/>
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
--- /dev/null
+++ b/lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
@@ -0,0 +1,12 @@
+<tool id="tabular_to_dbnsfp" name="Convert tabular to dbnsfp" version="1.0.0">
+ <description></description>
+ <command interpreter="python">tabular_to_dbnsfp.py $input $dbnsfp.extra_files_path/dbNSFP.gz</command>
+ <inputs>
+ <param format="tabular" name="input" type="data" label="Choose a dbnsfp tabular file"/>
+ </inputs>
+ <outputs>
+ <data format="snpsiftdbnsfp" name="dbnsfp"/>
+ </outputs>
+ <help>
+ </help>
+</tool>
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba lib/galaxy/datatypes/text.py
--- a/lib/galaxy/datatypes/text.py
+++ b/lib/galaxy/datatypes/text.py
@@ -2,7 +2,6 @@
""" Clearing house for generic text datatypes that are not XML or tabular.
"""
-
from galaxy.datatypes.data import Text
from galaxy.datatypes.data import get_file_peek
from galaxy.datatypes.data import nice_size
@@ -12,13 +11,13 @@
import tempfile
import subprocess
import json
+import gzip
import os
import re
import logging
log = logging.getLogger(__name__)
-
class Json( Text ):
file_ext = "json"
@@ -259,3 +258,121 @@
dataset.metadata.comment_lines = comment_lines
dataset.metadata.columns = column_count
+
+class SnpEffDb( Text ):
+ """Class describing a SnpEff genome build"""
+ file_ext = "snpeffdb"
+ MetadataElement( name="genome_version", default=None, desc="Genome Version", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="regulation", default=[], desc="Regulation Names", readonly=True, visible=True, no_value=[], optional=True)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[], optional=True)
+
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+
+ def set_meta( self, dataset, **kwd ):
+ Text.set_meta(self, dataset, **kwd )
+ data_dir = dataset.extra_files_path
+ ## search data_dir/genome_version for files
+ regulation_pattern = 'regulation_(.+).bin'
+ # annotation files that are included in snpEff by a flag
+ annotations_dict = {'nextProt.bin' : '-nextprot','motif.bin': '-motif'}
+ regulations = []
+ annotations = []
+ if data_dir and os.path.isdir(data_dir):
+ for root, dirs, files in os.walk(data_dir):
+ for fname in files:
+ if fname.startswith('snpEffectPredictor'):
+ # if snpEffectPredictor.bin download succeeded
+ genome_version = os.path.basename(root)
+ dataset.metadata.genome_version = genome_version
+ else:
+ m = re.match(regulation_pattern,fname)
+ if m:
+ name = m.groups()[0]
+ regulations.append(name)
+ elif fname in annotations_dict:
+ value = annotations_dict[fname]
+ name = value.lstrip('-')
+ annotations.append(name)
+ dataset.metadata.regulation = regulations
+ dataset.metadata.annotation = annotations
+ try:
+ fh = file(dataset.file_name,'w')
+ fh.write("%s\n" % genome_version)
+ if annotations:
+ fh.write("annotations: %s\n" % ','.join(annotations))
+ if regulations:
+ fh.write("regulations: %s\n" % ','.join(regulations))
+ fh.close()
+ except:
+ pass
+
+
+class SnpSiftDbNSFP( Text ):
+ """Class describing a dbNSFP database prepared fpr use by SnpSift dbnsfp """
+ MetadataElement( name='reference_name', default='dbSNFP' , desc='Reference Name', readonly=True, visible=True, set_in_upload=True, no_value='dbSNFP' )
+ MetadataElement( name="bgzip", default=None, desc="dbNSFP bgzip", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="index", default=None, desc="Tabix Index File", readonly=True, visible=True, no_value=None)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[] )
+ file_ext = "snpsiftdbnsfp"
+ composite_type = 'auto_primary_file'
+ allow_datatype_change = False
+ """
+ ## The dbNSFP file is a tabular file with 1 header line
+ ## The first 4 columns are required to be: chrom pos ref alt
+ ## These match columns 1,2,4,5 of the VCF file
+ ## SnpSift requires the file to be block-gzipped and the indexed with samtools tabix
+ ## Example:
+ ## Compress using block-gzip algorithm
+ bgzip dbNSFP2.3.txt
+ ## Create tabix index
+ tabix -s 1 -b 2 -e 2 dbNSFP2.3.txt.gz
+ """
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+ self.add_composite_file( '%s.grp', description = 'Group File', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ self.add_composite_file( '%s.ti', description = '', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ def init_meta( self, dataset, copy_from=None ):
+ Text.init_meta( self, dataset, copy_from=copy_from )
+ def generate_primary_file( self, dataset = None ):
+ """
+ This is called only at upload to write the html file
+ cannot rename the datasets here - they come with the default unfortunately
+ """
+ regenerate_primary_file( self, dataset)
+ def regenerate_primary_file(self,dataset):
+ """
+ cannot do this until we are setting metadata
+ """
+ annotations = "dbNSFP Annotations: %s\n" % ','.join(dataset.metadata.annotation)
+ f = open(dataset.file_name,'a')
+ if dataset.metadata.bgzip:
+ bn = dataset.metadata.bgzip
+ f.write(bn)
+ f.write('\n')
+ f.write(annotations)
+ f.close()
+ def set_meta( self, dataset, overwrite=True, **kwd ):
+ try:
+ efp = dataset.extra_files_path
+ if os.path.exists(efp):
+ flist = os.listdir(efp)
+ for i,fname in enumerate(flist):
+ if fname.endswith('.gz'):
+ dataset.metadata.bgzip = fname
+ try:
+ fh = gzip.open(os.path.join(efp,fname),'r')
+ buf = fh.read(5000)
+ lines = buf.splitlines()
+ headers = lines[0].split('\t')
+ dataset.metadata.annotation = headers[4:]
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (fname,str(e)))
+ finally:
+ fh.close()
+ if fname.endswith('.tbi'):
+ dataset.metadata.index = fname
+ self.regenerate_primary_file(dataset)
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (dataset.file_name if dataset and dataset.file_name else 'Unkwown',str(e)))
+
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.
1
0
7 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5046a675329b/
Changeset: 5046a675329b
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-16 20:38:18+00:00
Summary: add SnpEffDb datatype
Affected #: 1 file
diff -r b5c7266dbb69f81864d96247ff11be42246e94de -r 5046a675329b6ff33b79a412f4a195b5932dec96 lib/galaxy/datatypes/text.py
--- a/lib/galaxy/datatypes/text.py
+++ b/lib/galaxy/datatypes/text.py
@@ -18,7 +18,6 @@
import logging
log = logging.getLogger(__name__)
-
class Json( Text ):
file_ext = "json"
@@ -259,3 +258,52 @@
dataset.metadata.comment_lines = comment_lines
dataset.metadata.columns = column_count
+
+class SnpEffDb( Text ):
+ """Class describing a SnpEff genome build"""
+ file_ext = "snpeffdb"
+ MetadataElement( name="genome_version", default=None, desc="Genome Version", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="regulation", default=[], desc="Regulation Names", readonly=True, visible=True, no_value=[], optional=True)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[], optional=True)
+
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+
+ def set_meta( self, dataset, **kwd ):
+ Text.set_meta(self, dataset, **kwd )
+ data_dir = dataset.extra_files_path
+ ## search data_dir/genome_version for files
+ regulation_pattern = 'regulation_(.+).bin'
+ # annotation files that are included in snpEff by a flag
+ annotations_dict = {'nextProt.bin' : '-nextprot','motif.bin': '-motif'}
+ regulations = []
+ annotations = []
+ if data_dir and os.path.isdir(data_dir):
+ for root, dirs, files in os.walk(data_dir):
+ for fname in files:
+ if fname.startswith('snpEffectPredictor'):
+ # if snpEffectPredictor.bin download succeeded
+ genome_version = os.path.basename(root)
+ dataset.metadata.genome_version = genome_version
+ else:
+ m = re.match(regulation_pattern,fname)
+ if m:
+ name = m.groups()[0]
+ regulations.append(name)
+ elif fname in annotations_dict:
+ value = annotations_dict[fname]
+ name = value.lstrip('-')
+ annotations.append(name)
+ dataset.metadata.regulation = regulations
+ dataset.metadata.annotation = annotations
+ try:
+ fh = file(dataset.file_name,'w')
+ fh.write("%s\n" % genome_version)
+ if annotations:
+ fh.write("annotations: %s\n" % ','.join(annotations))
+ if regulations:
+ fh.write("regulations: %s\n" % ','.join(regulations))
+ fh.close()
+ except:
+ pass
+
https://bitbucket.org/galaxy/galaxy-central/commits/2ce557458f86/
Changeset: 2ce557458f86
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-16 20:42:08+00:00
Summary: activate snpeffdb and snpeffdbv4
Affected #: 1 file
diff -r 5046a675329b6ff33b79a412f4a195b5932dec96 -r 2ce557458f868a44d068b148651cf4c9af6f573f config/datatypes_conf.xml.sample
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -176,6 +176,8 @@
</datatype><datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/>
+ <datatype extension="snpeffdb" type="galaxy.datatypes.snpeff:SnpEffDb" display_in_upload="True"/>
+ <datatype extension="snpeffdbv4" type="galaxy.datatypes.snpeff:SnpEffDb" subclass="True" display_in_upload="True"/><datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true" description="A binary file in 'Standard Flowgram Format' with a '.sff' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Sff"/><datatype extension="svg" type="galaxy.datatypes.images:Image" mimetype="image/svg+xml"/><datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/>
https://bitbucket.org/galaxy/galaxy-central/commits/e161cc633e06/
Changeset: e161cc633e06
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-16 21:07:41+00:00
Summary: add SnpSiftDbNSFP datatype
Affected #: 1 file
diff -r 2ce557458f868a44d068b148651cf4c9af6f573f -r e161cc633e066626e93ad5892170e22e9d198579 lib/galaxy/datatypes/text.py
--- a/lib/galaxy/datatypes/text.py
+++ b/lib/galaxy/datatypes/text.py
@@ -2,7 +2,6 @@
""" Clearing house for generic text datatypes that are not XML or tabular.
"""
-
from galaxy.datatypes.data import Text
from galaxy.datatypes.data import get_file_peek
from galaxy.datatypes.data import nice_size
@@ -12,6 +11,7 @@
import tempfile
import subprocess
import json
+import gzip
import os
import re
@@ -307,3 +307,72 @@
except:
pass
+
+class SnpSiftDbNSFP( Text ):
+ """Class describing a dbNSFP database prepared fpr use by SnpSift dbnsfp """
+ MetadataElement( name='reference_name', default='dbSNFP' , desc='Reference Name', readonly=True, visible=True, set_in_upload=True, no_value='dbSNFP' )
+ MetadataElement( name="bgzip", default=None, desc="dbNSFP bgzip", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="index", default=None, desc="Tabix Index File", readonly=True, visible=True, no_value=None)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[] )
+ file_ext = "snpsiftdbnsfp"
+ composite_type = 'auto_primary_file'
+ allow_datatype_change = False
+ """
+ ## The dbNSFP file is a tabular file with 1 header line
+ ## The first 4 columns are required to be: chrom pos ref alt
+ ## These match columns 1,2,4,5 of the VCF file
+ ## SnpSift requires the file to be block-gzipped and the indexed with samtools tabix
+ ## Example:
+ ## Compress using block-gzip algorithm
+ bgzip dbNSFP2.3.txt
+ ## Create tabix index
+ tabix -s 1 -b 2 -e 2 dbNSFP2.3.txt.gz
+ """
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+ self.add_composite_file( '%s.grp', description = 'Group File', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ self.add_composite_file( '%s.ti', description = '', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ def init_meta( self, dataset, copy_from=None ):
+ Text.init_meta( self, dataset, copy_from=copy_from )
+ def generate_primary_file( self, dataset = None ):
+ """
+ This is called only at upload to write the html file
+ cannot rename the datasets here - they come with the default unfortunately
+ """
+ regenerate_primary_file( self, dataset)
+ def regenerate_primary_file(self,dataset):
+ """
+ cannot do this until we are setting metadata
+ """
+ annotations = "dbNSFP Annotations: %s\n" % ','.join(dataset.metadata.annotation)
+ f = open(dataset.file_name,'a')
+ if dataset.metadata.bgzip:
+ bn = dataset.metadata.bgzip
+ f.write(bn)
+ f.write('\n')
+ f.write(annotations)
+ f.close()
+ def set_meta( self, dataset, overwrite=True, **kwd ):
+ try:
+ efp = dataset.extra_files_path
+ if os.path.exists(efp):
+ flist = os.listdir(efp)
+ for i,fname in enumerate(flist):
+ if fname.endswith('.gz'):
+ dataset.metadata.bgzip = fname
+ try:
+ fh = gzip.open(os.path.join(efp,fname),'r')
+ buf = fh.read(5000)
+ lines = buf.splitlines()
+ headers = lines[0].split('\t')
+ dataset.metadata.annotation = headers[4:]
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (fname,str(e)))
+ finally:
+ fh.close()
+ if fname.endswith('.tbi'):
+ dataset.metadata.index = fname
+ self.regenerate_primary_file(dataset)
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (dataset.file_name if dataset and dataset.file_name else 'Unkwown',str(e)))
+
https://bitbucket.org/galaxy/galaxy-central/commits/11491dfccddb/
Changeset: 11491dfccddb
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-16 21:08:29+00:00
Summary: activate SnpSiftDbNSFP and dbnsfp.tabular
Affected #: 1 file
diff -r e161cc633e066626e93ad5892170e22e9d198579 -r 11491dfccddbf671a96ea73d78d42666521e4a53 config/datatypes_conf.xml.sample
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -113,7 +113,7 @@
<converter file="interval_to_bed12_converter.xml" target_datatype="bed12"/><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/><converter file="interval_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/><!-- <display file="ucsc/interval_as_bed.xml" inherit="True" /> --><display file="ensembl/ensembl_interval_as_bed.xml" inherit="True"/><display file="gbrowse/gbrowse_interval_as_bed.xml" inherit="True"/>
@@ -151,11 +151,11 @@
<datatype extension="mafcustomtrack" type="galaxy.datatypes.sequence:MafCustomTrack"><display file="ucsc/maf_customtrack.xml" /></datatype>
- <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
- <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
- <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
+ <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
+ <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
+ <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="pdf" type="galaxy.datatypes.images:Pdf" mimetype="application/pdf"/><datatype extension="pileup" type="galaxy.datatypes.tabular:Pileup" display_in_upload="true"><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/>
@@ -171,13 +171,17 @@
<datatype extension="qual454" type="galaxy.datatypes.qualityscore:QualityScore454" display_in_upload="true"/><datatype extension="Roadmaps" type="galaxy.datatypes.assembly:Roadmaps" display_in_upload="false"/><datatype extension="sam" type="galaxy.datatypes.tabular:Sam" display_in_upload="true">
- <converter file="sam_to_bam.xml" target_datatype="bam"/>
- <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <converter file="sam_to_bam.xml" target_datatype="bam"/>
+ <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/>
- <datatype extension="snpeffdb" type="galaxy.datatypes.snpeff:SnpEffDb" display_in_upload="True"/>
- <datatype extension="snpeffdbv4" type="galaxy.datatypes.snpeff:SnpEffDb" subclass="True" display_in_upload="True"/>
+ <datatype extension="snpeffdb" type="galaxy.datatypes.text:SnpEffDb" display_in_upload="True"/>
+ <datatype extension="snpeffdbv4" type="galaxy.datatypes.text:SnpEffDb" subclass="True" display_in_upload="True"/>
+ <datatype extension="snpsiftdbnsfp" type="galaxy.datatypes.txt:SnpSiftDbNSFP" display_in_upload="True"/>
+ <datatype extension="dbnsfp.tabular" type="galaxy.datatypes.tabular:Tabular" subclass="True" display_in_upload="True">
+ <converter file="tabular_to_dbnsfp.xml" target_datatype="snpsiftdbnsfp"/>
+ </datatype><datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true" description="A binary file in 'Standard Flowgram Format' with a '.sff' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Sff"/><datatype extension="svg" type="galaxy.datatypes.images:Image" mimetype="image/svg+xml"/><datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/>
https://bitbucket.org/galaxy/galaxy-central/commits/f4c5ac446f19/
Changeset: f4c5ac446f19
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-16 21:59:04+00:00
Summary: add converters
Affected #: 1 file
diff -r 11491dfccddbf671a96ea73d78d42666521e4a53 -r f4c5ac446f191b504ef2d9f31c9e3d33aa29c52e lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
--- /dev/null
+++ b/lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
@@ -0,0 +1,12 @@
+<tool id="tabular_to_dbnsfp" name="Convert tabular to dbnsfp" version="1.0.0">
+ <description></description>
+ <command interpreter="python">tabular_to_dbnsfp.py $input $dbnsfp.extra_files_path/dbNSFP.gz</command>
+ <inputs>
+ <param format="tabular" name="input" type="data" label="Choose a dbnsfp tabular file"/>
+ </inputs>
+ <outputs>
+ <data format="snpsiftdbnsfp" name="dbnsfp"/>
+ </outputs>
+ <help>
+ </help>
+</tool>
https://bitbucket.org/galaxy/galaxy-central/commits/c862a73eb896/
Changeset: c862a73eb896
Branch: snpeff_datatype
User: BjoernGruening
Date: 2015-01-17 13:05:44+00:00
Summary: Remove not needed datatype, we now can filter datatypes by metadata.
Affected #: 1 file
diff -r f4c5ac446f191b504ef2d9f31c9e3d33aa29c52e -r c862a73eb8967624ccfb9c2847a030176a7c4981 config/datatypes_conf.xml.sample
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -177,7 +177,6 @@
<datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/><datatype extension="snpeffdb" type="galaxy.datatypes.text:SnpEffDb" display_in_upload="True"/>
- <datatype extension="snpeffdbv4" type="galaxy.datatypes.text:SnpEffDb" subclass="True" display_in_upload="True"/><datatype extension="snpsiftdbnsfp" type="galaxy.datatypes.txt:SnpSiftDbNSFP" display_in_upload="True"/><datatype extension="dbnsfp.tabular" type="galaxy.datatypes.tabular:Tabular" subclass="True" display_in_upload="True"><converter file="tabular_to_dbnsfp.xml" target_datatype="snpsiftdbnsfp"/>
https://bitbucket.org/galaxy/galaxy-central/commits/482d85dda5d3/
Changeset: 482d85dda5d3
User: jmchilton
Date: 2015-01-23 17:12:43+00:00
Summary: Merged in BjoernGruening/galaxy-central-1/snpeff_datatype (pull request #640)
Add SnpEff datatypes
Affected #: 3 files
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba config/datatypes_conf.xml.sample
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -113,7 +113,7 @@
<converter file="interval_to_bed12_converter.xml" target_datatype="bed12"/><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/><converter file="interval_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ <converter file="interval_to_bigwig_converter.xml" target_datatype="bigwig"/><!-- <display file="ucsc/interval_as_bed.xml" inherit="True" /> --><display file="ensembl/ensembl_interval_as_bed.xml" inherit="True"/><display file="gbrowse/gbrowse_interval_as_bed.xml" inherit="True"/>
@@ -152,11 +152,11 @@
<datatype extension="mafcustomtrack" type="galaxy.datatypes.sequence:MafCustomTrack"><display file="ucsc/maf_customtrack.xml" /></datatype>
- <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
- <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
- <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
- <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <datatype extension="encodepeak" type="galaxy.datatypes.interval:ENCODEPeak" display_in_upload="True">
+ <converter file="encodepeak_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/>
+ <converter file="encodepeak_to_bgzip_converter.xml" target_datatype="bgzip"/>
+ <converter file="bed_gff_or_vcf_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="pdf" type="galaxy.datatypes.images:Pdf" mimetype="application/pdf"/><datatype extension="pileup" type="galaxy.datatypes.tabular:Pileup" display_in_upload="true"><converter file="interval_to_bgzip_converter.xml" target_datatype="bgzip"/>
@@ -172,11 +172,16 @@
<datatype extension="qual454" type="galaxy.datatypes.qualityscore:QualityScore454" display_in_upload="true"/><datatype extension="Roadmaps" type="galaxy.datatypes.assembly:Roadmaps" display_in_upload="false"/><datatype extension="sam" type="galaxy.datatypes.tabular:Sam" display_in_upload="true">
- <converter file="sam_to_bam.xml" target_datatype="bam"/>
- <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
- </datatype>
+ <converter file="sam_to_bam.xml" target_datatype="bam"/>
+ <converter file="sam_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ </datatype><datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true" description="A binary sequence file in 'scf' format with a '.scf' file extension. You must manually select this 'File Format' when uploading the file." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Scf"/><datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/>
+ <datatype extension="snpeffdb" type="galaxy.datatypes.text:SnpEffDb" display_in_upload="True"/>
+ <datatype extension="snpsiftdbnsfp" type="galaxy.datatypes.txt:SnpSiftDbNSFP" display_in_upload="True"/>
+ <datatype extension="dbnsfp.tabular" type="galaxy.datatypes.tabular:Tabular" subclass="True" display_in_upload="True">
+ <converter file="tabular_to_dbnsfp.xml" target_datatype="snpsiftdbnsfp"/>
+ </datatype><datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true" description="A binary file in 'Standard Flowgram Format' with a '.sff' file extension." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Sff"/><datatype extension="svg" type="galaxy.datatypes.images:Image" mimetype="image/svg+xml"/><datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/>
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
--- /dev/null
+++ b/lib/galaxy/datatypes/converters/tabular_to_dbnsfp.xml
@@ -0,0 +1,12 @@
+<tool id="tabular_to_dbnsfp" name="Convert tabular to dbnsfp" version="1.0.0">
+ <description></description>
+ <command interpreter="python">tabular_to_dbnsfp.py $input $dbnsfp.extra_files_path/dbNSFP.gz</command>
+ <inputs>
+ <param format="tabular" name="input" type="data" label="Choose a dbnsfp tabular file"/>
+ </inputs>
+ <outputs>
+ <data format="snpsiftdbnsfp" name="dbnsfp"/>
+ </outputs>
+ <help>
+ </help>
+</tool>
diff -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 -r 482d85dda5d3546e1d6e9cca6d712d7af8c772ba lib/galaxy/datatypes/text.py
--- a/lib/galaxy/datatypes/text.py
+++ b/lib/galaxy/datatypes/text.py
@@ -2,7 +2,6 @@
""" Clearing house for generic text datatypes that are not XML or tabular.
"""
-
from galaxy.datatypes.data import Text
from galaxy.datatypes.data import get_file_peek
from galaxy.datatypes.data import nice_size
@@ -12,13 +11,13 @@
import tempfile
import subprocess
import json
+import gzip
import os
import re
import logging
log = logging.getLogger(__name__)
-
class Json( Text ):
file_ext = "json"
@@ -259,3 +258,121 @@
dataset.metadata.comment_lines = comment_lines
dataset.metadata.columns = column_count
+
+class SnpEffDb( Text ):
+ """Class describing a SnpEff genome build"""
+ file_ext = "snpeffdb"
+ MetadataElement( name="genome_version", default=None, desc="Genome Version", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="regulation", default=[], desc="Regulation Names", readonly=True, visible=True, no_value=[], optional=True)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[], optional=True)
+
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+
+ def set_meta( self, dataset, **kwd ):
+ Text.set_meta(self, dataset, **kwd )
+ data_dir = dataset.extra_files_path
+ ## search data_dir/genome_version for files
+ regulation_pattern = 'regulation_(.+).bin'
+ # annotation files that are included in snpEff by a flag
+ annotations_dict = {'nextProt.bin' : '-nextprot','motif.bin': '-motif'}
+ regulations = []
+ annotations = []
+ if data_dir and os.path.isdir(data_dir):
+ for root, dirs, files in os.walk(data_dir):
+ for fname in files:
+ if fname.startswith('snpEffectPredictor'):
+ # if snpEffectPredictor.bin download succeeded
+ genome_version = os.path.basename(root)
+ dataset.metadata.genome_version = genome_version
+ else:
+ m = re.match(regulation_pattern,fname)
+ if m:
+ name = m.groups()[0]
+ regulations.append(name)
+ elif fname in annotations_dict:
+ value = annotations_dict[fname]
+ name = value.lstrip('-')
+ annotations.append(name)
+ dataset.metadata.regulation = regulations
+ dataset.metadata.annotation = annotations
+ try:
+ fh = file(dataset.file_name,'w')
+ fh.write("%s\n" % genome_version)
+ if annotations:
+ fh.write("annotations: %s\n" % ','.join(annotations))
+ if regulations:
+ fh.write("regulations: %s\n" % ','.join(regulations))
+ fh.close()
+ except:
+ pass
+
+
+class SnpSiftDbNSFP( Text ):
+ """Class describing a dbNSFP database prepared fpr use by SnpSift dbnsfp """
+ MetadataElement( name='reference_name', default='dbSNFP' , desc='Reference Name', readonly=True, visible=True, set_in_upload=True, no_value='dbSNFP' )
+ MetadataElement( name="bgzip", default=None, desc="dbNSFP bgzip", readonly=True, visible=True, no_value=None )
+ MetadataElement( name="index", default=None, desc="Tabix Index File", readonly=True, visible=True, no_value=None)
+ MetadataElement( name="annotation", default=[], desc="Annotation Names", readonly=True, visible=True, no_value=[] )
+ file_ext = "snpsiftdbnsfp"
+ composite_type = 'auto_primary_file'
+ allow_datatype_change = False
+ """
+ ## The dbNSFP file is a tabular file with 1 header line
+ ## The first 4 columns are required to be: chrom pos ref alt
+ ## These match columns 1,2,4,5 of the VCF file
+ ## SnpSift requires the file to be block-gzipped and the indexed with samtools tabix
+ ## Example:
+ ## Compress using block-gzip algorithm
+ bgzip dbNSFP2.3.txt
+ ## Create tabix index
+ tabix -s 1 -b 2 -e 2 dbNSFP2.3.txt.gz
+ """
+ def __init__( self, **kwd ):
+ Text.__init__( self, **kwd )
+ self.add_composite_file( '%s.grp', description = 'Group File', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ self.add_composite_file( '%s.ti', description = '', substitute_name_with_metadata = 'reference_name', is_binary = False )
+ def init_meta( self, dataset, copy_from=None ):
+ Text.init_meta( self, dataset, copy_from=copy_from )
+ def generate_primary_file( self, dataset = None ):
+ """
+ This is called only at upload to write the html file
+ cannot rename the datasets here - they come with the default unfortunately
+ """
+ regenerate_primary_file( self, dataset)
+ def regenerate_primary_file(self,dataset):
+ """
+ cannot do this until we are setting metadata
+ """
+ annotations = "dbNSFP Annotations: %s\n" % ','.join(dataset.metadata.annotation)
+ f = open(dataset.file_name,'a')
+ if dataset.metadata.bgzip:
+ bn = dataset.metadata.bgzip
+ f.write(bn)
+ f.write('\n')
+ f.write(annotations)
+ f.close()
+ def set_meta( self, dataset, overwrite=True, **kwd ):
+ try:
+ efp = dataset.extra_files_path
+ if os.path.exists(efp):
+ flist = os.listdir(efp)
+ for i,fname in enumerate(flist):
+ if fname.endswith('.gz'):
+ dataset.metadata.bgzip = fname
+ try:
+ fh = gzip.open(os.path.join(efp,fname),'r')
+ buf = fh.read(5000)
+ lines = buf.splitlines()
+ headers = lines[0].split('\t')
+ dataset.metadata.annotation = headers[4:]
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (fname,str(e)))
+ finally:
+ fh.close()
+ if fname.endswith('.tbi'):
+ dataset.metadata.index = fname
+ self.regenerate_primary_file(dataset)
+ except Exception,e:
+ log.warn("set_meta fname: %s %s" % (dataset.file_name if dataset and dataset.file_name else 'Unkwown',str(e)))
+
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.
1
0
commit/galaxy-central: jmchilton: Merged in BjoernGruening/galaxy-central-1/toolshed_blacklist_additions (pull request #627)
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2fd8714c4fae/
Changeset: 2fd8714c4fae
User: jmchilton
Date: 2015-01-23 17:11:03+00:00
Summary: Merged in BjoernGruening/galaxy-central-1/toolshed_blacklist_additions (pull request #627)
Add planemo test file to tool shed upoad blacklist.
Affected #: 1 file
diff -r 820114af3bf0689131885c8c99165532902bd2af -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -18,7 +18,7 @@
log = logging.getLogger( __name__ )
UNDESIRABLE_DIRS = [ '.hg', '.svn', '.git', '.cvs' ]
-UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store' ]
+UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store', 'tool_test_output.html', 'tool_test_output.json' ]
def check_archive( repository, archive ):
for member in archive.getmembers():
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/97a77506847e/
Changeset: 97a77506847e
Branch: toolshed_blacklist_additions
User: BjoernGruening
Date: 2015-01-09 18:59:30+00:00
Summary: Created new branch toolshed_blacklist_additions
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/bd2fa769a2ac/
Changeset: bd2fa769a2ac
Branch: toolshed_blacklist_additions
User: BjoernGruening
Date: 2015-01-09 19:02:42+00:00
Summary: Add planemo test files to the tool shed upload blacklist.
Affected #: 1 file
diff -r 97a77506847e010f4ab460f9890a214dce679cdf -r bd2fa769a2acf77b6a66e921bab6498ccfd199dc lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -18,7 +18,7 @@
log = logging.getLogger( __name__ )
UNDESIRABLE_DIRS = [ '.hg', '.svn', '.git', '.cvs' ]
-UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store' ]
+UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store', 'tool_test_output.html', 'tool_test_output.json' ]
def check_archive( repository, archive ):
for member in archive.getmembers():
https://bitbucket.org/galaxy/galaxy-central/commits/2fd8714c4fae/
Changeset: 2fd8714c4fae
User: jmchilton
Date: 2015-01-23 17:11:03+00:00
Summary: Merged in BjoernGruening/galaxy-central-1/toolshed_blacklist_additions (pull request #627)
Add planemo test file to tool shed upoad blacklist.
Affected #: 1 file
diff -r 820114af3bf0689131885c8c99165532902bd2af -r 2fd8714c4faeb580f3ccf1591003f10e821397a1 lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -18,7 +18,7 @@
log = logging.getLogger( __name__ )
UNDESIRABLE_DIRS = [ '.hg', '.svn', '.git', '.cvs' ]
-UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store' ]
+UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store', 'tool_test_output.html', 'tool_test_output.json' ]
def check_archive( repository, archive ):
for member in archive.getmembers():
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.
1
0
commit/galaxy-central: guerler: ToolForm: Fix optional dataset parameters, fix inconsistencies in parameter handling
by commits-noreply@bitbucket.org 23 Jan '15
by commits-noreply@bitbucket.org 23 Jan '15
23 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/820114af3bf0/
Changeset: 820114af3bf0
User: guerler
Date: 2015-01-23 17:04:50+00:00
Summary: ToolForm: Fix optional dataset parameters, fix inconsistencies in parameter handling
Affected #: 30 files
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-form-base.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-base.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-base.js
@@ -18,9 +18,7 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false,
- // ensures that all data including disabled optional fields are submitted to the server
- send_all : false
+ initial_errors : false
};
// configure options
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-form-workflow.js
--- a/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form-workflow.js
@@ -16,13 +16,16 @@
}
// initialize parameters
- this.workflow = true;
this.options = options;
-
+
+ // set labels
+ this.options.text_enable = 'In Advance';
+ this.options.text_disable = 'At Runtime';
+
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
if (item.type) {
- item.optional = (['data', 'data_hidden', 'hidden', 'drill_down']).indexOf(item.type) == -1;
+ item.optional = (['data', 'data_hidden', 'hidden', 'drill_down', 'repeat', 'conditional']).indexOf(item.type) == -1;
}
});
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-input.js
--- a/client/galaxy/scripts/mvc/tools/tools-input.js
+++ b/client/galaxy/scripts/mvc/tools/tools-input.js
@@ -10,9 +10,13 @@
// link app
this.app = app;
+ // set text labels
+ this.text_enable = app.options.text_enable || 'Enable';
+ this.text_disable = app.options.text_disable || 'Disable';
+
// link field
this.field = options.field;
- this.defaultvalue = options.defaultvalue;
+ this.default_value = options.default_value;
// set element
this.setElement(this._template(options));
@@ -30,10 +34,11 @@
this.field.skip = false;
var v = this.field.value && this.field.value();
this.field.skip = Boolean(options.optional &&
+ ((this.default_value === undefined) ||
((this.field.validate && !this.field.validate()) || !v ||
- (v == this.defaultvalue) || (Number(v) == Number(this.defaultvalue)) ||
- (JSON.stringify(v) == JSON.stringify(this.defaultvalue))));
-
+ (v == this.default_value) || (Number(v) == Number(this.default_value)) ||
+ (JSON.stringify(v) == JSON.stringify(this.default_value)))));
+
// refresh view
this._refresh();
@@ -53,7 +58,7 @@
error: function(text) {
if (!this.field.skip) {
this.$error_text.html(text);
- this.$error.fadeIn('fast');
+ this.$error.show();
this.$el.addClass('ui-error');
}
},
@@ -70,12 +75,12 @@
_refresh: function() {
if (!this.field.skip) {
this.$field.fadeIn('fast');
- this.$title_optional.html('Disable');
+ this.$title_optional.html(this.text_disable);
} else {
this.reset();
this.$field.hide();
- this.$title_optional.html('Enable');
- this.field.value && this.field.value(this.defaultvalue);
+ this.$title_optional.html(this.text_enable);
+ this.field.value && this.field.value(this.default_value);
}
this.app.trigger('refresh');
},
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -319,7 +319,7 @@
// create input field wrapper
var input_element = new InputElement(this.app, {
label : input_def.label,
- defaultvalue : input_def.defaultvalue,
+ default_value : input_def.default_value,
optional : input_def.optional,
help : input_def.help,
field : field
@@ -457,6 +457,7 @@
return new SelectContent.View(this.app, {
id : 'field-' + input_def.id,
extensions : input_def.extensions,
+ optional : input_def.optional,
multiple : input_def.multiple,
type : input_def.type,
data : input_def.options,
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-select-content.js
--- a/client/galaxy/scripts/mvc/tools/tools-select-content.js
+++ b/client/galaxy/scripts/mvc/tools/tools-select-content.js
@@ -50,6 +50,7 @@
if (this.mode == 'single') {
radio_buttons.push({icon: 'fa-file-o', label : 'Single dataset', value : 'single'});
this.select_single = new Ui.Select.View({
+ optional : options.optional,
error_text : hda_error,
onchange : function() {
self.trigger('change');
@@ -82,6 +83,7 @@
radio_buttons.push({icon: 'fa-folder-o', label : 'Dataset collection', value : 'collection' });
this.select_collection = new Ui.Select.View({
error_text : hdca_error,
+ optional : options.optional,
onchange : function() {
self.trigger('change');
}
@@ -180,39 +182,38 @@
},
/** Return the currently selected dataset values */
- value : function (dict) {
+ value : function (new_value) {
// update current value
- if (dict && dict.values) {
- try {
- // create list
- var list = [];
- for (var i in dict.values) {
- list.push(dict.values[i].id);
+ if (new_value !== undefined) {
+ if (new_value && new_value.values) {
+ try {
+ // create list with values
+ var list = [];
+ for (var i in new_value.values) {
+ list.push(new_value.values[i].id);
+ }
+
+ // identify suitable select field
+ if (new_value && new_value.values.length > 0 && new_value.values[0].src == 'hcda') {
+ this.current = 'collection';
+ this.select_collection.value(list[0]);
+ } else {
+ if (this.mode == 'multiple') {
+ this.current = 'multiple';
+ this.select_multiple.value(list);
+ } else {
+ this.current = 'single';
+ this.select_single.value(list[0]);
+ }
+ }
+ } catch (err) {
+ console.debug('tools-select-content::value() - Skipped.');
}
-
- // identify suitable select field
- if (dict && dict.values.length > 0 && dict.values[0].src == 'hcda') {
- this.current = 'collection';
- this.select_collection.value(list[0]);
- } else {
- if (this.mode == 'multiple') {
- this.current = 'multiple';
- this.select_multiple.value(list);
- } else {
- this.current = 'single';
- this.select_single.value(list[0]);
- }
- }
- this.refresh();
-
- // check if value has been set
- var select = this._select();
- if (!select.validate()) {
- select.value(select.first());
- }
- } catch (err) {
- console.debug('tools-select-content::value() - Skipped.');
+ } else {
+ this.current = 'single';
+ this.select_single.value('__null__');
}
+ this.refresh();
}
// transform into an array
@@ -247,6 +248,7 @@
/** Refreshes data selection view */
refresh: function() {
+ this.button_type.value(this.current);
for (var i in this.list) {
var $el = this.list[i].field.$el;
if (this.current == i) {
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -121,21 +121,21 @@
if (patch[input.type]) {
value = patch[input.type](value);
}
-
- // handle simple value
- if (!field.skip || self.app.options.send_all) {
- if (field.validate && !field.validate()) {
- value = null;
- }
- if (input.ignore === undefined || (value !== null && input.ignore != value)) {
- // add value to submission
- add (job_input_id, input.id, value);
- // add payload to submission
- if (input.payload) {
- for (var p_id in input.payload) {
- add (p_id, input.id, input.payload[p_id]);
- }
+ // validate value
+ if ((field.skip && input.optional) || (field.validate && !field.validate())) {
+ value = null;
+ }
+
+ // ignore certain values
+ if (input.ignore === undefined || (value !== null && input.ignore != value)) {
+ // add value to submission
+ add (job_input_id, input.id, value);
+
+ // add payload to submission
+ if (input.payload) {
+ for (var p_id in input.payload) {
+ add (p_id, input.id, input.payload[p_id]);
}
}
}
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -182,7 +182,7 @@
// get selected values
var selected = this.$el.find(':checked');
if (selected.length == 0) {
- return 'null';
+ return '__null__';
}
// return multiple or single value
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -10,10 +10,12 @@
id : '',
cls : '',
error_text : 'No data available',
+ empty_text : 'No selection',
visible : true,
wait : false,
multiple : false,
- searchable : false
+ searchable : false,
+ optional : false
},
// initialize
@@ -181,6 +183,11 @@
// remove all options
this.$select.find('option').remove();
+ // add optional field
+ if (this.options.optional && !this.options.multiple) {
+ this.$select.append(this._templateOption({value : '__null__', label : this.options.empty_text}));
+ }
+
// add new options
for (var key in options) {
this.$select.append(this._templateOption(options[key]));
@@ -229,7 +236,7 @@
*/
_refresh: function() {
// remove placeholder
- this.$select.find('option[value=null]').remove();
+ this.$select.find('option[value="__undefined__"]').remove();
// count remaining entries
var remaining = this.$select.find('option').length;
@@ -238,7 +245,7 @@
this.disable();
// append placeholder
- this.$select.append(this._templateOption({value : 'null', label : this.options.error_text}));
+ this.$select.append(this._templateOption({value : '__undefined__', label : this.options.error_text}));
} else {
// enable select field
this.enable();
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af client/galaxy/scripts/utils/utils.js
--- a/client/galaxy/scripts/utils/utils.js
+++ b/client/galaxy/scripts/utils/utils.js
@@ -36,7 +36,7 @@
value = [value];
}
for (var i in value) {
- if (['None', null, 'null', undefined, 'undefined'].indexOf(value[i]) > -1) {
+ if (['__null__', '__undefined__', 'None', null, undefined].indexOf(value[i]) > -1) {
return false;
}
}
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2333,7 +2333,10 @@
value = [ jsonify(v) for v in value ]
else:
value = [ jsonify(value) ]
- value = { 'values': value }
+ if None in value:
+ value = None
+ else:
+ value = { 'values': value }
elif isinstance(value, list):
value = [ jsonify(v) for v in value ]
else:
@@ -2444,15 +2447,19 @@
input_name = tool_dict.get('name')
if input_name:
# backup default value
- tool_dict['defaultvalue'] = input.get_initial_value(trans, other_values)
+ tool_dict['default_value'] = input.get_initial_value(trans, other_values)
# update input value from tool state
if input_name in state_inputs:
tool_dict['value'] = state_inputs[input_name]
-
+
# sanitize values
sanitize(tool_dict, 'value')
- sanitize(tool_dict, 'defaultvalue')
+ sanitize(tool_dict, 'default_value')
+
+ # set default value if necessary
+ if not tool_dict['value']:
+ tool_dict['value'] = tool_dict['default_value']
# backup final input dictionary
group_inputs[input_index] = tool_dict
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -866,6 +866,8 @@
value = value.split()
return UnvalidatedValue( value )
legal_values = self.get_legal_values( trans, context )
+ if not legal_values and self.optional:
+ return None
assert legal_values, "Parameter %s requires a value, but has no legal values defined" % self.name
if isinstance( value, list ):
if not(self.repeat):
@@ -878,7 +880,7 @@
return rval
else:
value_is_none = ( value == "None" and "None" not in legal_values )
- if value_is_none:
+ if value_is_none or not value:
if self.multiple:
if self.optional:
return []
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-form-base.js
--- a/static/scripts/mvc/tools/tools-form-base.js
+++ b/static/scripts/mvc/tools/tools-form-base.js
@@ -18,9 +18,7 @@
// shows form in compact view mode
compact : false,
// shows errors on start
- initial_errors : false,
- // ensures that all data including disabled optional fields are submitted to the server
- send_all : false
+ initial_errors : false
};
// configure options
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-form-workflow.js
--- a/static/scripts/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/mvc/tools/tools-form-workflow.js
@@ -16,13 +16,16 @@
}
// initialize parameters
- this.workflow = true;
this.options = options;
-
+
+ // set labels
+ this.options.text_enable = 'In Advance';
+ this.options.text_disable = 'At Runtime';
+
// declare fields as optional
Utils.deepeach(options.inputs, function(item) {
if (item.type) {
- item.optional = (['data', 'data_hidden', 'hidden', 'drill_down']).indexOf(item.type) == -1;
+ item.optional = (['data', 'data_hidden', 'hidden', 'drill_down', 'repeat', 'conditional']).indexOf(item.type) == -1;
}
});
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-input.js
--- a/static/scripts/mvc/tools/tools-input.js
+++ b/static/scripts/mvc/tools/tools-input.js
@@ -10,9 +10,13 @@
// link app
this.app = app;
+ // set text labels
+ this.text_enable = app.options.text_enable || 'Enable';
+ this.text_disable = app.options.text_disable || 'Disable';
+
// link field
this.field = options.field;
- this.defaultvalue = options.defaultvalue;
+ this.default_value = options.default_value;
// set element
this.setElement(this._template(options));
@@ -30,10 +34,11 @@
this.field.skip = false;
var v = this.field.value && this.field.value();
this.field.skip = Boolean(options.optional &&
+ ((this.default_value === undefined) ||
((this.field.validate && !this.field.validate()) || !v ||
- (v == this.defaultvalue) || (Number(v) == Number(this.defaultvalue)) ||
- (JSON.stringify(v) == JSON.stringify(this.defaultvalue))));
-
+ (v == this.default_value) || (Number(v) == Number(this.default_value)) ||
+ (JSON.stringify(v) == JSON.stringify(this.default_value)))));
+
// refresh view
this._refresh();
@@ -53,7 +58,7 @@
error: function(text) {
if (!this.field.skip) {
this.$error_text.html(text);
- this.$error.fadeIn('fast');
+ this.$error.show();
this.$el.addClass('ui-error');
}
},
@@ -70,12 +75,12 @@
_refresh: function() {
if (!this.field.skip) {
this.$field.fadeIn('fast');
- this.$title_optional.html('Disable');
+ this.$title_optional.html(this.text_disable);
} else {
this.reset();
this.$field.hide();
- this.$title_optional.html('Enable');
- this.field.value && this.field.value(this.defaultvalue);
+ this.$title_optional.html(this.text_enable);
+ this.field.value && this.field.value(this.default_value);
}
this.app.trigger('refresh');
},
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -319,7 +319,7 @@
// create input field wrapper
var input_element = new InputElement(this.app, {
label : input_def.label,
- defaultvalue : input_def.defaultvalue,
+ default_value : input_def.default_value,
optional : input_def.optional,
help : input_def.help,
field : field
@@ -457,6 +457,7 @@
return new SelectContent.View(this.app, {
id : 'field-' + input_def.id,
extensions : input_def.extensions,
+ optional : input_def.optional,
multiple : input_def.multiple,
type : input_def.type,
data : input_def.options,
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-select-content.js
--- a/static/scripts/mvc/tools/tools-select-content.js
+++ b/static/scripts/mvc/tools/tools-select-content.js
@@ -50,6 +50,7 @@
if (this.mode == 'single') {
radio_buttons.push({icon: 'fa-file-o', label : 'Single dataset', value : 'single'});
this.select_single = new Ui.Select.View({
+ optional : options.optional,
error_text : hda_error,
onchange : function() {
self.trigger('change');
@@ -82,6 +83,7 @@
radio_buttons.push({icon: 'fa-folder-o', label : 'Dataset collection', value : 'collection' });
this.select_collection = new Ui.Select.View({
error_text : hdca_error,
+ optional : options.optional,
onchange : function() {
self.trigger('change');
}
@@ -180,39 +182,38 @@
},
/** Return the currently selected dataset values */
- value : function (dict) {
+ value : function (new_value) {
// update current value
- if (dict && dict.values) {
- try {
- // create list
- var list = [];
- for (var i in dict.values) {
- list.push(dict.values[i].id);
+ if (new_value !== undefined) {
+ if (new_value && new_value.values) {
+ try {
+ // create list with values
+ var list = [];
+ for (var i in new_value.values) {
+ list.push(new_value.values[i].id);
+ }
+
+ // identify suitable select field
+ if (new_value && new_value.values.length > 0 && new_value.values[0].src == 'hcda') {
+ this.current = 'collection';
+ this.select_collection.value(list[0]);
+ } else {
+ if (this.mode == 'multiple') {
+ this.current = 'multiple';
+ this.select_multiple.value(list);
+ } else {
+ this.current = 'single';
+ this.select_single.value(list[0]);
+ }
+ }
+ } catch (err) {
+ console.debug('tools-select-content::value() - Skipped.');
}
-
- // identify suitable select field
- if (dict && dict.values.length > 0 && dict.values[0].src == 'hcda') {
- this.current = 'collection';
- this.select_collection.value(list[0]);
- } else {
- if (this.mode == 'multiple') {
- this.current = 'multiple';
- this.select_multiple.value(list);
- } else {
- this.current = 'single';
- this.select_single.value(list[0]);
- }
- }
- this.refresh();
-
- // check if value has been set
- var select = this._select();
- if (!select.validate()) {
- select.value(select.first());
- }
- } catch (err) {
- console.debug('tools-select-content::value() - Skipped.');
+ } else {
+ this.current = 'single';
+ this.select_single.value('__null__');
}
+ this.refresh();
}
// transform into an array
@@ -247,6 +248,7 @@
/** Refreshes data selection view */
refresh: function() {
+ this.button_type.value(this.current);
for (var i in this.list) {
var $el = this.list[i].field.$el;
if (this.current == i) {
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -121,21 +121,21 @@
if (patch[input.type]) {
value = patch[input.type](value);
}
-
- // handle simple value
- if (!field.skip || self.app.options.send_all) {
- if (field.validate && !field.validate()) {
- value = null;
- }
- if (input.ignore === undefined || (value !== null && input.ignore != value)) {
- // add value to submission
- add (job_input_id, input.id, value);
- // add payload to submission
- if (input.payload) {
- for (var p_id in input.payload) {
- add (p_id, input.id, input.payload[p_id]);
- }
+ // validate value
+ if ((field.skip && input.optional) || (field.validate && !field.validate())) {
+ value = null;
+ }
+
+ // ignore certain values
+ if (input.ignore === undefined || (value !== null && input.ignore != value)) {
+ // add value to submission
+ add (job_input_id, input.id, value);
+
+ // add payload to submission
+ if (input.payload) {
+ for (var p_id in input.payload) {
+ add (p_id, input.id, input.payload[p_id]);
}
}
}
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -182,7 +182,7 @@
// get selected values
var selected = this.$el.find(':checked');
if (selected.length == 0) {
- return 'null';
+ return '__null__';
}
// return multiple or single value
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -10,10 +10,12 @@
id : '',
cls : '',
error_text : 'No data available',
+ empty_text : 'No selection',
visible : true,
wait : false,
multiple : false,
- searchable : false
+ searchable : false,
+ optional : false
},
// initialize
@@ -181,6 +183,11 @@
// remove all options
this.$select.find('option').remove();
+ // add optional field
+ if (this.options.optional && !this.options.multiple) {
+ this.$select.append(this._templateOption({value : '__null__', label : this.options.empty_text}));
+ }
+
// add new options
for (var key in options) {
this.$select.append(this._templateOption(options[key]));
@@ -229,7 +236,7 @@
*/
_refresh: function() {
// remove placeholder
- this.$select.find('option[value=null]').remove();
+ this.$select.find('option[value="__undefined__"]').remove();
// count remaining entries
var remaining = this.$select.find('option').length;
@@ -238,7 +245,7 @@
this.disable();
// append placeholder
- this.$select.append(this._templateOption({value : 'null', label : this.options.error_text}));
+ this.$select.append(this._templateOption({value : '__undefined__', label : this.options.error_text}));
} else {
// enable select field
this.enable();
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-form-base.js
--- a/static/scripts/packed/mvc/tools/tools-form-base.js
+++ b/static/scripts/packed/mvc/tools/tools-form-base.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false,send_all:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree"],function(g,h,f,k,i,a,d,c,e,j,b){return Backbone.View.extend({initialize:function(l){this.optionsDefault={is_dynamic:true,compact:false,initial_errors:false};this.options=g.merge(l,this.optionsDefault);console.debug(this.options);var m=parent.Galaxy;if(m&&m.modal){this.modal=m.modal}else{this.modal=new k.Modal.View()}if(m&&m.currUser){this.is_admin=m.currUser.get("is_admin")}else{this.is_admin=false}this.container=this.options.container||"body";this.deferred=new h();this.setElement("<div/>");$(this.container).append(this.$el);this._buildForm()},reciept:function(l){$(this.container).empty();$(this.container).append(l)},highlight:function(m,n,l){var o=this.element_list[m];if(o){o.error(n||"Please verify this parameter.");if(!l){$(this.container).animate({scrollTop:o.$el.offset().top-20},500)}}},_errors:function(n){this.trigger("reset");if(n&&n.errors){var o=this.tree.matchResponse(n.errors);for(var m in this.element_list){var l=this.element_list[m];if(o[m]){this.highlight(m,o[m],true)}}}},_buildForm:function(){var l=this;this.off("refresh");this.off("reset");this.field_list={};this.input_list={};this.element_list={};this.tree=new b(this);this.content=new e(this);var m=this.options;this._renderForm(m);this.tree.finalize();if(m.initial_errors){this._errors(m)}this.on("refresh",function(){l.deferred.reset();l.deferred.execute(function(){l._updateModel()})});this.on("reset",function(){for(var n in this.element_list){this.element_list[n].reset()}});this.trigger("refresh")},_renderForm:function(u){var t=this;this.message=new k.Message();var q=new k.ButtonIcon({icon:"fa-info-circle",title:(!u.compact&&"Requirements")||null,tooltip:"Display tool requirements",onclick:function(){if(!this.visible){this.visible=true;t.message.update({persistent:true,message:c.requirements(u),status:"info"})}else{this.visible=false;t.message.update({message:""})}}});if(!u.requirements||u.requirements.length==0){q.$el.hide()}var m=new k.ButtonMenu({icon:"fa-cubes",title:(!u.compact&&"Versions")||null,tooltip:"Select another tool version"});if(u.versions&&u.versions.length>1){for(var o in u.versions){var r=u.versions[o];if(r!=u.version){m.addMenu({title:"Switch to "+r,version:r,icon:"fa-cube",onclick:function(){u.id=u.id.replace(u.version,this.version);u.version=this.version;t.deferred.reset();t.deferred.execute(function(){t._buildModel()})}})}}}else{m.$el.hide()}var p=new k.ButtonMenu({icon:"fa-caret-down",title:(!u.compact&&"Options")||null,tooltip:"View available options"});if(u.biostar_url){p.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/p/new/post/")}});p.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(u.biostar_url+"/t/"+u.id+"/")}})}p.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+u.id)}});if(this.is_admin){p.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+u.id+"/download"}})}this.section=new j.View(t,{inputs:u.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new f.View({icon:"fa-wrench",title:"<b>"+u.name+"</b> "+u.description+" (Galaxy Tool Version "+u.version+")",cls:"ui-portlet-slim",operations:{requirements:q,menu:p,versions:m},buttons:this.buttons});if(u.compact){this.portlet.$content.css("padding","0px")}this.portlet.append(this.message.$el,true);this.portlet.append(this.section.$el);this.$el.empty();this.$el.append(this.portlet.$el);if(u.help!=""){this.$el.append(c.help(u.help))}if(u.citations){var s=$("<div/>");var l=new i.ToolCitationCollection();l.tool_id=u.id;var n=new a.CitationListView({el:s,collection:l});n.render();l.fetch();this.$el.append(s)}if(u.message){this.message.update({persistent:true,status:"warning",message:u.message})}}})});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-form-workflow.js
--- a/static/scripts/packed/mvc/tools/tools-form-workflow.js
+++ b/static/scripts/packed/mvc/tools/tools-form-workflow.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.workflow=true;this.options=e;b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-form-base"],function(b,a){var c=a.extend({initialize:function(e){this.node=workflow.active_node;if(!this.node){console.debug("FAILED - tools-form-workflow:initialize() - Node not found in workflow.");return}this.options=e;this.options.text_enable="In Advance";this.options.text_disable="At Runtime";b.deepeach(e.inputs,function(f){if(f.type){f.optional=(["data","data_hidden","hidden","drill_down","repeat","conditional"]).indexOf(f.type)==-1}});b.deepeach(e.inputs,function(f){if(f.type){if(f.type=="conditional"){f.test_param.optional=false}}});var d=this;b.get({url:galaxy_config.root+"api/datatypes",cache:true,success:function(f){d.datatypes=f;d._makeSections(e.inputs);a.prototype.initialize.call(d,e)}})},_makeSections:function(d){d[b.uuid()]={label:"Edit Step Attributes",type:"section",expand:this.node.annotation,inputs:[{label:"Annotation / Notes",name:"annotation",type:"text",area:true,help:"Add an annotation or notes to this step; annotations are available when a workflow is viewed.",value:this.node.annotation}]};this.post_job_actions=this.node.post_job_actions;for(var e in this.node.output_terminals){d[b.uuid()]=this._makeSection(e)}},_makeSection:function(h){var g=[];for(key in this.datatypes){g.push({0:this.datatypes[key],1:this.datatypes[key]})}g.sort(function(j,i){return j.label>i.label?1:j.label<i.label?-1:0});g.unshift({0:"Sequences",1:"Sequences"});g.unshift({0:"Roadmaps",1:"Roadmaps"});g.unshift({0:"Leave unchanged",1:"None"});var f={label:"Edit Step Action: '"+h+"'",type:"section",inputs:[{action:"RenameDatasetAction",argument:"newname",label:"Rename dataset",type:"text",value:"",ignore:"",help:'This action will rename the result dataset. Click <a href="https://wiki.galaxyproject.org/Learn/AdvancedWorkflow/Variables">here</a> for more information.'},{action:"ChangeDatatypeAction",argument:"newtype",label:"Change datatype",type:"select",ignore:"None",options:g,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",argument:"tags",label:"Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{label:"Assign columns",type:"section",inputs:[{action:"ColumnSetAction",argument:"chromCol",label:"Chrom column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"startCol",label:"Start column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"endCol",label:"End column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"strandCol",label:"Strand column",type:"text",value:"",ignore:""},{action:"ColumnSetAction",argument:"nameCol",label:"Name column",type:"text",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."},{action:"EmailAction",label:"Email notification",type:"boolean",value:"false",ignore:"false",help:"This action will send an email notifying you when the job is done.",payload:{host:window.location.host}},{action:"DeleteIntermediatesAction",label:"Delete non-outputs",type:"boolean",value:"false",ignore:"false",help:"All non-output steps of this workflow will have datasets deleted if they are no longer being used as job inputs when the job this action is attached to is finished. You *must* be using workflow outputs (the snowflake) in your workflow for this to have any effect."}]};var d=this;function e(n,o){o=o||[];o.push(n);for(var m in n.inputs){var k=n.inputs[m];if(k.action){k.name="pja__"+h+"__"+k.action;if(k.argument){k.name+="__"+k.argument}if(k.payload){for(var s in k.payload){var q=k.payload[s];k.payload[k.name+"__"+s]=q;delete q}}var r=d.post_job_actions[k.action+h];if(r){for(var l in o){o[l].expand=true}if(k.argument){k.value=r.action_arguments&&r.action_arguments[k.argument]||k.value}else{k.value="true"}}}if(k.inputs){e(k,o.slice(0))}}}e(f);return f},_buildModel:function(){Galaxy.modal.show({title:"Coming soon...",body:"This feature has not been implemented yet.",buttons:{Close:function(){Galaxy.modal.hide()}}})},_updateModel:function(){var d=this;var e=this.tree.finalize();console.debug("tools-form-workflow::_refreshForm() - Refreshing states.");console.debug(e);var g=this.deferred.register();var f=galaxy_config.root+"workflow/editor_form_post?tool_id="+this.options.id+"&__is_dynamic__=False";b.request({type:"GET",url:f,data:e,success:function(h){d.node.update_field_data(h);d._errors(h&&h.tool_model);d.deferred.done(g);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(h)},error:function(h){d.deferred.done(g);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(h)}})}});return{View:c}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-input.js
--- a/static/scripts/packed/mvc/tools/tools-input.js
+++ b/static/scripts/packed/mvc/tools/tools-input.js
@@ -1,1 +1,1 @@
-define([],function(){return Backbone.View.extend({initialize:function(d,c){this.app=d;this.field=c.field;this.defaultvalue=c.defaultvalue;this.setElement(this._template(c));this.$field=this.$el.find(".ui-table-form-field");this.$title_optional=this.$el.find(".ui-table-form-title-optional");this.$error_text=this.$el.find(".ui-table-form-error-text");this.$error=this.$el.find(".ui-table-form-error");this.$field.prepend(this.field.$el);this.field.skip=false;var b=this.field.value&&this.field.value();this.field.skip=Boolean(c.optional&&((this.field.validate&&!this.field.validate())||!b||(b==this.defaultvalue)||(Number(b)==Number(this.defaultvalue))||(JSON.stringify(b)==JSON.stringify(this.defaultvalue))));this._refresh();var a=this;this.$title_optional.on("click",function(){a.field.skip=!a.field.skip;a._refresh()})},error:function(a){if(!this.field.skip){this.$error_text.html(a);this.$error.fadeIn("fast");this.$el.addClass("ui-error")}},reset:function(){this.$error.hide();this.$el.removeClass("ui-error")},_refresh:function(){if(!this.field.skip){this.$field.fadeIn("fast");this.$title_optional.html("Disable")}else{this.reset();this.$field.hide();this.$title_optional.html("Enable");this.field.value&&this.field.value(this.defaultvalue)}this.app.trigger("refresh")},_template:function(a){var b='<div class="ui-table-form-element"><div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"/></div><div class="ui-table-form-title-strong">';if(a.optional){b+=a.label+'<span> [<span class="ui-table-form-title-optional"/>]</span>'}else{b+=a.label}b+='</div><div class="ui-table-form-field">';if(a.help){b+='<div class="ui-table-form-info">'+a.help+"</div>"}b+="</div></div>";return b}})});
\ No newline at end of file
+define([],function(){return Backbone.View.extend({initialize:function(d,c){this.app=d;this.text_enable=d.options.text_enable||"Enable";this.text_disable=d.options.text_disable||"Disable";this.field=c.field;this.default_value=c.default_value;this.setElement(this._template(c));this.$field=this.$el.find(".ui-table-form-field");this.$title_optional=this.$el.find(".ui-table-form-title-optional");this.$error_text=this.$el.find(".ui-table-form-error-text");this.$error=this.$el.find(".ui-table-form-error");this.$field.prepend(this.field.$el);this.field.skip=false;var b=this.field.value&&this.field.value();this.field.skip=Boolean(c.optional&&((this.default_value===undefined)||((this.field.validate&&!this.field.validate())||!b||(b==this.default_value)||(Number(b)==Number(this.default_value))||(JSON.stringify(b)==JSON.stringify(this.default_value)))));this._refresh();var a=this;this.$title_optional.on("click",function(){a.field.skip=!a.field.skip;a._refresh()})},error:function(a){if(!this.field.skip){this.$error_text.html(a);this.$error.show();this.$el.addClass("ui-error")}},reset:function(){this.$error.hide();this.$el.removeClass("ui-error")},_refresh:function(){if(!this.field.skip){this.$field.fadeIn("fast");this.$title_optional.html(this.text_disable)}else{this.reset();this.$field.hide();this.$title_optional.html(this.text_enable);this.field.value&&this.field.value(this.default_value)}this.app.trigger("refresh")},_template:function(a){var b='<div class="ui-table-form-element"><div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"/></div><div class="ui-table-form-title-strong">';if(a.optional){b+=a.label+'<span> [<span class="ui-table-form-title-optional"/>]</span>'}else{b+=a.label}b+='</div><div class="ui-table-form-field">';if(a.help){b+='<div class="ui-table-form-info">'+a.help+"</div>"}b+="</div></div>";return b}})});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs,cls:"ui-table-plain"});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i,cls:"ui-table-plain"});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs,cls:"ui-table-plain"});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,defaultvalue:i.defaultvalue,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs,cls:"ui-table-plain"});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i,cls:"ui-table-plain"});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs,cls:"ui-table-plain"});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-select-content.js
--- a/static/scripts/packed/mvc/tools/tools-select-content.js
+++ b/static/scripts/packed/mvc/tools/tools-select-content.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(l,g){this.app=l;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(g.type=="data_collection"){this.mode="collection"}else{if(g.multiple){this.mode="multiple"}else{this.mode="single"}}this.current=this.mode;this.list={};var k=c.textify(g.extensions);var n="No dataset available.";if(k){n="No "+k+" dataset available."}var m="No dataset list available.";if(k){m="No "+k+" dataset collection available."}if(this.mode=="single"){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({error_text:n,onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}if(this.mode=="single"||this.mode=="multiple"){j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,error_text:n,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"}}if(this.mode=="single"||this.mode=="collection"){j.push({icon:"fa-folder-o",label:"Dataset collection",value:"collection"});this.select_collection=new e.Select.View({error_text:m,onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"}}this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());if(_.size(this.list)>1){this.$el.append(c.wrap(this.button_type.$el))}for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);if(this.options.value!==undefined){this.value(this.options.value)}this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple&&this.select_multiple.update(l);this.select_collection&&this.select_collection.update(f);this.app.content.add(g)},value:function(m){if(m&&m.values){try{var l=[];for(var h in m.values){l.push(m.values[h].id)}if(m&&m.values.length>0&&m.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(this.mode=="multiple"){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}this.refresh();var g=this._select();if(!g.validate()){g.value(g.first())}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:this.mode=="single"&&this.current!="single",values:[]};for(var h in j){f.values.push({id:j[h],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.mode=="single"&&this.current!="single"){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(l,g){this.app=l;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(g.type=="data_collection"){this.mode="collection"}else{if(g.multiple){this.mode="multiple"}else{this.mode="single"}}this.current=this.mode;this.list={};var k=c.textify(g.extensions);var n="No dataset available.";if(k){n="No "+k+" dataset available."}var m="No dataset list available.";if(k){m="No "+k+" dataset collection available."}if(this.mode=="single"){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({optional:g.optional,error_text:n,onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}if(this.mode=="single"||this.mode=="multiple"){j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,error_text:n,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"}}if(this.mode=="single"||this.mode=="collection"){j.push({icon:"fa-folder-o",label:"Dataset collection",value:"collection"});this.select_collection=new e.Select.View({error_text:m,optional:g.optional,onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"}}this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());if(_.size(this.list)>1){this.$el.append(c.wrap(this.button_type.$el))}for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);if(this.options.value!==undefined){this.value(this.options.value)}this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple&&this.select_multiple.update(l);this.select_collection&&this.select_collection.update(f);this.app.content.add(g)},value:function(h){if(h!==undefined){if(h&&h.values){try{var l=[];for(var g in h.values){l.push(h.values[g].id)}if(h&&h.values.length>0&&h.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(this.mode=="multiple"){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}else{this.current="single";this.select_single.value("__null__")}this.refresh()}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:this.mode=="single"&&this.current!="single",values:[]};for(var g in j){f.values.push({id:j[g],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){this.button_type.value(this.current);for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.mode=="single"&&this.current!="single"){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if(!t.skip||b.app.options.send_all){if(t.validate&&!t.validate()){v=null}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if((t.skip&&u.optional)||(t.validate&&!t.validate())){v=null}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={visible:true,data:[],id:b.uuid(),error_text:"No data available.",wait_text:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){return b.validate(this.value())},wait:function(){if(this._size()==0){this._messageShow(this.options.wait_text,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.error_text,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={visible:true,data:[],id:b.uuid(),error_text:"No data available.",wait_text:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){return b.validate(this.value())},wait:function(){if(this._size()==0){this._messageShow(this.options.wait_text,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.error_text,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"__null__"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",error_text:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c);if(this.$select.select2){this.$select.select2("val",c)}}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){return a.validate(this.value())},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.error_text}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",error_text:"No data available",empty_text:"No selection",visible:true,wait:false,multiple:false,searchable:false,optional:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c);if(this.$select.select2){this.$select.select2("val",c)}}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){return a.validate(this.value())},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();if(this.options.optional&&!this.options.multiple){this.$select.append(this._templateOption({value:"__null__",label:this.options.empty_text}))}for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find('option[value="__undefined__"]').remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"__undefined__",label:this.options.error_text}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/packed/utils/utils.js
--- a/static/scripts/packed/utils/utils.js
+++ b/static/scripts/packed/utils/utils.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(m){function n(r,q){for(var o in r){var p=r[o];if(p&&typeof(p)=="object"){q(p);n(p,q)}}}function d(o){return $("<div/>").text(o).html()}function l(p){if(!(p instanceof Array)){p=[p]}for(var o in p){if(["None",null,"null",undefined,"undefined"].indexOf(p[o])>-1){return false}}return true}function h(o){var o=o.toString();if(o){o=o.replace(/,/g,", ");var p=o.lastIndexOf(", ");if(p!=-1){o=o.substr(0,p)+" or "+o.substr(p+1)}return o}return""}function e(o){top.__utils__get__=top.__utils__get__||{};if(o.cache&&top.__utils__get__[o.url]){o.success&&o.success(top.__utils__get__[o.url]);console.debug("utils.js::get() - Fetching from cache ["+o.url+"].")}else{i({url:o.url,data:o.data,success:function(p){top.__utils__get__[o.url]=p;o.success&&o.success(p)},error:function(p){o.error&&o.error(p)}})}}function i(p){var o={contentType:"application/json",type:p.type||"GET",data:p.data||{},url:p.url};if(o.type=="GET"||o.type=="DELETE"){if(o.url.indexOf("?")==-1){o.url+="?"}else{o.url+="&"}o.url=o.url+$.param(o.data,true);o.data=null}else{o.dataType="json";o.url=o.url;o.data=JSON.stringify(o.data)}$.ajax(o).done(function(q){if(typeof q==="string"){try{q=q.replace("Infinity,",'"Infinity",');q=jQuery.parseJSON(q)}catch(r){console.debug(r)}}p.success&&p.success(q)}).fail(function(r){var q=null;try{q=jQuery.parseJSON(r.responseText)}catch(s){q=r.responseText}p.error&&p.error(q,r)})}function j(r,o){var p=$('<div class="'+r+'"></div>');p.appendTo(":eq(0)");var q=p.css(o);p.remove();return q}function g(o){if(!$('link[href^="'+o+'"]').length){$('<link href="'+galaxy_config.root+o+'" rel="stylesheet">').appendTo("head")}}function k(o,p){if(o){return m.defaults(o,p)}else{return p}}function b(p,r){var q="";if(p>=100000000000){p=p/100000000000;q="TB"}else{if(p>=100000000){p=p/100000000;q="GB"}else{if(p>=100000){p=p/100000;q="MB"}else{if(p>=100){p=p/100;q="KB"}else{if(p>0){p=p*10;q="b"}else{return"<strong>-</strong>"}}}}}var o=(Math.round(p)/10);if(r){return o+" "+q}else{return"<strong>"+o+"</strong> "+q}}function a(){return"x"+Math.random().toString(36).substring(2,9)}function c(o){var p=$("<p></p>");p.append(o);return p}function f(){var q=new Date();var o=(q.getHours()<10?"0":"")+q.getHours();var p=(q.getMinutes()<10?"0":"")+q.getMinutes();var r=q.getDate()+"/"+(q.getMonth()+1)+"/"+q.getFullYear()+", "+o+":"+p;return r}return{cssLoadFile:g,cssGetAttribute:j,get:e,merge:k,bytesToString:b,uuid:a,time:f,wrap:c,request:i,sanitize:d,textify:h,validate:l,deepeach:n}});
\ No newline at end of file
+define(["libs/underscore"],function(m){function n(r,q){for(var o in r){var p=r[o];if(p&&typeof(p)=="object"){q(p);n(p,q)}}}function d(o){return $("<div/>").text(o).html()}function l(p){if(!(p instanceof Array)){p=[p]}for(var o in p){if(["__null__","__undefined__","None",null,undefined].indexOf(p[o])>-1){return false}}return true}function h(o){var o=o.toString();if(o){o=o.replace(/,/g,", ");var p=o.lastIndexOf(", ");if(p!=-1){o=o.substr(0,p)+" or "+o.substr(p+1)}return o}return""}function e(o){top.__utils__get__=top.__utils__get__||{};if(o.cache&&top.__utils__get__[o.url]){o.success&&o.success(top.__utils__get__[o.url]);console.debug("utils.js::get() - Fetching from cache ["+o.url+"].")}else{i({url:o.url,data:o.data,success:function(p){top.__utils__get__[o.url]=p;o.success&&o.success(p)},error:function(p){o.error&&o.error(p)}})}}function i(p){var o={contentType:"application/json",type:p.type||"GET",data:p.data||{},url:p.url};if(o.type=="GET"||o.type=="DELETE"){if(o.url.indexOf("?")==-1){o.url+="?"}else{o.url+="&"}o.url=o.url+$.param(o.data,true);o.data=null}else{o.dataType="json";o.url=o.url;o.data=JSON.stringify(o.data)}$.ajax(o).done(function(q){if(typeof q==="string"){try{q=q.replace("Infinity,",'"Infinity",');q=jQuery.parseJSON(q)}catch(r){console.debug(r)}}p.success&&p.success(q)}).fail(function(r){var q=null;try{q=jQuery.parseJSON(r.responseText)}catch(s){q=r.responseText}p.error&&p.error(q,r)})}function j(r,o){var p=$('<div class="'+r+'"></div>');p.appendTo(":eq(0)");var q=p.css(o);p.remove();return q}function g(o){if(!$('link[href^="'+o+'"]').length){$('<link href="'+galaxy_config.root+o+'" rel="stylesheet">').appendTo("head")}}function k(o,p){if(o){return m.defaults(o,p)}else{return p}}function b(p,r){var q="";if(p>=100000000000){p=p/100000000000;q="TB"}else{if(p>=100000000){p=p/100000000;q="GB"}else{if(p>=100000){p=p/100000;q="MB"}else{if(p>=100){p=p/100;q="KB"}else{if(p>0){p=p*10;q="b"}else{return"<strong>-</strong>"}}}}}var o=(Math.round(p)/10);if(r){return o+" "+q}else{return"<strong>"+o+"</strong> "+q}}function a(){return"x"+Math.random().toString(36).substring(2,9)}function c(o){var p=$("<p></p>");p.append(o);return p}function f(){var q=new Date();var o=(q.getHours()<10?"0":"")+q.getHours();var p=(q.getMinutes()<10?"0":"")+q.getMinutes();var r=q.getDate()+"/"+(q.getMonth()+1)+"/"+q.getFullYear()+", "+o+":"+p;return r}return{cssLoadFile:g,cssGetAttribute:j,get:e,merge:k,bytesToString:b,uuid:a,time:f,wrap:c,request:i,sanitize:d,textify:h,validate:l,deepeach:n}});
\ No newline at end of file
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af static/scripts/utils/utils.js
--- a/static/scripts/utils/utils.js
+++ b/static/scripts/utils/utils.js
@@ -36,7 +36,7 @@
value = [value];
}
for (var i in value) {
- if (['None', null, 'null', undefined, 'undefined'].indexOf(value[i]) > -1) {
+ if (['__null__', '__undefined__', 'None', null, undefined].indexOf(value[i]) > -1) {
return false;
}
}
diff -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d -r 820114af3bf0689131885c8c99165532902bd2af templates/webapps/galaxy/workflow/editor_tool_form.mako
--- a/templates/webapps/galaxy/workflow/editor_tool_form.mako
+++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako
@@ -18,7 +18,6 @@
'is_dynamic' : False,
'compact' : True,
'initial_errors' : True,
- 'send_all' : True,
'container' : '#right-content'
})
%>
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.
1
0
23 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7ee46fef21b7/
Changeset: 7ee46fef21b7
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 13:30:39+00:00
Summary: Adding select-all to ftpupload
Affected #: 1 file
diff -r a2308bdc93b897af974766b190abe019ade49e9a -r 7ee46fef21b796e355e4dcc995852345f2325879 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -49,6 +49,48 @@
// update stats
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
+ // ADD THINGS HERE
+ //
+ $($('.upload-ftp')[0]).find('#selectAll').on('click', function(){
+ var checkboxes=$(this).parent().parent().parent().parent().find('tr.upload-ftp-row>td>div');
+ var len = checkboxes.length;
+ var allChecked;
+ $this = $(this);
+ //
+ if($this.hasClass("fa-square-o")){
+ $this.removeClass("fa-square-o");
+ $this.removeClass("fa-minus-square-o");
+ $this.addClass("fa-check-square-o");
+ allChecked=true;
+ }
+ else{
+ $this.removeClass("fa-check-square-o");
+ $this.removeClass("fa-minus-square-o");
+ $this.addClass("fa-square-o");
+ allChecked=false;
+ }
+ //
+ for(i = 0; i < len; i++){
+ if(allChecked)
+ {
+
+ checkboxes.eq(i).removeClass("fa-square-o");
+ checkboxes.eq(i).addClass("fa-check-square-o");
+ }
+ else{
+ checkboxes.eq(i).removeClass("fa-check-square-o");
+ checkboxes.eq(i).addClass("fa-square-o");
+ }
+ }
+ console.log(checkboxes, allChecked);
+ return;
+ } );
+
+
+
+ // END JC ADD
+
+
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
@@ -56,6 +98,10 @@
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
+
+
+
+
},
// add
@@ -110,7 +156,40 @@
// add new icon class
$icon.addClass(self.options.class_add);
}
+
+ var selectBox=$icon.parent().parent().parent().parent().find('#selectAll');
+ var checkboxes=$icon.parent().parent().parent().parent().find('tr.upload-ftp-row>td>div');
+ var checkedCheckboxes=$icon.parent().parent().parent().parent().find('tr.upload-ftp-row>td>div.fa-check-square-o');
+ var lenAll = checkboxes.length;
+ var lenChecked = checkedCheckboxes.length;
+// var checked = 0;
+ // console.log("BeforeLoop " + checked);
+ // for (i = 0; i < len; i++) {
+ // console.log("In loop "+checked, checkboxes.eq(i));
+ // if (checkboxes.eq(i).hasClass("fa-check-square-o")) {
+ // checked++;
+ // console.log("In if "+checked);
+ // }
+ // }
+ if(lenChecked > 0 && lenChecked !== lenAll){
+ selectBox.removeClass("fa-square-o");
+ selectBox.removeClass("fa-check-square-o");
+ selectBox.addClass("fa-minus-square-o");
+ }
+ else if(lenChecked === lenAll){
+ selectBox.removeClass("fa-square-o");
+ selectBox.addClass("fa-check-square-o");
+ selectBox.removeClass("fa-minus-square-o");
+ }
+ else if(lenChecked === 0){
+ selectBox.addClass("fa-square-o");
+ selectBox.removeClass("fa-check-square-o");
+ selectBox.removeClass("fa-minus-square-o");
+ }
+ console.log(checkboxes,lenChecked);
+
});
+
},
// get model index
@@ -130,7 +209,7 @@
// template row
_templateRow: function(options) {
return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
- '<td><div class="icon"/></td>' +
+ '<td><div class="icon " /></td>' +
'<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
'<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
'<td style="white-space: nowrap;">' + options.ctime + '</td>' +
@@ -149,7 +228,9 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
- '<th></th>' +
+//jc added
+ '<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
+//end jc added
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
@@ -171,7 +252,11 @@
return '<div class="upload-ftp">' +
'<div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/>' +
'<div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>' + this.app.options.ftp_upload_site + '</strong> using your Galaxy credentials (email address and password).</div>' +
- '<div id="upload-ftp-content"></div>' +
+ '<div id="upload-ftp-content">'
+//jc added
+
+//end jc added
+ '</div>' +
'<div>';
}
https://bitbucket.org/galaxy/galaxy-central/commits/49f601721738/
Changeset: 49f601721738
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 20:33:26+00:00
Summary: complete selectAll checkbox
Affected #: 1 file
diff -r 7ee46fef21b796e355e4dcc995852345f2325879 -r 49f601721738ec2742252c090240381ff2551455 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -49,59 +49,62 @@
// update stats
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
- // ADD THINGS HERE
- //
- $($('.upload-ftp')[0]).find('#selectAll').on('click', function(){
- var checkboxes=$(this).parent().parent().parent().parent().find('tr.upload-ftp-row>td>div');
+
+ var selectAll = this.$el.find('#selectAll');
+
+ // call method to determine and set selectAll status on loading
+ this._updateSelectAll(selectAll);
+
+ // selectAll checkbox has been clicked
+ selectAll.on('click', function(){
+ var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
var len = checkboxes.length;
var allChecked;
$this = $(this);
- //
- if($this.hasClass("fa-square-o")){
- $this.removeClass("fa-square-o");
- $this.removeClass("fa-minus-square-o");
- $this.addClass("fa-check-square-o");
+
+ // change state of the selectAll checkbox
+ if($this.hasClass('fa-square-o')){
+ // in unchecked, change to checked
+ $this.removeClass('fa-square-o fa-minus-square-o');
+ $this.addClass('fa-check-square-o');
allChecked=true;
}
else{
- $this.removeClass("fa-check-square-o");
- $this.removeClass("fa-minus-square-o");
- $this.addClass("fa-square-o");
+ // if checked, change to unchecked
+ $this.removeClass('fa-check-square-o fa-minus-square-o');
+ $this.addClass('fa-square-o');
allChecked=false;
}
- //
+
+ // change state of the sub-checkboxes
for(i = 0; i < len; i++){
if(allChecked)
{
-
- checkboxes.eq(i).removeClass("fa-square-o");
- checkboxes.eq(i).addClass("fa-check-square-o");
+ // all checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-square-o'))
+ {
+ // if they are not checked, check them
+ checkboxes.eq(i).trigger('addToUpBox');
+ }
}
else{
- checkboxes.eq(i).removeClass("fa-check-square-o");
- checkboxes.eq(i).addClass("fa-square-o");
+ // no checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-check-square-o'))
+ {
+ // if they are checked, uncheck them
+ checkboxes.eq(i).trigger('addToUpBox');
+ }
}
}
- console.log(checkboxes, allChecked);
return;
} );
-
-
- // END JC ADD
-
-
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
-
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
-
-
-
-
},
// add
@@ -125,73 +128,74 @@
} else {
icon_class = this.options.class_add;
}
-
// add icon class
$icon.addClass(icon_class);
+
+ $it.on('addToUpBox', function(){
+ var model_index = self._find(ftp_file);
- // click to add ftp files
- $it.on('click', function() {
- // find model
- var model_index = self._find(ftp_file);
-
- // update icon
- $icon.removeClass();
-
- // add model
- if (!model_index) {
- // add to uploadbox
- self.app.uploadbox.add([{
- mode : 'ftp',
- name : ftp_file.path,
- size : ftp_file.size,
- path : ftp_file.path
- }]);
-
- // add new icon class
- $icon.addClass(self.options.class_remove);
- } else {
- // remove
- self.app.collection.remove(model_index);
-
- // add new icon class
- $icon.addClass(self.options.class_add);
- }
+ // update icon
+ $icon.removeClass();
- var selectBox=$icon.parent().parent().parent().parent().find('#selectAll');
- var checkboxes=$icon.parent().parent().parent().parent().find('tr.upload-ftp-row>td>div');
- var checkedCheckboxes=$icon.parent().parent().parent().parent().find('tr.upload-ftp-row>td>div.fa-check-square-o');
- var lenAll = checkboxes.length;
- var lenChecked = checkedCheckboxes.length;
-// var checked = 0;
- // console.log("BeforeLoop " + checked);
- // for (i = 0; i < len; i++) {
- // console.log("In loop "+checked, checkboxes.eq(i));
- // if (checkboxes.eq(i).hasClass("fa-check-square-o")) {
- // checked++;
- // console.log("In if "+checked);
- // }
- // }
- if(lenChecked > 0 && lenChecked !== lenAll){
- selectBox.removeClass("fa-square-o");
- selectBox.removeClass("fa-check-square-o");
- selectBox.addClass("fa-minus-square-o");
- }
- else if(lenChecked === lenAll){
- selectBox.removeClass("fa-square-o");
- selectBox.addClass("fa-check-square-o");
- selectBox.removeClass("fa-minus-square-o");
- }
- else if(lenChecked === 0){
- selectBox.addClass("fa-square-o");
- selectBox.removeClass("fa-check-square-o");
- selectBox.removeClass("fa-minus-square-o");
- }
- console.log(checkboxes,lenChecked);
-
+ // add model
+ if (!model_index) {
+ // add to uploadbox
+ self.app.uploadbox.add([{
+ mode : 'ftp',
+ name : ftp_file.path,
+ size : ftp_file.size,
+ path : ftp_file.path
+ }]);
+ // add new icon class
+ $icon.addClass(self.options.class_remove);
+ } else {
+ // remove
+ self.app.collection.remove(model_index);
+ // add new icon class
+ $icon.addClass(self.options.class_add);
+ }
});
- },
-
+ $it.on('click', function() {
+ //trigger my new event
+ $icon.trigger('addToUpBox');
+
+ // click to add ftp files
+ // modify selectAll box based on number of checkboxes checked
+ var selectBox=$icon.parents().find('#selectAll');
+ // determine and set state of selectAll after sub-checkbox clicked
+ self._updateSelectAll(selectBox);
+ });
+ },
+
+ _updateSelectAll: function(selectBox){
+ // array of all checkboxes
+ var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
+ // array of only checked checkboxes
+ var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
+ var lenAll = checkboxes.length;
+ var lenChecked = checkedCheckboxes.length;
+
+ // determine which state the selectAll checkbox needs to be and setting it
+ if(lenChecked > 0 && lenChecked !== lenAll){
+ // indeterminate state
+ selectBox.removeClass('fa-square-o fa-check-square-o');
+ selectBox.addClass('fa-minus-square-o');
+ }
+ else if(lenChecked === lenAll){
+ // checked state
+ selectBox.removeClass('fa-square-o fa-minus-square-o');
+ selectBox.addClass('fa-check-square-o');
+ }
+ else if(lenChecked === 0){
+ // unchecked state
+ selectBox.removeClass('fa-check-square-o fa-minus-square-o');
+ selectBox.addClass('fa-square-o');
+ }
+ },
+
+
+
// get model index
_find: function(ftp_file) {
// check if exists already
https://bitbucket.org/galaxy/galaxy-central/commits/05d85016a5cc/
Changeset: 05d85016a5cc
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 20:40:28+00:00
Summary: complete selectAll checkbox cleanup
Affected #: 1 file
diff -r 49f601721738ec2742252c090240381ff2551455 -r 05d85016a5ccf5fc3437e75cc3e3b726387042e6 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -103,6 +103,7 @@
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
+
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
},
@@ -128,10 +129,12 @@
} else {
icon_class = this.options.class_add;
}
+
// add icon class
$icon.addClass(icon_class);
$it.on('addToUpBox', function(){
+ // find model
var model_index = self._find(ftp_file);
// update icon
@@ -146,16 +149,19 @@
size : ftp_file.size,
path : ftp_file.path
}]);
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
+
// add new icon class
$icon.addClass(self.options.class_add);
}
});
+ // click to add ftp files
$it.on('click', function() {
//trigger my new event
$icon.trigger('addToUpBox');
@@ -232,9 +238,7 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
-//jc added
'<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
-//end jc added
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
@@ -257,9 +261,7 @@
'<div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/>' +
'<div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>' + this.app.options.ftp_upload_site + '</strong> using your Galaxy credentials (email address and password).</div>' +
'<div id="upload-ftp-content">'
-//jc added
-//end jc added
'</div>' +
'<div>';
}
https://bitbucket.org/galaxy/galaxy-central/commits/7be57e717422/
Changeset: 7be57e717422
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 20:53:07+00:00
Summary: complete selectAll tab fixes
Affected #: 1 file
diff -r 05d85016a5ccf5fc3437e75cc3e3b726387042e6 -r 7be57e7174228c8300fc76d1514f25f7408bf32a static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -56,48 +56,48 @@
this._updateSelectAll(selectAll);
// selectAll checkbox has been clicked
- selectAll.on('click', function(){
- var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
- var len = checkboxes.length;
- var allChecked;
- $this = $(this);
+ selectAll.on('click', function(){
+ var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
+ var len = checkboxes.length;
+ var allChecked;
+ $this = $(this);
- // change state of the selectAll checkbox
- if($this.hasClass('fa-square-o')){
- // in unchecked, change to checked
- $this.removeClass('fa-square-o fa-minus-square-o');
- $this.addClass('fa-check-square-o');
- allChecked=true;
- }
- else{
- // if checked, change to unchecked
- $this.removeClass('fa-check-square-o fa-minus-square-o');
- $this.addClass('fa-square-o');
- allChecked=false;
- }
+ // change state of the selectAll checkbox
+ if($this.hasClass('fa-square-o')){
+ // in unchecked, change to checked
+ $this.removeClass('fa-square-o fa-minus-square-o');
+ $this.addClass('fa-check-square-o');
+ allChecked=true;
+ }
+ else{
+ // if checked, change to unchecked
+ $this.removeClass('fa-check-square-o fa-minus-square-o');
+ $this.addClass('fa-square-o');
+ allChecked=false;
+ }
- // change state of the sub-checkboxes
- for(i = 0; i < len; i++){
- if(allChecked)
- {
- // all checkboxes should be checked
+ // change state of the sub-checkboxes
+ for(i = 0; i < len; i++){
+ if(allChecked)
+ {
+ // all checkboxes should be checked
if(checkboxes.eq(i).hasClass('fa-square-o'))
{
- // if they are not checked, check them
+ // if they are not checked, check them
checkboxes.eq(i).trigger('addToUpBox');
}
- }
- else{
- // no checkboxes should be checked
+ }
+ else{
+ // no checkboxes should be checked
if(checkboxes.eq(i).hasClass('fa-check-square-o'))
{
- // if they are checked, uncheck them
- checkboxes.eq(i).trigger('addToUpBox');
+ // if they are checked, uncheck them
+ checkboxes.eq(i).trigger('addToUpBox');
}
- }
- }
- return;
- } );
+ }
+ }
+ return;
+ } );
} else {
// add info
@@ -134,74 +134,74 @@
$icon.addClass(icon_class);
$it.on('addToUpBox', function(){
- // find model
- var model_index = self._find(ftp_file);
+// find model
+var model_index = self._find(ftp_file);
- // update icon
- $icon.removeClass();
+ // update icon
+ $icon.removeClass();
- // add model
- if (!model_index) {
- // add to uploadbox
- self.app.uploadbox.add([{
- mode : 'ftp',
- name : ftp_file.path,
- size : ftp_file.size,
- path : ftp_file.path
- }]);
+ // add model
+ if (!model_index) {
+ // add to uploadbox
+ self.app.uploadbox.add([{
+ mode : 'ftp',
+ name : ftp_file.path,
+ size : ftp_file.size,
+ path : ftp_file.path
+ }]);
- // add new icon class
- $icon.addClass(self.options.class_remove);
- } else {
- // remove
- self.app.collection.remove(model_index);
-
- // add new icon class
- $icon.addClass(self.options.class_add);
- }
+ // add new icon class
+ $icon.addClass(self.options.class_remove);
+ } else {
+ // remove
+ self.app.collection.remove(model_index);
+
+ // add new icon class
+ $icon.addClass(self.options.class_add);
+ }
});
// click to add ftp files
- $it.on('click', function() {
- //trigger my new event
- $icon.trigger('addToUpBox');
+ $it.on('click', function() {
+ //trigger my new event
+ $icon.trigger('addToUpBox');
- // click to add ftp files
- // modify selectAll box based on number of checkboxes checked
- var selectBox=$icon.parents().find('#selectAll');
- // determine and set state of selectAll after sub-checkbox clicked
- self._updateSelectAll(selectBox);
- });
- },
+ // click to add ftp files
+ // modify selectAll box based on number of checkboxes checked
+ var selectBox=$icon.parents().find('#selectAll');
+ // determine and set state of selectAll after sub-checkbox clicked
+ self._updateSelectAll(selectBox);
+ });
+ },
- _updateSelectAll: function(selectBox){
- // array of all checkboxes
- var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
- // array of only checked checkboxes
- var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
- var lenAll = checkboxes.length;
- var lenChecked = checkedCheckboxes.length;
+ _updateSelectAll: function(selectBox){
+ // array of all checkboxes
+ var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
+ // array of only checked checkboxes
+ var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
+ var lenAll = checkboxes.length;
+ var lenChecked = checkedCheckboxes.length;
- // determine which state the selectAll checkbox needs to be and setting it
- if(lenChecked > 0 && lenChecked !== lenAll){
- // indeterminate state
- selectBox.removeClass('fa-square-o fa-check-square-o');
- selectBox.addClass('fa-minus-square-o');
- }
- else if(lenChecked === lenAll){
- // checked state
- selectBox.removeClass('fa-square-o fa-minus-square-o');
- selectBox.addClass('fa-check-square-o');
- }
- else if(lenChecked === 0){
- // unchecked state
- selectBox.removeClass('fa-check-square-o fa-minus-square-o');
- selectBox.addClass('fa-square-o');
- }
- },
+ // determine which state the selectAll checkbox needs to be and setting it
+ if(lenChecked > 0 && lenChecked !== lenAll){
+ // indeterminate state
+ selectBox.removeClass('fa-square-o fa-check-square-o');
+ selectBox.addClass('fa-minus-square-o');
+ }
+ else if(lenChecked === lenAll){
+ // checked state
+ selectBox.removeClass('fa-square-o fa-minus-square-o');
+ selectBox.addClass('fa-check-square-o');
+ }
+ else if(lenChecked === 0){
+ // unchecked state
+ selectBox.removeClass('fa-check-square-o fa-minus-square-o');
+ selectBox.addClass('fa-square-o');
+ }
+ },
-
+
// get model index
_find: function(ftp_file) {
// check if exists already
https://bitbucket.org/galaxy/galaxy-central/commits/a0c0e0b6188c/
Changeset: a0c0e0b6188c
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 20:56:46+00:00
Summary: complete selectAll tab fixes2
Affected #: 1 file
diff -r 7be57e7174228c8300fc76d1514f25f7408bf32a -r a0c0e0b6188c5144564175a664c66c2f66915d17 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -78,8 +78,8 @@
// change state of the sub-checkboxes
for(i = 0; i < len; i++){
- if(allChecked)
- {
+ if(allChecked)
+ {
// all checkboxes should be checked
if(checkboxes.eq(i).hasClass('fa-square-o'))
{
@@ -97,7 +97,7 @@
}
}
return;
- } );
+ });
} else {
// add info
@@ -134,24 +134,24 @@
$icon.addClass(icon_class);
$it.on('addToUpBox', function(){
-// find model
-var model_index = self._find(ftp_file);
+ // find model
+ var model_index = self._find(ftp_file);
// update icon
$icon.removeClass();
// add model
if (!model_index) {
- // add to uploadbox
- self.app.uploadbox.add([{
- mode : 'ftp',
- name : ftp_file.path,
- size : ftp_file.size,
- path : ftp_file.path
- }]);
+ // add to uploadbox
+ self.app.uploadbox.add([{
+ mode : 'ftp',
+ name : ftp_file.path,
+ size : ftp_file.size,
+ path : ftp_file.path
+ }]);
- // add new icon class
- $icon.addClass(self.options.class_remove);
+ // add new icon class
+ $icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
https://bitbucket.org/galaxy/galaxy-central/commits/fe8d22502cde/
Changeset: fe8d22502cde
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 20:59:58+00:00
Summary: complete selectAll tab fixes2
Affected #: 1 file
diff -r a0c0e0b6188c5144564175a664c66c2f66915d17 -r fe8d22502cde12470b14597669d350b94046c579 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -63,18 +63,18 @@
$this = $(this);
// change state of the selectAll checkbox
- if($this.hasClass('fa-square-o')){
- // in unchecked, change to checked
+ if($this.hasClass('fa-check-square-o')){
+ $this.removeClass('fa-check-square-o fa-minus-square-o');
+ $this.addClass('fa-square-o');
+ allChecked=false;
+
+ }
+ else{
+ // in unchecked, change to checked
$this.removeClass('fa-square-o fa-minus-square-o');
$this.addClass('fa-check-square-o');
allChecked=true;
}
- else{
- // if checked, change to unchecked
- $this.removeClass('fa-check-square-o fa-minus-square-o');
- $this.addClass('fa-square-o');
- allChecked=false;
- }
// change state of the sub-checkboxes
for(i = 0; i < len; i++){
https://bitbucket.org/galaxy/galaxy-central/commits/e43cffbd226d/
Changeset: e43cffbd226d
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-14 21:10:38+00:00
Summary: complete selectAll indeter to checked
Affected #: 1 file
diff -r fe8d22502cde12470b14597669d350b94046c579 -r e43cffbd226d85ef0565a6b513f583d3fdf21957 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -56,41 +56,36 @@
this._updateSelectAll(selectAll);
// selectAll checkbox has been clicked
- selectAll.on('click', function(){
+ selectAll.on('click', function() {
var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
var len = checkboxes.length;
var allChecked;
$this = $(this);
// change state of the selectAll checkbox
- if($this.hasClass('fa-check-square-o')){
- $this.removeClass('fa-check-square-o fa-minus-square-o');
+ if($this.hasClass('fa-check-square-o')) {
+ // if checked change to unchecked
+ $this.removeClass('fa-check-square-o');
$this.addClass('fa-square-o');
allChecked=false;
-
- }
- else{
- // in unchecked, change to checked
+ } else {
+ // if checked or partially checked, change to checked
$this.removeClass('fa-square-o fa-minus-square-o');
$this.addClass('fa-check-square-o');
allChecked=true;
}
// change state of the sub-checkboxes
- for(i = 0; i < len; i++){
- if(allChecked)
- {
+ for(i = 0; i < len; i++) {
+ if(allChecked) {
// all checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-square-o'))
- {
+ if(checkboxes.eq(i).hasClass('fa-square-o')) {
// if they are not checked, check them
checkboxes.eq(i).trigger('addToUpBox');
}
- }
- else{
+ } else {
// no checkboxes should be checked
- if(checkboxes.eq(i).hasClass('fa-check-square-o'))
- {
+ if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
// if they are checked, uncheck them
checkboxes.eq(i).trigger('addToUpBox');
}
@@ -133,9 +128,9 @@
// add icon class
$icon.addClass(icon_class);
- $it.on('addToUpBox', function(){
- // find model
- var model_index = self._find(ftp_file);
+ $it.on('addToUpBox', function() {
+ // find model
+ var model_index = self._find(ftp_file);
// update icon
$icon.removeClass();
@@ -174,7 +169,7 @@
});
},
- _updateSelectAll: function(selectBox){
+ _updateSelectAll: function(selectBox) {
// array of all checkboxes
var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
// array of only checked checkboxes
@@ -183,17 +178,15 @@
var lenChecked = checkedCheckboxes.length;
// determine which state the selectAll checkbox needs to be and setting it
- if(lenChecked > 0 && lenChecked !== lenAll){
+ if(lenChecked > 0 && lenChecked !== lenAll) {
// indeterminate state
selectBox.removeClass('fa-square-o fa-check-square-o');
selectBox.addClass('fa-minus-square-o');
- }
- else if(lenChecked === lenAll){
+ } else if(lenChecked === lenAll) {
// checked state
selectBox.removeClass('fa-square-o fa-minus-square-o');
selectBox.addClass('fa-check-square-o');
- }
- else if(lenChecked === 0){
+ } else if(lenChecked === 0) {
// unchecked state
selectBox.removeClass('fa-check-square-o fa-minus-square-o');
selectBox.addClass('fa-square-o');
https://bitbucket.org/galaxy/galaxy-central/commits/599ebe1f1ea4/
Changeset: 599ebe1f1ea4
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-15 13:35:52+00:00
Summary: remove non changes and use _updateSelectAll
Affected #: 1 file
diff -r e43cffbd226d85ef0565a6b513f583d3fdf21957 -r 599ebe1f1ea49845e139fc6b0124416e5b95d0ad static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -35,6 +35,7 @@
// fill table
_fill: function(ftp_files) {
+ var self = this;
if (ftp_files && ftp_files.length > 0) {
// add table
this.$el.find('#upload-ftp-content').html($(this._templateTable()));
@@ -59,21 +60,23 @@
selectAll.on('click', function() {
var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
var len = checkboxes.length;
- var allChecked;
$this = $(this);
+ var allChecked = !($this.hasClass('fa-check-square-o'));
+
+
// change state of the selectAll checkbox
- if($this.hasClass('fa-check-square-o')) {
- // if checked change to unchecked
- $this.removeClass('fa-check-square-o');
- $this.addClass('fa-square-o');
- allChecked=false;
- } else {
- // if checked or partially checked, change to checked
- $this.removeClass('fa-square-o fa-minus-square-o');
- $this.addClass('fa-check-square-o');
- allChecked=true;
- }
+ // if($this.hasClass('fa-check-square-o')) {
+ // // if checked change to unchecked
+ // $this.removeClass('fa-check-square-o');
+ // $this.addClass('fa-square-o');
+ // allChecked=false;
+ // } else {
+ // // if checked or partially checked, change to checked
+ // $this.removeClass('fa-square-o fa-minus-square-o');
+ // $this.addClass('fa-check-square-o');
+ // allChecked=true;
+ // }
// change state of the sub-checkboxes
for(i = 0; i < len; i++) {
@@ -91,6 +94,7 @@
}
}
}
+ self._updateSelectAll(selectAll);
return;
});
@@ -212,7 +216,7 @@
// template row
_templateRow: function(options) {
return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
- '<td><div class="icon " /></td>' +
+ '<td><div class="icon" /></td>' +
'<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
'<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
'<td style="white-space: nowrap;">' + options.ctime + '</td>' +
@@ -253,9 +257,7 @@
return '<div class="upload-ftp">' +
'<div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/>' +
'<div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>' + this.app.options.ftp_upload_site + '</strong> using your Galaxy credentials (email address and password).</div>' +
- '<div id="upload-ftp-content">'
-
- '</div>' +
+ '<div id="upload-ftp-content"></div>' +
'<div>';
}
https://bitbucket.org/galaxy/galaxy-central/commits/4ef51dde1d05/
Changeset: 4ef51dde1d05
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-15 13:37:40+00:00
Summary: remove non changes and use _updateSelectAll2
Affected #: 1 file
diff -r 599ebe1f1ea49845e139fc6b0124416e5b95d0ad -r 4ef51dde1d050ca04999343699db84340e9dde22 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -102,7 +102,6 @@
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
-
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
},
@@ -128,17 +127,14 @@
} else {
icon_class = this.options.class_add;
}
-
// add icon class
$icon.addClass(icon_class);
$it.on('addToUpBox', function() {
// find model
var model_index = self._find(ftp_file);
-
// update icon
$icon.removeClass();
-
// add model
if (!model_index) {
// add to uploadbox
@@ -148,13 +144,11 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
// add new icon class
$icon.addClass(self.options.class_add);
}
@@ -216,7 +210,7 @@
// template row
_templateRow: function(options) {
return '<tr class="upload-ftp-row" style="cursor: pointer;">' +
- '<td><div class="icon" /></td>' +
+ '<td><div class="icon"/></td>' +
'<td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">' + options.path + '</p></td>' +
'<td style="white-space: nowrap;">' + Utils.bytesToString(options.size) + '</td>' +
'<td style="white-space: nowrap;">' + options.ctime + '</td>' +
https://bitbucket.org/galaxy/galaxy-central/commits/8a6305f20e33/
Changeset: 8a6305f20e33
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-15 13:41:26+00:00
Summary: remove non changes and use _updateSelectAll3
Affected #: 1 file
diff -r 4ef51dde1d050ca04999343699db84340e9dde22 -r 8a6305f20e3328aa9db245d58d59a7ab448ee28a static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -102,6 +102,7 @@
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
+
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
},
@@ -127,14 +128,17 @@
} else {
icon_class = this.options.class_add;
}
+
// add icon class
$icon.addClass(icon_class);
$it.on('addToUpBox', function() {
// find model
var model_index = self._find(ftp_file);
+
// update icon
$icon.removeClass();
+
// add model
if (!model_index) {
// add to uploadbox
@@ -144,11 +148,13 @@
size : ftp_file.size,
path : ftp_file.path
}]);
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
+
// add new icon class
$icon.addClass(self.options.class_add);
}
https://bitbucket.org/galaxy/galaxy-central/commits/53bb9c3c16a0/
Changeset: 53bb9c3c16a0
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-15 13:44:15+00:00
Summary: remove non changes and use _updateSelectAll4
Affected #: 1 file
diff -r 8a6305f20e3328aa9db245d58d59a7ab448ee28a -r 53bb9c3c16a04a64984803e2fef125ba1d9319db static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -62,21 +62,6 @@
var len = checkboxes.length;
$this = $(this);
var allChecked = !($this.hasClass('fa-check-square-o'));
-
-
-
- // change state of the selectAll checkbox
- // if($this.hasClass('fa-check-square-o')) {
- // // if checked change to unchecked
- // $this.removeClass('fa-check-square-o');
- // $this.addClass('fa-square-o');
- // allChecked=false;
- // } else {
- // // if checked or partially checked, change to checked
- // $this.removeClass('fa-square-o fa-minus-square-o');
- // $this.addClass('fa-check-square-o');
- // allChecked=true;
- // }
// change state of the sub-checkboxes
for(i = 0; i < len; i++) {
@@ -94,8 +79,8 @@
}
}
}
+
self._updateSelectAll(selectAll);
- return;
});
} else {
https://bitbucket.org/galaxy/galaxy-central/commits/af54fe317fba/
Changeset: af54fe317fba
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-15 15:44:03+00:00
Summary: adding packed file
Affected #: 1 file
diff -r 53bb9c3c16a04a64984803e2fef125ba1d9319db -r af54fe317fbab0336a549ece5909a5f17eb42cb7 static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,2 @@
-define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)},error:function(){b._fill()}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c&&c.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("click",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
+// dependencies
+define(["utils/utils"],function(e){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(t){this.app=t;var n=this;this.setElement(this._template()),e.get({url:galaxy_config.root+"api/ftp_files",success:function(e){n._fill(e)},error:function(){n._fill()}})},events:{mousedown:function(e){e.preventDefault()}},_fill:function(t){var n=this;if(t&&t.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var r=0;for(key in t)this.add(t[key]),r+=t[key].size;this.$el.find("#upload-ftp-number").html(t.length+" files"),this.$el.find("#upload-ftp-disk").html(e.bytesToString(r,!0));var s=this.$el.find("#selectAll");this._updateSelectAll(s),s.on("click",function(){var e=$(this).parents().find("tr.upload-ftp-row>td>div"),t=e.length;$this=$(this);var r=!$this.hasClass("fa-check-square-o");for(i=0;i<t;i++)r?e.eq(i).hasClass("fa-square-o")&&e.eq(i).trigger("addToUpBox"):e.eq(i).hasClass("fa-check-square-o")&&e.eq(i).trigger("addToUpBox");n._updateSelectAll(s)})}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},add:function(e){var t=this,n=$(this._templateRow(e)),r=n.find(".icon");$(this.el).find("tbody").append(n);var i="";this._find(e)?i=this.options.class_remove:i=this.options.class_add,r.addClass(i),n.on("addToUpBox",function(){var n=t._find(e);r.removeClass(),n?(t.app.collection.remove(n),r.addClass(t.options.class_add)):(t.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]),r.addClass(t.options.class_remove))}),n.on("click",function(){r.trigger("addToUpBox");var e=r.parents().find("#selectAll");t._updateSelectAll(e)})},_updateSelectAll:function(e){var t=e.parents().find("tr.upload-ftp-row>td>div"),n=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o"),r=t.length,i=n.length;i>0&&i!==r?(e.removeClass("fa-square-o fa-check-square-o"),e.addClass("fa-minus-square-o")):i===r?(e.removeClass("fa-square-o fa-minus-square-o"),e.addClass("fa-check-square-o")):i===0&&(e.removeClass("fa-check-square-o fa-minus-square-o"),e.addClass("fa-square-o"))},_find:function(e){var t=this.app.collection.where({file_path:e.path}),n=null;for(var r in t){var i=t[r];i.get("status")=="init"&&i.get("file_mode")=="ftp"&&(n=i.get("id"))}return n},_templateRow:function(t){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+t.path+"</p></td>"+'<td style="white-space: nowrap;">'+e.bytesToString(t.size)+"</td>"+'<td style="white-space: nowrap;">'+t.ctime+"</td>"+"</tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+"</strong> using your Galaxy credentials (email address and password).</div>"+'<div id="upload-ftp-content"></div>'+"<div>"}})});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/c37851171ccd/
Changeset: c37851171ccd
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-16 21:23:05+00:00
Summary: Type drop-down for all files
Affected #: 3 files
diff -r af54fe317fbab0336a549ece5909a5f17eb42cb7 -r c37851171ccd8656657ea77de388b853baf8946e static/scripts/mvc/upload/upload-model.js
--- a/static/scripts/mvc/upload/upload-model.js
+++ b/static/scripts/mvc/upload/upload-model.js
@@ -14,6 +14,7 @@
file_type : null,
file_path : '',
percentage : 0,
+ row : null,
// settings
space_to_tabs : false,
diff -r af54fe317fbab0336a549ece5909a5f17eb42cb7 -r c37851171ccd8656657ea77de388b853baf8946e static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -83,7 +83,7 @@
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.model.get('extension')
+ value: self.app.select_extension.value()
});
// initialize extension
@@ -139,6 +139,7 @@
this.app.collection.on('reset', function() {
self.remove();
});
+ self.model.set('row', self);
},
// render
diff -r af54fe317fbab0336a549ece5909a5f17eb42cb7 -r c37851171ccd8656657ea77de388b853baf8946e static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -6,6 +6,7 @@
"mvc/upload/upload-ftp",
"mvc/ui/ui-popover",
"mvc/ui/ui-modal",
+ "mvc/ui/ui-select",
"utils/uploadbox"],
function( Utils,
@@ -14,7 +15,8 @@
UploadItem,
UploadFtp,
Popover,
- Modal
+ Modal,
+ Select
) {
// galaxy upload
@@ -35,6 +37,9 @@
// current history
current_history: null,
+
+ // extension selector
+ select_extension : null,
// current upload size
upload_size: 0,
@@ -218,6 +223,23 @@
title : 'FTP files',
container : button
});
+
+ // select extension
+ this.select_extension = new Select.View({
+ css: 'extension',
+ onchange : function() {
+ var newExten =self.select_extension.value()
+ var len = self.collection.models.length;
+ for(i = 0; i < len; i++)
+ {
+ self.collection.models[i].attributes['row'].select_extension.value(newExten);
+ }
+ },
+ data: self.list_extensions,
+ container: self.$el.find('#extension'),
+ value: self.list_extensions[0]
+ });
+
}
// show modal
@@ -228,6 +250,66 @@
// setup info
this._updateScreen();
+
+ // handle extension info popover
+ self.$el.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
+ .on('mousedown', function(e) { e.preventDefault(); });
+
+ },
+
+ _showExtensionInfo : function() {
+ // initialize
+ var self = this;
+ var $el = $(this.el).find('#extension-info');
+ var extension = self.select_extension.value();
+
+ var title = this.select_extension.text();
+
+ var description = _.findWhere(self.list_extensions, {'id': extension});
+ //console.log(extension, $el);
+
+ // create popup
+ if (!this.extension_popup) {
+ this.extension_popup = new Popover.View({
+ placement: 'bottom',
+ container: $el
+ });
+ }
+ //console.log(description);
+ // 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();
+ }
+ },
+
+ _showSettings : function() {
+ // check if popover is visible
+ if (!this.settings.visible) {
+ // show popover
+ this.settings.empty();
+ this.settings.append((new UploadSettings(this)).$el);
+ this.settings.show();
+ } else {
+ // hide popover
+ this.settings.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.';
+ }
},
//
@@ -513,6 +595,9 @@
// remove from queue
this.uploadbox.reset();
+
+ // reset value for universal type drop-down
+ this.select_extension.value(this.list_extensions[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -612,7 +697,10 @@
'<tr>' +
'<th>Name</th>' +
'<th>Size</th>' +
- '<th>Type</th>' +
+ '<th>Type' +
+ '<div id="extension" class="extension" style="float: left;"/>  ' +
+ '<div id="extension-info" class="upload-icon-button fa fa-search"/>' +
+ '</th>' +
'<th>Genome</th>' +
'<th>Settings</th>' +
'<th>Status</th>' +
https://bitbucket.org/galaxy/galaxy-central/commits/b7729c84ae07/
Changeset: b7729c84ae07
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-20 17:36:08+00:00
Summary: UI changes - added global file format selector
Affected #: 3 files
diff -r c37851171ccd8656657ea77de388b853baf8946e -r b7729c84ae071644c45d3c32bdfd4dfeb8b1914e static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -80,6 +80,13 @@
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'),
diff -r c37851171ccd8656657ea77de388b853baf8946e -r b7729c84ae071644c45d3c32bdfd4dfeb8b1914e static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -129,6 +129,14 @@
self.list_extensions.sort(function(a, b) {
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) {
@@ -230,16 +238,22 @@
onchange : function() {
var newExten =self.select_extension.value()
var len = self.collection.models.length;
- for(i = 0; i < len; i++)
- {
- self.collection.models[i].attributes['row'].select_extension.value(newExten);
+ // 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.find('#extension'),
+ container: self.$el.parents().find('#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(); });
}
// show modal
@@ -251,22 +265,17 @@
// setup info
this._updateScreen();
- // handle extension info popover
- self.$el.find('#extension-info').on('click' , function(e) { self._showExtensionInfo(); })
- .on('mousedown', function(e) { e.preventDefault(); });
-
},
_showExtensionInfo : function() {
// initialize
var self = this;
- var $el = $(this.el).find('#extension-info');
+ var $el = $(this.el).parents().find('#extension-info_out');
var extension = self.select_extension.value();
var title = this.select_extension.text();
var description = _.findWhere(self.list_extensions, {'id': extension});
- //console.log(extension, $el);
// create popup
if (!this.extension_popup) {
@@ -275,7 +284,7 @@
container: $el
});
}
- //console.log(description);
+
// show / hide popup
if (!this.extension_popup.visible) {
this.extension_popup.title(title);
@@ -691,26 +700,36 @@
// load html template
_template: function(id, idInfo) {
- return '<div id="' + id + '" class="upload-box">' +
- '<table id="upload-table" class="table table-striped" style="display: none;">' +
- '<thead>' +
- '<tr>' +
- '<th>Name</th>' +
- '<th>Size</th>' +
- '<th>Type' +
- '<div id="extension" class="extension" style="float: left;"/>  ' +
- '<div id="extension-info" class="upload-icon-button fa fa-search"/>' +
- '</th>' +
- '<th>Genome</th>' +
- '<th>Settings</th>' +
- '<th>Status</th>' +
- '<th></th>' +
- '</tr>' +
- '</thead>' +
- '<tbody></tbody>' +
- '</table>' +
- '</div>' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>';
+ return '<div class="uploadwrap">' +
+ '<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 class="uploadcont">' +
+ '<div class="uploadcont-wrap">' +
+ '<div id="' + id + '" 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>' +
+ '</div>' +
+ '<div class="uploadfoot">' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
+ '</div>' +
+ '</div>';
}
});
diff -r c37851171ccd8656657ea77de388b853baf8946e -r b7729c84ae071644c45d3c32bdfd4dfeb8b1914e static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -119,6 +119,15 @@
.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}
+.uploadwrap {display: table; height: 100%; width: 100%;}
+.uploadcont{display: table-row; height: 100%;}
+.uploadcont-wrap{height: 100%; overflow: auto;}
+.uploadfoot{display: table-row; text-align:center;}
+.uploadhead{display: table-row; float:left; text-align:left; max-height:20px; line-height:18px; margin-bottom: 5px;}
+.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}
@@ -1370,7 +1379,7 @@
.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: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:100%;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}
https://bitbucket.org/galaxy/galaxy-central/commits/b995da1e4740/
Changeset: b995da1e4740
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-20 17:46:34+00:00
Summary: UI changes - added global file format selector - fixed code spacing
Affected #: 2 files
diff -r b7729c84ae071644c45d3c32bdfd4dfeb8b1914e -r b995da1e4740a55aafdba8fa67987ba52aacdbba static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -82,7 +82,6 @@
self._updateSelectAll(selectAll);
});
-
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
@@ -117,6 +116,7 @@
// add icon class
$icon.addClass(icon_class);
+ // add files to the uploadbox
$it.on('addToUpBox', function() {
// find model
var model_index = self._find(ftp_file);
@@ -182,8 +182,6 @@
}
},
-
-
// get model index
_find: function(ftp_file) {
// check if exists already
diff -r b7729c84ae071644c45d3c32bdfd4dfeb8b1914e -r b995da1e4740a55aafdba8fa67987ba52aacdbba static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -124,7 +124,7 @@
description_url : datatypes[key].description_url
});
}
-
+
// sort
self.list_extensions.sort(function(a, b) {
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
@@ -264,7 +264,6 @@
// setup info
this._updateScreen();
-
},
_showExtensionInfo : function() {
https://bitbucket.org/galaxy/galaxy-central/commits/4019ee6c42c1/
Changeset: 4019ee6c42c1
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-20 20:20:01+00:00
Summary: UI changes - added global file format selector - fixed error on adding another file after ---
Affected #: 1 file
diff -r b995da1e4740a55aafdba8fa67987ba52aacdbba -r 4019ee6c42c1bc97e1ee493fdfe9c5ff31de96d9 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -42,6 +42,9 @@
// link app
this.app = app;
+ // default value for extension of files
+ var default_ext = 'Auto-detect';
+
// link this
var self = this;
@@ -75,6 +78,12 @@
// initialize genome
this.model.set('genome', self.select_genome.value());
+ // 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();
+ }
+
// select extension
this.select_extension = new Select.View({
css: 'extension',
@@ -90,7 +99,7 @@
},
data: self.app.list_extensions,
container: it.find('#extension'),
- value: self.app.select_extension.value()
+ value: self.default_ext
});
// initialize extension
https://bitbucket.org/galaxy/galaxy-central/commits/126f96bd87a3/
Changeset: 126f96bd87a3
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-20 20:40:55+00:00
Summary: UI changes - added global file format selector - fixed text spacing
Affected #: 2 files
diff -r 4019ee6c42c1bc97e1ee493fdfe9c5ff31de96d9 -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -80,8 +80,8 @@
// 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();
+ if(!(this.app.select_extension.value() === '---')){
+ this.default_ext = this.app.select_extension.value();
}
// select extension
@@ -91,7 +91,7 @@
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()))
+ if(!(self.select_extension.value() === app.select_extension.value()))
{
var newExte = '---';
app.select_extension.value(newExte);
diff -r 4019ee6c42c1bc97e1ee493fdfe9c5ff31de96d9 -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -236,11 +236,11 @@
this.select_extension = new Select.View({
css: 'extension',
onchange : function() {
- var newExten =self.select_extension.value()
+ 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=='---')){
+ if(!(newExten === '---')){
for(i = 0; i < len; i++){
self.collection.models[i].attributes['row'].select_extension.value(newExten);
}
https://bitbucket.org/galaxy/galaxy-central/commits/fdb6215d8c09/
Changeset: fdb6215d8c09
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-23 14:19:25+00:00
Summary: adding packed files and changing fcn name for addToUpBox to updateUpBox
Affected #: 5 files
diff -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 -r fdb6215d8c090154aa6f9d0719d281cdb8526848 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -69,13 +69,13 @@
// all checkboxes should be checked
if(checkboxes.eq(i).hasClass('fa-square-o')) {
// if they are not checked, check them
- checkboxes.eq(i).trigger('addToUpBox');
+ checkboxes.eq(i).trigger('updateUpBox');
}
} else {
// no checkboxes should be checked
if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
// if they are checked, uncheck them
- checkboxes.eq(i).trigger('addToUpBox');
+ checkboxes.eq(i).trigger('updateUpBox');
}
}
}
@@ -117,7 +117,7 @@
$icon.addClass(icon_class);
// add files to the uploadbox
- $it.on('addToUpBox', function() {
+ $it.on('updateUpBox', function() {
// find model
var model_index = self._find(ftp_file);
@@ -148,7 +148,7 @@
// click to add ftp files
$it.on('click', function() {
//trigger my new event
- $icon.trigger('addToUpBox');
+ $icon.trigger('updateUpBox');
// click to add ftp files
// modify selectAll box based on number of checkboxes checked
diff -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 -r fdb6215d8c090154aa6f9d0719d281cdb8526848 static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,2 +1,1 @@
-// dependencies
-define(["utils/utils"],function(e){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(t){this.app=t;var n=this;this.setElement(this._template()),e.get({url:galaxy_config.root+"api/ftp_files",success:function(e){n._fill(e)},error:function(){n._fill()}})},events:{mousedown:function(e){e.preventDefault()}},_fill:function(t){var n=this;if(t&&t.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var r=0;for(key in t)this.add(t[key]),r+=t[key].size;this.$el.find("#upload-ftp-number").html(t.length+" files"),this.$el.find("#upload-ftp-disk").html(e.bytesToString(r,!0));var s=this.$el.find("#selectAll");this._updateSelectAll(s),s.on("click",function(){var e=$(this).parents().find("tr.upload-ftp-row>td>div"),t=e.length;$this=$(this);var r=!$this.hasClass("fa-check-square-o");for(i=0;i<t;i++)r?e.eq(i).hasClass("fa-square-o")&&e.eq(i).trigger("addToUpBox"):e.eq(i).hasClass("fa-check-square-o")&&e.eq(i).trigger("addToUpBox");n._updateSelectAll(s)})}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},add:function(e){var t=this,n=$(this._templateRow(e)),r=n.find(".icon");$(this.el).find("tbody").append(n);var i="";this._find(e)?i=this.options.class_remove:i=this.options.class_add,r.addClass(i),n.on("addToUpBox",function(){var n=t._find(e);r.removeClass(),n?(t.app.collection.remove(n),r.addClass(t.options.class_add)):(t.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]),r.addClass(t.options.class_remove))}),n.on("click",function(){r.trigger("addToUpBox");var e=r.parents().find("#selectAll");t._updateSelectAll(e)})},_updateSelectAll:function(e){var t=e.parents().find("tr.upload-ftp-row>td>div"),n=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o"),r=t.length,i=n.length;i>0&&i!==r?(e.removeClass("fa-square-o fa-check-square-o"),e.addClass("fa-minus-square-o")):i===r?(e.removeClass("fa-square-o fa-minus-square-o"),e.addClass("fa-check-square-o")):i===0&&(e.removeClass("fa-check-square-o fa-minus-square-o"),e.addClass("fa-square-o"))},_find:function(e){var t=this.app.collection.where({file_path:e.path}),n=null;for(var r in t){var i=t[r];i.get("status")=="init"&&i.get("file_mode")=="ftp"&&(n=i.get("id"))}return n},_templateRow:function(t){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+t.path+"</p></td>"+'<td style="white-space: nowrap;">'+e.bytesToString(t.size)+"</td>"+'<td style="white-space: nowrap;">'+t.ctime+"</td>"+"</tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+"</strong> using your Galaxy credentials (email address and password).</div>"+'<div id="upload-ftp-content"></div>'+"<div>"}})});
\ No newline at end of file
+define(["utils/utils"],function(e){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(t){this.app=t;var n=this;this.setElement(this._template()),e.get({url:galaxy_config.root+"api/ftp_files",success:function(e){n._fill(e)},error:function(){n._fill()}})},events:{mousedown:function(e){e.preventDefault()}},_fill:function(t){var n=this;if(t&&t.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var r=0;for(key in t)this.add(t[key]),r+=t[key].size;this.$el.find("#upload-ftp-number").html(t.length+" files"),this.$el.find("#upload-ftp-disk").html(e.bytesToString(r,!0));var s=this.$el.find("#selectAll");this._updateSelectAll(s),s.on("click",function(){var e=$(this).parents().find("tr.upload-ftp-row>td>div"),t=e.length;$this=$(this);var r=!$this.hasClass("fa-check-square-o");for(i=0;i<t;i++)r?e.eq(i).hasClass("fa-square-o")&&e.eq(i).trigger("updateUpBox"):e.eq(i).hasClass("fa-check-square-o")&&e.eq(i).trigger("updateUpBox");n._updateSelectAll(s)})}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},add:function(e){var t=this,n=$(this._templateRow(e)),r=n.find(".icon");$(this.el).find("tbody").append(n);var i="";this._find(e)?i=this.options.class_remove:i=this.options.class_add,r.addClass(i),n.on("updateUpBox",function(){var n=t._find(e);r.removeClass(),n?(t.app.collection.remove(n),r.addClass(t.options.class_add)):(t.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]),r.addClass(t.options.class_remove))}),n.on("click",function(){r.trigger("updateUpBox");var e=r.parents().find("#selectAll");t._updateSelectAll(e)})},_updateSelectAll:function(e){var t=e.parents().find("tr.upload-ftp-row>td>div"),n=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o"),r=t.length,i=n.length;i>0&&i!==r?(e.removeClass("fa-square-o fa-check-square-o"),e.addClass("fa-minus-square-o")):i===r?(e.removeClass("fa-square-o fa-minus-square-o"),e.addClass("fa-check-square-o")):i===0&&(e.removeClass("fa-check-square-o fa-minus-square-o"),e.addClass("fa-square-o"))},_find:function(e){var t=this.app.collection.where({file_path:e.path}),n=null;for(var r in t){var i=t[r];i.get("status")=="init"&&i.get("file_mode")=="ftp"&&(n=i.get("id"))}return n},_templateRow:function(t){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+t.path+"</p></td>"+'<td style="white-space: nowrap;">'+e.bytesToString(t.size)+"</td>"+'<td style="white-space: nowrap;">'+t.ctime+"</td>"+"</tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+"</strong> using your Galaxy credentials (email address and password).</div>"+'<div id="upload-ftp-content"></div>'+"<div>"}})});
\ No newline at end of file
diff -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 -r fdb6215d8c090154aa6f9d0719d281cdb8526848 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,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 e=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:!1,to_posix_lines:!0}}),t=Backbone.Collection.extend({model:e});return{Model:e,Collection:t}});
\ No newline at end of file
diff -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 -r fdb6215d8c090154aa6f9d0719d281cdb8526848 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(i,g){this.app=i;var f=this;this.model=new b.Model(g);this.setElement(this._template(g));var h=this.$el;this.settings=new c.View({title:"Upload configuration",container:h.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:h.find("#genome"),value:f.model.get("genome")});this.model.set("genome",f.select_genome.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:h.find("#extension"),value:f.model.get("extension")});this.model.set("extension",f.select_extension.value());h.find("#symbol").on("click",function(){f._removeRow()});h.find("#extension-info").on("click",function(j){f._showExtensionInfo()}).on("mousedown",function(j){j.preventDefault()});h.find("#settings").on("click",function(j){f._showSettings()}).on("mousedown",function(j){j.preventDefault()});h.find("#text-content").on("keyup",function(j){f.model.set("url_paste",$(j.target).val());f.model.set("file_size",$(j.target).val().length)});h.find("#space_to_tabs").on("change",function(j){f.model.set("space_to_tabs",$(j.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()})},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(e,t,n,r,i){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(e,n){this.app=e;var s="Auto-detect",o=this;this.model=new t.Model(n),this.setElement(this._template(n));var u=this.$el;this.settings=new r.View({title:"Upload configuration",container:u.find("#settings"),placement:"bottom"}),this.select_genome=new i.View({css:"genome",onchange:function(){o.model.set("genome",o.select_genome.value())},data:o.app.list_genomes,container:u.find("#genome"),value:o.model.get("genome")}),this.model.set("genome",o.select_genome.value()),this.app.select_extension.value()!=="---"&&(this.default_ext=this.app.select_extension.value()),this.select_extension=new i.View({css:"extension",onchange:function(){o.model.set("extension",o.select_extension.value());if(o.select_extension.value()!==e.select_extension.value()){var t="---";e.select_extension.value(t)}},data:o.app.list_extensions,container:u.find("#extension"),value:o.default_ext}),this.model.set("extension",o.select_extension.value()),u.find("#symbol").on("click",function(){o._removeRow()}),u.find("#extension-info").on("click",function(e){o._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()}),u.find("#settings").on("click",function(e){o._showSettings()}).on("mousedown",function(e){e.preventDefault()}),u.find("#text-content").on("keyup",function(e){o.model.set("url_paste",$(e.target).val()),o.model.set("file_size",$(e.target).val().length)}),u.find("#space_to_tabs").on("change",function(e){o.model.set("space_to_tabs",$(e.target).prop("checked"))}),this.model.on("change:percentage",function(){o._refreshPercentage()}),this.model.on("change:status",function(){o._refreshStatus()}),this.model.on("change:info",function(){o._refreshInfo()}),this.model.on("change:genome",function(){o._refreshGenome()}),this.model.on("change:file_size",function(){o._refreshFileSize()}),this.model.on("remove",function(){o.remove()}),this.app.collection.on("reset",function(){o.remove()}),o.model.set("row",o)},render:function(){var t=this.model.get("file_name"),n=this.model.get("file_size"),r=this.model.get("file_mode"),i=this.$el;i.find("#title").html(t),i.find("#size").html(e.bytesToString(n)),i.find("#mode").removeClass().addClass("mode");if(r=="new"){var s=i.find("#text"),o=this.options.padding,u=i.width()-2*o,a=i.height()-o;s.css("width",u+"px"),s.css("top",a+"px"),i.height(a+s.height()+2*o),s.show(),i.find("#mode").addClass("fa fa-pencil")}r=="local"&&i.find("#mode").addClass("fa fa-laptop"),r=="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 e=this.model.get("genome");this.select_genome.value(e)},_refreshInfo:function(){var e=this.model.get("info");e?this.$el.find("#info").html("<strong>Failed: </strong>"+e).show():this.$el.find("#info").hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:e+"%"}),e!=100?this.$el.find("#percentage").html(e+"%"):this.$el.find("#percentage").html("Adding to history...")},_refreshStatus:function(){var e=this.$el,t=this.model.get("status"),n=this.status_classes[t],r=this.$el.find("#symbol");r.removeClass(),r.addClass(n),t=="init"?(this.select_genome.enable(),this.select_extension.enable(),e.find("#text-content").attr("disabled",!1),e.find("#space_to_tabs").attr("disabled",!1)):(this.select_genome.disable(),this.select_extension.disable(),e.find("#text-content").attr("disabled",!0),e.find("#space_to_tabs").attr("disabled",!0)),t=="success"&&(e.addClass("success"),e.find("#percentage").html("100%")),t=="error"&&(e.addClass("danger"),e.find(".progress").remove())},_refreshFileSize:function(){var t=this.model.get("file_size");this.$el.find("#size").html(e.bytesToString(t))},_removeRow:function(){var e=this.model.get("status");(e=="init"||e=="success"||e=="error")&&this.app.collection.remove(this.model)},_showExtensionInfo:function(){var e=$(this.el).find("#extension-info"),t=this.model.get("extension"),n=this.select_extension.text(),i=_.findWhere(this.app.list_extensions,{id:t});this.extension_popup||(this.extension_popup=new r.View({placement:"bottom",container:e})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(n),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new n(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(e){return'<tr id="upload-item-'+e.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
diff -r 126f96bd87a3e55e55ae324b343e66cb3b6ab419 -r fdb6215d8c090154aa6f9d0719d281cdb8526848 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","utils/uploadbox"],function(f,e,c,b,g,d,a){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history: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(i){var h=this;if(i){this.options=_.defaults(i,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(j){if(j){j.preventDefault();h.show()}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var h=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(j){for(key in j){h.list_extensions.push({id:j[key].extension,text:j[key].extension,description:j[key].description,description_url:j[key].description_url})}h.list_extensions.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0});if(!h.options.datatypes_disable_auto){h.list_extensions.unshift(h.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})}});this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},show:function(){var h=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.show()},500);return}if(!this.modal){var h=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(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Paste/Fetch data":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(j,k,l){h._eventAnnounce(j,k,l)},initialize:function(j,k,l){return h._eventInitialize(j,k,l)},progress:function(j,k,l){h._eventProgress(j,k,l)},success:function(j,k,l){h._eventSuccess(j,k,l)},error:function(j,k,l){h._eventError(j,k,l)},complete:function(){h._eventComplete()}});var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}this.modal.show();this._updateUser();this._updateScreen()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input.space_to_tabs=l;tool_input.to_posix_lines=i;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.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 h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.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.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(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" 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><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ 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(e,t,n,r,s,o,u,a){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 n.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(n){var r=this;n&&(this.options=_.defaults(n,this.options)),this.ui_button=new t.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(e){e&&(e.preventDefault(),r.show())},onunload:function(){if(r.counter.running>0)return"Several uploads are still processing."}}),$(".with-upload-button").append((new t.View(this.ui_button)).$el);var r=this;e.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(e){for(key in e)r.list_extensions.push({id:e[key].extension,text:e[key].extension,description:e[key].description,description_url:e[key].description_url});r.list_extensions.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0}),r.list_extensions.push({id:"---",text:"---",description:"",description_url:""}),r.options.datatypes_disable_auto||r.list_extensions.unshift(r.auto)}}),e.get({url:galaxy_config.root+"api/genomes",success:function(e){for(key in e)r.list_genomes.push({id:e[key][1],text:e[key][0]});r.list_genomes.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0})}}),this.collection.on("remove",function(e){r._eventRemove(e)}),this.collection.on("change:genome",function(e){var t=e.get("genome");r.collection.each(function(e){e.get("status")=="init"&&e.get("genome")=="?"&&e.set("genome",t)})})},show:function(){var e=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){e.show()},500);return}if(!this.modal){var e=this;this.modal=new u.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(){e.uploadbox.select()},"Choose FTP file":function(){e._eventFtp()},"Paste/Fetch data":function(){e._eventCreate()},Start:function(){e._eventStart()},Pause:function(){e._eventStop()},Reset:function(){e._eventReset()},Close:function(){e.modal.hide()}},height:"400",width:"900",closing_events:!0}),this.setElement("#upload-box");var e=this;this.uploadbox=this.$el.uploadbox({announce:function(t,n,r){e._eventAnnounce(t,n,r)},initialize:function(t,n,r){return e._eventInitialize(t,n,r)},progress:function(t,n,r){e._eventProgress(t,n,r)},success:function(t,n,r){e._eventSuccess(t,n,r)},error:function(t,n,r){e._eventError(t,n,r)},complete:function(){e._eventComplete()}});var t=this.modal.getButton("Choose FTP file");this.ftp=new o.View({title:"FTP files",container:t}),this.select_extension=new a.View({css:"extension",onchange:function(){var t=e.select_extension.value(),n=e.collection.models.length;if(t!=="---")for(i=0;i<n;i++)e.collection.models[i].attributes.row.select_extension.value(t)},data:e.list_extensions,container:e.$el.parents().find("#extension"),value:e.list_extensions[0]}),e.$el.parents().find("#extension-info_out").on("click",function(t){e._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()})}this.modal.show(),this._updateUser(),this._updateScreen()},_showExtensionInfo:function(){var e=this,t=$(this.el).parents().find("#extension-info_out"),n=e.select_extension.value(),r=this.select_extension.text(),i=_.findWhere(e.list_extensions,{id:n});this.extension_popup||(this.extension_popup=new o.View({placement:"bottom",container:t})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(r),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new UploadSettings(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_eventRemove:function(e){var t=e.get("status");t=="success"?this.counter.success--:t=="error"?this.counter.error--:this.counter.announce--,this._updateScreen(),this.uploadbox.remove(e.id)},_eventAnnounce:function(e,t,n){this.counter.announce++,this._updateScreen();var i=new r(this,{id:e,file_name:t.name,file_size:t.size,file_mode:t.mode,file_path:t.path});this.collection.add(i.model),$(this.el).find("tbody:first").append(i.$el),i.render()},_eventInitialize:function(e,t,n){var r=this.collection.get(e);r.set("status","running");var i=r.get("file_name"),s=r.get("file_path"),o=r.get("file_mode"),u=r.get("extension"),a=r.get("genome"),f=r.get("url_paste"),l=r.get("space_to_tabs"),c=r.get("to_posix_lines");return!!f||t.size>0?(this.uploadbox.configure({url:this.options.nginx_upload_path}),o=="local"?this.uploadbox.configure({paramname:"files_0|file_data"}):this.uploadbox.configure({paramname:null}),tool_input={},o=="new"&&(tool_input["files_0|url_paste"]=f),o=="ftp"&&(tool_input["files_0|ftp_files"]=s),tool_input.dbkey=a,tool_input.file_type=u,tool_input["files_0|type"]="upload_dataset",tool_input.space_to_tabs=l,tool_input.to_posix_lines=c,data={},data.history_id=this.current_history,data.tool_id="upload1",data.inputs=JSON.stringify(tool_input),data):null},_eventProgress:function(e,t,n){var r=this.collection.get(e);r.set("percentage",n),this.ui_button.set("percentage",this._upload_percentage(n,t.size))},_eventSuccess:function(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","success");var i=r.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(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","error"),r.set("info",n),this.ui_button.set("percentage",this._upload_percentage(100,t.size)),this.ui_button.set("status","danger"),this.upload_completed+=t.size*100,this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){e.get("status")=="queued"&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventFtp:function(){this.ftp.visible?this.ftp.hide():(this.ftp.empty(),this.ftp.append((new s(this)).$el),this.ftp.show())},_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 e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){t.get("status")=="init"&&(t.set("status","queued"),e.upload_size+=t.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(){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,this.current_user&&(this.current_history=Galaxy.currHistoryPanel.model.get("id"))},_updateScreen:function(){this.counter.announce==0?this.uploadbox.compatible()?message="You can Drag & Drop files into this box.":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+.":this.counter.running==0?message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",$("#upload-info").html(message),this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0?this.modal.enableButton("Reset"):this.modal.disableButton("Reset"),this.counter.running==0&&this.counter.announce>0?this.modal.enableButton("Start"):this.modal.disableButton("Start"),this.counter.running>0?this.modal.enableButton("Pause"):this.modal.disableButton("Pause"),this.counter.running==0?(this.modal.enableButton("Choose local file"),this.modal.enableButton("Choose FTP file"),this.modal.enableButton("Paste/Fetch data")):(this.modal.disableButton("Choose local file"),this.modal.disableButton("Choose FTP file"),this.modal.disableButton("Paste/Fetch data")),this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site?this.modal.showButton("Choose FTP file"):this.modal.hideButton("Choose FTP file"),this.counter.announce+this.counter.success+this.counter.error>0?$(this.el).find("#upload-table").show():$(this.el).find("#upload-table").hide()},_upload_percentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(e,t){return'<div class="uploadwrap"><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 class="uploadcont"><div class="uploadcont-wrap"><div id="'+e+'" 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>"+"</div>"+'<div class="uploadfoot">'+'<h6 id="'+t+'" class="upload-info"></h6>'+"</div>"+"</div>"}})});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/32c0e2ce30dc/
Changeset: 32c0e2ce30dc
Branch: upload-UI-enhancement
User: JenCabral
Date: 2015-01-23 15:13:13+00:00
Summary: fixing compatibility issues in IE and Firefox
Affected #: 3 files
diff -r fdb6215d8c090154aa6f9d0719d281cdb8526848 -r 32c0e2ce30dce27b22646031e408c400d735863e static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -699,36 +699,30 @@
// load html template
_template: function(id, idInfo) {
- return '<div class="uploadwrap">' +
- '<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 class="uploadcont">' +
- '<div class="uploadcont-wrap">' +
- '<div id="' + id + '" 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>' +
- '</div>' +
- '<div class="uploadfoot">' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
- '</div>' +
- '</div>';
+ 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="' + id + '" 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="' + idInfo + '" class="upload-info"></h6>' +
+ '</div>' ;
}
});
diff -r fdb6215d8c090154aa6f9d0719d281cdb8526848 -r 32c0e2ce30dce27b22646031e408c400d735863e 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(e,t,n,r,s,o,u,a){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 n.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(n){var r=this;n&&(this.options=_.defaults(n,this.options)),this.ui_button=new t.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(e){e&&(e.preventDefault(),r.show())},onunload:function(){if(r.counter.running>0)return"Several uploads are still processing."}}),$(".with-upload-button").append((new t.View(this.ui_button)).$el);var r=this;e.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(e){for(key in e)r.list_extensions.push({id:e[key].extension,text:e[key].extension,description:e[key].description,description_url:e[key].description_url});r.list_extensions.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0}),r.list_extensions.push({id:"---",text:"---",description:"",description_url:""}),r.options.datatypes_disable_auto||r.list_extensions.unshift(r.auto)}}),e.get({url:galaxy_config.root+"api/genomes",success:function(e){for(key in e)r.list_genomes.push({id:e[key][1],text:e[key][0]});r.list_genomes.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0})}}),this.collection.on("remove",function(e){r._eventRemove(e)}),this.collection.on("change:genome",function(e){var t=e.get("genome");r.collection.each(function(e){e.get("status")=="init"&&e.get("genome")=="?"&&e.set("genome",t)})})},show:function(){var e=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){e.show()},500);return}if(!this.modal){var e=this;this.modal=new u.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(){e.uploadbox.select()},"Choose FTP file":function(){e._eventFtp()},"Paste/Fetch data":function(){e._eventCreate()},Start:function(){e._eventStart()},Pause:function(){e._eventStop()},Reset:function(){e._eventReset()},Close:function(){e.modal.hide()}},height:"400",width:"900",closing_events:!0}),this.setElement("#upload-box");var e=this;this.uploadbox=this.$el.uploadbox({announce:function(t,n,r){e._eventAnnounce(t,n,r)},initialize:function(t,n,r){return e._eventInitialize(t,n,r)},progress:function(t,n,r){e._eventProgress(t,n,r)},success:function(t,n,r){e._eventSuccess(t,n,r)},error:function(t,n,r){e._eventError(t,n,r)},complete:function(){e._eventComplete()}});var t=this.modal.getButton("Choose FTP file");this.ftp=new o.View({title:"FTP files",container:t}),this.select_extension=new a.View({css:"extension",onchange:function(){var t=e.select_extension.value(),n=e.collection.models.length;if(t!=="---")for(i=0;i<n;i++)e.collection.models[i].attributes.row.select_extension.value(t)},data:e.list_extensions,container:e.$el.parents().find("#extension"),value:e.list_extensions[0]}),e.$el.parents().find("#extension-info_out").on("click",function(t){e._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()})}this.modal.show(),this._updateUser(),this._updateScreen()},_showExtensionInfo:function(){var e=this,t=$(this.el).parents().find("#extension-info_out"),n=e.select_extension.value(),r=this.select_extension.text(),i=_.findWhere(e.list_extensions,{id:n});this.extension_popup||(this.extension_popup=new o.View({placement:"bottom",container:t})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(r),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new UploadSettings(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_eventRemove:function(e){var t=e.get("status");t=="success"?this.counter.success--:t=="error"?this.counter.error--:this.counter.announce--,this._updateScreen(),this.uploadbox.remove(e.id)},_eventAnnounce:function(e,t,n){this.counter.announce++,this._updateScreen();var i=new r(this,{id:e,file_name:t.name,file_size:t.size,file_mode:t.mode,file_path:t.path});this.collection.add(i.model),$(this.el).find("tbody:first").append(i.$el),i.render()},_eventInitialize:function(e,t,n){var r=this.collection.get(e);r.set("status","running");var i=r.get("file_name"),s=r.get("file_path"),o=r.get("file_mode"),u=r.get("extension"),a=r.get("genome"),f=r.get("url_paste"),l=r.get("space_to_tabs"),c=r.get("to_posix_lines");return!!f||t.size>0?(this.uploadbox.configure({url:this.options.nginx_upload_path}),o=="local"?this.uploadbox.configure({paramname:"files_0|file_data"}):this.uploadbox.configure({paramname:null}),tool_input={},o=="new"&&(tool_input["files_0|url_paste"]=f),o=="ftp"&&(tool_input["files_0|ftp_files"]=s),tool_input.dbkey=a,tool_input.file_type=u,tool_input["files_0|type"]="upload_dataset",tool_input.space_to_tabs=l,tool_input.to_posix_lines=c,data={},data.history_id=this.current_history,data.tool_id="upload1",data.inputs=JSON.stringify(tool_input),data):null},_eventProgress:function(e,t,n){var r=this.collection.get(e);r.set("percentage",n),this.ui_button.set("percentage",this._upload_percentage(n,t.size))},_eventSuccess:function(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","success");var i=r.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(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","error"),r.set("info",n),this.ui_button.set("percentage",this._upload_percentage(100,t.size)),this.ui_button.set("status","danger"),this.upload_completed+=t.size*100,this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){e.get("status")=="queued"&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventFtp:function(){this.ftp.visible?this.ftp.hide():(this.ftp.empty(),this.ftp.append((new s(this)).$el),this.ftp.show())},_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 e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){t.get("status")=="init"&&(t.set("status","queued"),e.upload_size+=t.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(){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,this.current_user&&(this.current_history=Galaxy.currHistoryPanel.model.get("id"))},_updateScreen:function(){this.counter.announce==0?this.uploadbox.compatible()?message="You can Drag & Drop files into this box.":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+.":this.counter.running==0?message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",$("#upload-info").html(message),this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0?this.modal.enableButton("Reset"):this.modal.disableButton("Reset"),this.counter.running==0&&this.counter.announce>0?this.modal.enableButton("Start"):this.modal.disableButton("Start"),this.counter.running>0?this.modal.enableButton("Pause"):this.modal.disableButton("Pause"),this.counter.running==0?(this.modal.enableButton("Choose local file"),this.modal.enableButton("Choose FTP file"),this.modal.enableButton("Paste/Fetch data")):(this.modal.disableButton("Choose local file"),this.modal.disableButton("Choose FTP file"),this.modal.disableButton("Paste/Fetch data")),this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site?this.modal.showButton("Choose FTP file"):this.modal.hideButton("Choose FTP file"),this.counter.announce+this.counter.success+this.counter.error>0?$(this.el).find("#upload-table").show():$(this.el).find("#upload-table").hide()},_upload_percentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(e,t){return'<div class="uploadwrap"><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 class="uploadcont"><div class="uploadcont-wrap"><div id="'+e+'" 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>"+"</div>"+'<div class="uploadfoot">'+'<h6 id="'+t+'" class="upload-info"></h6>'+"</div>"+"</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(e,t,n,r,s,o,u,a){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 n.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(n){var r=this;n&&(this.options=_.defaults(n,this.options)),this.ui_button=new t.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",onclick:function(e){e&&(e.preventDefault(),r.show())},onunload:function(){if(r.counter.running>0)return"Several uploads are still processing."}}),$(".with-upload-button").append((new t.View(this.ui_button)).$el);var r=this;e.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(e){for(key in e)r.list_extensions.push({id:e[key].extension,text:e[key].extension,description:e[key].description,description_url:e[key].description_url});r.list_extensions.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0}),r.list_extensions.push({id:"---",text:"---",description:"",description_url:""}),r.options.datatypes_disable_auto||r.list_extensions.unshift(r.auto)}}),e.get({url:galaxy_config.root+"api/genomes",success:function(e){for(key in e)r.list_genomes.push({id:e[key][1],text:e[key][0]});r.list_genomes.sort(function(e,t){return e.id>t.id?1:e.id<t.id?-1:0})}}),this.collection.on("remove",function(e){r._eventRemove(e)}),this.collection.on("change:genome",function(e){var t=e.get("genome");r.collection.each(function(e){e.get("status")=="init"&&e.get("genome")=="?"&&e.set("genome",t)})})},show:function(){var e=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){e.show()},500);return}if(!this.modal){var e=this;this.modal=new u.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(){e.uploadbox.select()},"Choose FTP file":function(){e._eventFtp()},"Paste/Fetch data":function(){e._eventCreate()},Start:function(){e._eventStart()},Pause:function(){e._eventStop()},Reset:function(){e._eventReset()},Close:function(){e.modal.hide()}},height:"400",width:"900",closing_events:!0}),this.setElement("#upload-box");var e=this;this.uploadbox=this.$el.uploadbox({announce:function(t,n,r){e._eventAnnounce(t,n,r)},initialize:function(t,n,r){return e._eventInitialize(t,n,r)},progress:function(t,n,r){e._eventProgress(t,n,r)},success:function(t,n,r){e._eventSuccess(t,n,r)},error:function(t,n,r){e._eventError(t,n,r)},complete:function(){e._eventComplete()}});var t=this.modal.getButton("Choose FTP file");this.ftp=new o.View({title:"FTP files",container:t}),this.select_extension=new a.View({css:"extension",onchange:function(){var t=e.select_extension.value(),n=e.collection.models.length;if(t!=="---")for(i=0;i<n;i++)e.collection.models[i].attributes.row.select_extension.value(t)},data:e.list_extensions,container:e.$el.parents().find("#extension"),value:e.list_extensions[0]}),e.$el.parents().find("#extension-info_out").on("click",function(t){e._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()})}this.modal.show(),this._updateUser(),this._updateScreen()},_showExtensionInfo:function(){var e=this,t=$(this.el).parents().find("#extension-info_out"),n=e.select_extension.value(),r=this.select_extension.text(),i=_.findWhere(e.list_extensions,{id:n});this.extension_popup||(this.extension_popup=new o.View({placement:"bottom",container:t})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(r),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new UploadSettings(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_eventRemove:function(e){var t=e.get("status");t=="success"?this.counter.success--:t=="error"?this.counter.error--:this.counter.announce--,this._updateScreen(),this.uploadbox.remove(e.id)},_eventAnnounce:function(e,t,n){this.counter.announce++,this._updateScreen();var i=new r(this,{id:e,file_name:t.name,file_size:t.size,file_mode:t.mode,file_path:t.path});this.collection.add(i.model),$(this.el).find("tbody:first").append(i.$el),i.render()},_eventInitialize:function(e,t,n){var r=this.collection.get(e);r.set("status","running");var i=r.get("file_name"),s=r.get("file_path"),o=r.get("file_mode"),u=r.get("extension"),a=r.get("genome"),f=r.get("url_paste"),l=r.get("space_to_tabs"),c=r.get("to_posix_lines");return!!f||t.size>0?(this.uploadbox.configure({url:this.options.nginx_upload_path}),o=="local"?this.uploadbox.configure({paramname:"files_0|file_data"}):this.uploadbox.configure({paramname:null}),tool_input={},o=="new"&&(tool_input["files_0|url_paste"]=f),o=="ftp"&&(tool_input["files_0|ftp_files"]=s),tool_input.dbkey=a,tool_input.file_type=u,tool_input["files_0|type"]="upload_dataset",tool_input.space_to_tabs=l,tool_input.to_posix_lines=c,data={},data.history_id=this.current_history,data.tool_id="upload1",data.inputs=JSON.stringify(tool_input),data):null},_eventProgress:function(e,t,n){var r=this.collection.get(e);r.set("percentage",n),this.ui_button.set("percentage",this._upload_percentage(n,t.size))},_eventSuccess:function(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","success");var i=r.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(e,t,n){var r=this.collection.get(e);r.set("percentage",100),r.set("status","error"),r.set("info",n),this.ui_button.set("percentage",this._upload_percentage(100,t.size)),this.ui_button.set("status","danger"),this.upload_completed+=t.size*100,this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){e.get("status")=="queued"&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventFtp:function(){this.ftp.visible?this.ftp.hide():(this.ftp.empty(),this.ftp.append((new s(this)).$el),this.ftp.show())},_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 e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){t.get("status")=="init"&&(t.set("status","queued"),e.upload_size+=t.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(){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,this.current_user&&(this.current_history=Galaxy.currHistoryPanel.model.get("id"))},_updateScreen:function(){this.counter.announce==0?this.uploadbox.compatible()?message="You can Drag & Drop files into this box.":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+.":this.counter.running==0?message="You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":message="Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",$("#upload-info").html(message),this.counter.running==0&&this.counter.announce+this.counter.success+this.counter.error>0?this.modal.enableButton("Reset"):this.modal.disableButton("Reset"),this.counter.running==0&&this.counter.announce>0?this.modal.enableButton("Start"):this.modal.disableButton("Start"),this.counter.running>0?this.modal.enableButton("Pause"):this.modal.disableButton("Pause"),this.counter.running==0?(this.modal.enableButton("Choose local file"),this.modal.enableButton("Choose FTP file"),this.modal.enableButton("Paste/Fetch data")):(this.modal.disableButton("Choose local file"),this.modal.disableButton("Choose FTP file"),this.modal.disableButton("Paste/Fetch data")),this.current_user&&this.options.ftp_upload_dir&&this.options.ftp_upload_site?this.modal.showButton("Choose FTP file"):this.modal.hideButton("Choose FTP file"),this.counter.announce+this.counter.success+this.counter.error>0?$(this.el).find("#upload-table").show():$(this.el).find("#upload-table").hide()},_upload_percentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(e,t){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="'+e+'" 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="'+t+'" class="upload-info"></h6>'+"</div>"}})});
\ No newline at end of file
diff -r fdb6215d8c090154aa6f9d0719d281cdb8526848 -r 32c0e2ce30dce27b22646031e408c400d735863e static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -119,11 +119,8 @@
.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}
-.uploadwrap {display: table; height: 100%; width: 100%;}
-.uploadcont{display: table-row; height: 100%;}
-.uploadcont-wrap{height: 100%; overflow: auto;}
-.uploadfoot{display: table-row; text-align:center;}
-.uploadhead{display: table-row; float:left; text-align:left; max-height:20px; line-height:18px; margin-bottom: 5px;}
+.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}
@@ -1379,7 +1376,7 @@
.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:100%;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: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 .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}
https://bitbucket.org/galaxy/galaxy-central/commits/e5e6fb30d560/
Changeset: e5e6fb30d560
User: dannon
Date: 2015-01-23 15:59:45+00:00
Summary: Merge Upload UI Enhancements from JCabral
Affected #: 9 files
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/scripts/mvc/upload/upload-ftp.js
--- a/static/scripts/mvc/upload/upload-ftp.js
+++ b/static/scripts/mvc/upload/upload-ftp.js
@@ -35,6 +35,7 @@
// fill table
_fill: function(ftp_files) {
+ var self = this;
if (ftp_files && ftp_files.length > 0) {
// add table
this.$el.find('#upload-ftp-content').html($(this._templateTable()));
@@ -49,11 +50,43 @@
// update stats
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
+
+ var selectAll = this.$el.find('#selectAll');
+
+ // call method to determine and set selectAll status on loading
+ this._updateSelectAll(selectAll);
+
+ // selectAll checkbox has been clicked
+ selectAll.on('click', function() {
+ var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
+ var len = checkboxes.length;
+ $this = $(this);
+ var allChecked = !($this.hasClass('fa-check-square-o'));
+
+ // change state of the sub-checkboxes
+ for(i = 0; i < len; i++) {
+ if(allChecked) {
+ // all checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-square-o')) {
+ // if they are not checked, check them
+ checkboxes.eq(i).trigger('updateUpBox');
+ }
+ } else {
+ // no checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
+ // if they are checked, uncheck them
+ checkboxes.eq(i).trigger('updateUpBox');
+ }
+ }
+ }
+
+ self._updateSelectAll(selectAll);
+ });
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
-
+
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
},
@@ -79,18 +112,18 @@
} else {
icon_class = this.options.class_add;
}
-
+
// add icon class
$icon.addClass(icon_class);
-
- // click to add ftp files
- $it.on('click', function() {
+
+ // add files to the uploadbox
+ $it.on('updateUpBox', function() {
// find model
var model_index = self._find(ftp_file);
-
+
// update icon
$icon.removeClass();
-
+
// add model
if (!model_index) {
// add to uploadbox
@@ -100,19 +133,55 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
});
+
+ // click to add ftp files
+ $it.on('click', function() {
+ //trigger my new event
+ $icon.trigger('updateUpBox');
+
+ // click to add ftp files
+ // modify selectAll box based on number of checkboxes checked
+ var selectBox=$icon.parents().find('#selectAll');
+ // determine and set state of selectAll after sub-checkbox clicked
+ self._updateSelectAll(selectBox);
+ });
},
-
+
+ _updateSelectAll: function(selectBox) {
+ // array of all checkboxes
+ var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
+ // array of only checked checkboxes
+ var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
+ var lenAll = checkboxes.length;
+ var lenChecked = checkedCheckboxes.length;
+
+ // determine which state the selectAll checkbox needs to be and setting it
+ if(lenChecked > 0 && lenChecked !== lenAll) {
+ // indeterminate state
+ selectBox.removeClass('fa-square-o fa-check-square-o');
+ selectBox.addClass('fa-minus-square-o');
+ } else if(lenChecked === lenAll) {
+ // checked state
+ selectBox.removeClass('fa-square-o fa-minus-square-o');
+ selectBox.addClass('fa-check-square-o');
+ } else if(lenChecked === 0) {
+ // unchecked state
+ selectBox.removeClass('fa-check-square-o fa-minus-square-o');
+ selectBox.addClass('fa-square-o');
+ }
+ },
+
// get model index
_find: function(ftp_file) {
// check if exists already
@@ -149,7 +218,7 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
- '<th></th>' +
+ '<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/scripts/mvc/upload/upload-model.js
--- a/static/scripts/mvc/upload/upload-model.js
+++ b/static/scripts/mvc/upload/upload-model.js
@@ -14,6 +14,7 @@
file_type : null,
file_path : '',
percentage : 0,
+ row : null,
// settings
space_to_tabs : false,
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/scripts/mvc/upload/upload-row.js
--- a/static/scripts/mvc/upload/upload-row.js
+++ b/static/scripts/mvc/upload/upload-row.js
@@ -42,6 +42,9 @@
// link app
this.app = app;
+ // default value for extension of files
+ var default_ext = 'Auto-detect';
+
// link this
var self = this;
@@ -75,15 +78,28 @@
// initialize genome
this.model.set('genome', self.select_genome.value());
+ // 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();
+ }
+
// 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.model.get('extension')
+ value: self.default_ext
});
// initialize extension
@@ -139,6 +155,7 @@
this.app.collection.on('reset', function() {
self.remove();
});
+ self.model.set('row', self);
},
// render
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/scripts/mvc/upload/upload-view.js
--- a/static/scripts/mvc/upload/upload-view.js
+++ b/static/scripts/mvc/upload/upload-view.js
@@ -6,6 +6,7 @@
"mvc/upload/upload-ftp",
"mvc/ui/ui-popover",
"mvc/ui/ui-modal",
+ "mvc/ui/ui-select",
"utils/uploadbox"],
function( Utils,
@@ -14,7 +15,8 @@
UploadItem,
UploadFtp,
Popover,
- Modal
+ Modal,
+ Select
) {
// galaxy upload
@@ -35,6 +37,9 @@
// current history
current_history: null,
+
+ // extension selector
+ select_extension : null,
// current upload size
upload_size: 0,
@@ -119,11 +124,19 @@
description_url : datatypes[key].description_url
});
}
-
+
// sort
self.list_extensions.sort(function(a, b) {
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) {
@@ -218,6 +231,29 @@
title : 'FTP files',
container : button
});
+
+ // 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]
+ });
+
+ // handle extension info popover
+ self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
+ .on('mousedown', function(e) { e.preventDefault(); });
}
// show modal
@@ -230,6 +266,60 @@
this._updateScreen();
},
+ _showExtensionInfo : function() {
+ // 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 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();
+ }
+ },
+
+ _showSettings : function() {
+ // check if popover is visible
+ if (!this.settings.visible) {
+ // show popover
+ this.settings.empty();
+ this.settings.append((new UploadSettings(this)).$el);
+ this.settings.show();
+ } else {
+ // hide popover
+ this.settings.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.';
+ }
+ },
+
//
// events triggered by collection
//
@@ -513,6 +603,9 @@
// remove from queue
this.uploadbox.reset();
+
+ // reset value for universal type drop-down
+ this.select_extension.value(this.list_extensions[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -606,7 +699,12 @@
// load html template
_template: function(id, idInfo) {
- return '<div id="' + id + '" class="upload-box">' +
+ 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="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
'<thead>' +
'<tr>' +
@@ -622,7 +720,9 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>';
+ '<div class="uploadfoot">' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
+ '</div>' ;
}
});
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)},error:function(){b._fill()}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(c){if(c&&c.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var b=0;for(key in c){this.add(c[key]);b+=c[key].size}this.$el.find("#upload-ftp-number").html(c.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(b,true))}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("click",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}})},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
+define(["utils/utils"],function(e){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(t){this.app=t;var n=this;this.setElement(this._template()),e.get({url:galaxy_config.root+"api/ftp_files",success:function(e){n._fill(e)},error:function(){n._fill()}})},events:{mousedown:function(e){e.preventDefault()}},_fill:function(t){var n=this;if(t&&t.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var r=0;for(key in t)this.add(t[key]),r+=t[key].size;this.$el.find("#upload-ftp-number").html(t.length+" files"),this.$el.find("#upload-ftp-disk").html(e.bytesToString(r,!0));var s=this.$el.find("#selectAll");this._updateSelectAll(s),s.on("click",function(){var e=$(this).parents().find("tr.upload-ftp-row>td>div"),t=e.length;$this=$(this);var r=!$this.hasClass("fa-check-square-o");for(i=0;i<t;i++)r?e.eq(i).hasClass("fa-square-o")&&e.eq(i).trigger("updateUpBox"):e.eq(i).hasClass("fa-check-square-o")&&e.eq(i).trigger("updateUpBox");n._updateSelectAll(s)})}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},add:function(e){var t=this,n=$(this._templateRow(e)),r=n.find(".icon");$(this.el).find("tbody").append(n);var i="";this._find(e)?i=this.options.class_remove:i=this.options.class_add,r.addClass(i),n.on("updateUpBox",function(){var n=t._find(e);r.removeClass(),n?(t.app.collection.remove(n),r.addClass(t.options.class_add)):(t.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]),r.addClass(t.options.class_remove))}),n.on("click",function(){r.trigger("updateUpBox");var e=r.parents().find("#selectAll");t._updateSelectAll(e)})},_updateSelectAll:function(e){var t=e.parents().find("tr.upload-ftp-row>td>div"),n=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o"),r=t.length,i=n.length;i>0&&i!==r?(e.removeClass("fa-square-o fa-check-square-o"),e.addClass("fa-minus-square-o")):i===r?(e.removeClass("fa-square-o fa-minus-square-o"),e.addClass("fa-check-square-o")):i===0&&(e.removeClass("fa-check-square-o fa-minus-square-o"),e.addClass("fa-square-o"))},_find:function(e){var t=this.app.collection.where({file_path:e.path}),n=null;for(var r in t){var i=t[r];i.get("status")=="init"&&i.get("file_mode")=="ftp"&&(n=i.get("id"))}return n},_templateRow:function(t){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+t.path+"</p></td>"+'<td style="white-space: nowrap;">'+e.bytesToString(t.size)+"</td>"+'<td style="white-space: nowrap;">'+t.ctime+"</td>"+"</tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+"</strong> using your Galaxy credentials (email address and password).</div>"+'<div id="upload-ftp-content"></div>'+"<div>"}})});
\ No newline at end of file
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 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,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 e=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:!1,to_posix_lines:!0}}),t=Backbone.Collection.extend({model:e});return{Model:e,Collection:t}});
\ No newline at end of file
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 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(i,g){this.app=i;var f=this;this.model=new b.Model(g);this.setElement(this._template(g));var h=this.$el;this.settings=new c.View({title:"Upload configuration",container:h.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:h.find("#genome"),value:f.model.get("genome")});this.model.set("genome",f.select_genome.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:h.find("#extension"),value:f.model.get("extension")});this.model.set("extension",f.select_extension.value());h.find("#symbol").on("click",function(){f._removeRow()});h.find("#extension-info").on("click",function(j){f._showExtensionInfo()}).on("mousedown",function(j){j.preventDefault()});h.find("#settings").on("click",function(j){f._showSettings()}).on("mousedown",function(j){j.preventDefault()});h.find("#text-content").on("keyup",function(j){f.model.set("url_paste",$(j.target).val());f.model.set("file_size",$(j.target).val().length)});h.find("#space_to_tabs").on("change",function(j){f.model.set("space_to_tabs",$(j.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()})},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(e,t,n,r,i){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(e,n){this.app=e;var s="Auto-detect",o=this;this.model=new t.Model(n),this.setElement(this._template(n));var u=this.$el;this.settings=new r.View({title:"Upload configuration",container:u.find("#settings"),placement:"bottom"}),this.select_genome=new i.View({css:"genome",onchange:function(){o.model.set("genome",o.select_genome.value())},data:o.app.list_genomes,container:u.find("#genome"),value:o.model.get("genome")}),this.model.set("genome",o.select_genome.value()),this.app.select_extension.value()!=="---"&&(this.default_ext=this.app.select_extension.value()),this.select_extension=new i.View({css:"extension",onchange:function(){o.model.set("extension",o.select_extension.value());if(o.select_extension.value()!==e.select_extension.value()){var t="---";e.select_extension.value(t)}},data:o.app.list_extensions,container:u.find("#extension"),value:o.default_ext}),this.model.set("extension",o.select_extension.value()),u.find("#symbol").on("click",function(){o._removeRow()}),u.find("#extension-info").on("click",function(e){o._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()}),u.find("#settings").on("click",function(e){o._showSettings()}).on("mousedown",function(e){e.preventDefault()}),u.find("#text-content").on("keyup",function(e){o.model.set("url_paste",$(e.target).val()),o.model.set("file_size",$(e.target).val().length)}),u.find("#space_to_tabs").on("change",function(e){o.model.set("space_to_tabs",$(e.target).prop("checked"))}),this.model.on("change:percentage",function(){o._refreshPercentage()}),this.model.on("change:status",function(){o._refreshStatus()}),this.model.on("change:info",function(){o._refreshInfo()}),this.model.on("change:genome",function(){o._refreshGenome()}),this.model.on("change:file_size",function(){o._refreshFileSize()}),this.model.on("remove",function(){o.remove()}),this.app.collection.on("reset",function(){o.remove()}),o.model.set("row",o)},render:function(){var t=this.model.get("file_name"),n=this.model.get("file_size"),r=this.model.get("file_mode"),i=this.$el;i.find("#title").html(t),i.find("#size").html(e.bytesToString(n)),i.find("#mode").removeClass().addClass("mode");if(r=="new"){var s=i.find("#text"),o=this.options.padding,u=i.width()-2*o,a=i.height()-o;s.css("width",u+"px"),s.css("top",a+"px"),i.height(a+s.height()+2*o),s.show(),i.find("#mode").addClass("fa fa-pencil")}r=="local"&&i.find("#mode").addClass("fa fa-laptop"),r=="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 e=this.model.get("genome");this.select_genome.value(e)},_refreshInfo:function(){var e=this.model.get("info");e?this.$el.find("#info").html("<strong>Failed: </strong>"+e).show():this.$el.find("#info").hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:e+"%"}),e!=100?this.$el.find("#percentage").html(e+"%"):this.$el.find("#percentage").html("Adding to history...")},_refreshStatus:function(){var e=this.$el,t=this.model.get("status"),n=this.status_classes[t],r=this.$el.find("#symbol");r.removeClass(),r.addClass(n),t=="init"?(this.select_genome.enable(),this.select_extension.enable(),e.find("#text-content").attr("disabled",!1),e.find("#space_to_tabs").attr("disabled",!1)):(this.select_genome.disable(),this.select_extension.disable(),e.find("#text-content").attr("disabled",!0),e.find("#space_to_tabs").attr("disabled",!0)),t=="success"&&(e.addClass("success"),e.find("#percentage").html("100%")),t=="error"&&(e.addClass("danger"),e.find(".progress").remove())},_refreshFileSize:function(){var t=this.model.get("file_size");this.$el.find("#size").html(e.bytesToString(t))},_removeRow:function(){var e=this.model.get("status");(e=="init"||e=="success"||e=="error")&&this.app.collection.remove(this.model)},_showExtensionInfo:function(){var e=$(this.el).find("#extension-info"),t=this.model.get("extension"),n=this.select_extension.text(),i=_.findWhere(this.app.list_extensions,{id:t});this.extension_popup||(this.extension_popup=new r.View({placement:"bottom",container:e})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(n),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new n(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(e){return'<tr id="upload-item-'+e.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
diff -r 58e5b7165b1ad59d0547bf287e24988a3271449e -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -119,6 +119,12 @@
.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}
@@ -1370,7 +1376,7 @@
.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: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: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 .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}
https://bitbucket.org/galaxy/galaxy-central/commits/693f01fe6a68/
Changeset: 693f01fe6a68
User: dannon
Date: 2015-01-23 16:08:05+00:00
Summary: Copy changes from PR644 to client.
Affected #: 4 files
diff -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 client/galaxy/scripts/mvc/upload/upload-ftp.js
--- a/client/galaxy/scripts/mvc/upload/upload-ftp.js
+++ b/client/galaxy/scripts/mvc/upload/upload-ftp.js
@@ -35,6 +35,7 @@
// fill table
_fill: function(ftp_files) {
+ var self = this;
if (ftp_files && ftp_files.length > 0) {
// add table
this.$el.find('#upload-ftp-content').html($(this._templateTable()));
@@ -49,11 +50,43 @@
// update stats
this.$el.find('#upload-ftp-number').html(ftp_files.length + ' files');
this.$el.find('#upload-ftp-disk').html(Utils.bytesToString (size, true));
+
+ var selectAll = this.$el.find('#selectAll');
+
+ // call method to determine and set selectAll status on loading
+ this._updateSelectAll(selectAll);
+
+ // selectAll checkbox has been clicked
+ selectAll.on('click', function() {
+ var checkboxes=$(this).parents().find('tr.upload-ftp-row>td>div');
+ var len = checkboxes.length;
+ $this = $(this);
+ var allChecked = !($this.hasClass('fa-check-square-o'));
+
+ // change state of the sub-checkboxes
+ for(i = 0; i < len; i++) {
+ if(allChecked) {
+ // all checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-square-o')) {
+ // if they are not checked, check them
+ checkboxes.eq(i).trigger('updateUpBox');
+ }
+ } else {
+ // no checkboxes should be checked
+ if(checkboxes.eq(i).hasClass('fa-check-square-o')) {
+ // if they are checked, uncheck them
+ checkboxes.eq(i).trigger('updateUpBox');
+ }
+ }
+ }
+
+ self._updateSelectAll(selectAll);
+ });
} else {
// add info
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
}
-
+
// hide spinner
this.$el.find('#upload-ftp-wait').hide();
},
@@ -79,18 +112,18 @@
} else {
icon_class = this.options.class_add;
}
-
+
// add icon class
$icon.addClass(icon_class);
-
- // click to add ftp files
- $it.on('click', function() {
+
+ // add files to the uploadbox
+ $it.on('updateUpBox', function() {
// find model
var model_index = self._find(ftp_file);
-
+
// update icon
$icon.removeClass();
-
+
// add model
if (!model_index) {
// add to uploadbox
@@ -100,19 +133,55 @@
size : ftp_file.size,
path : ftp_file.path
}]);
-
+
// add new icon class
$icon.addClass(self.options.class_remove);
} else {
// remove
self.app.collection.remove(model_index);
-
+
// add new icon class
$icon.addClass(self.options.class_add);
}
});
+
+ // click to add ftp files
+ $it.on('click', function() {
+ //trigger my new event
+ $icon.trigger('updateUpBox');
+
+ // click to add ftp files
+ // modify selectAll box based on number of checkboxes checked
+ var selectBox=$icon.parents().find('#selectAll');
+ // determine and set state of selectAll after sub-checkbox clicked
+ self._updateSelectAll(selectBox);
+ });
},
-
+
+ _updateSelectAll: function(selectBox) {
+ // array of all checkboxes
+ var checkboxes=selectBox.parents().find('tr.upload-ftp-row>td>div');
+ // array of only checked checkboxes
+ var checkedCheckboxes=selectBox.parents().find('tr.upload-ftp-row>td>div.fa-check-square-o');
+ var lenAll = checkboxes.length;
+ var lenChecked = checkedCheckboxes.length;
+
+ // determine which state the selectAll checkbox needs to be and setting it
+ if(lenChecked > 0 && lenChecked !== lenAll) {
+ // indeterminate state
+ selectBox.removeClass('fa-square-o fa-check-square-o');
+ selectBox.addClass('fa-minus-square-o');
+ } else if(lenChecked === lenAll) {
+ // checked state
+ selectBox.removeClass('fa-square-o fa-minus-square-o');
+ selectBox.addClass('fa-check-square-o');
+ } else if(lenChecked === 0) {
+ // unchecked state
+ selectBox.removeClass('fa-check-square-o fa-minus-square-o');
+ selectBox.addClass('fa-square-o');
+ }
+ },
+
// get model index
_find: function(ftp_file) {
// check if exists already
@@ -149,7 +218,7 @@
'<table class="grid" style="float: left;">' +
'<thead>' +
'<tr>' +
- '<th></th>' +
+ '<th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th>' +
'<th>Name</th>' +
'<th>Size</th>' +
'<th>Created</th>' +
diff -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 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,6 +14,7 @@
file_type : null,
file_path : '',
percentage : 0,
+ row : null,
// settings
space_to_tabs : false,
diff -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 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
@@ -42,6 +42,9 @@
// link app
this.app = app;
+ // default value for extension of files
+ var default_ext = 'Auto-detect';
+
// link this
var self = this;
@@ -75,15 +78,28 @@
// initialize genome
this.model.set('genome', self.select_genome.value());
+ // 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();
+ }
+
// 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.model.get('extension')
+ value: self.default_ext
});
// initialize extension
@@ -139,6 +155,7 @@
this.app.collection.on('reset', function() {
self.remove();
});
+ self.model.set('row', self);
},
// render
diff -r e5e6fb30d560b950dd0d773f1226fd84e87c4860 -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 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
@@ -6,6 +6,7 @@
"mvc/upload/upload-ftp",
"mvc/ui/ui-popover",
"mvc/ui/ui-modal",
+ "mvc/ui/ui-select",
"utils/uploadbox"],
function( Utils,
@@ -14,7 +15,8 @@
UploadItem,
UploadFtp,
Popover,
- Modal
+ Modal,
+ Select
) {
// galaxy upload
@@ -35,6 +37,9 @@
// current history
current_history: null,
+
+ // extension selector
+ select_extension : null,
// current upload size
upload_size: 0,
@@ -119,11 +124,19 @@
description_url : datatypes[key].description_url
});
}
-
+
// sort
self.list_extensions.sort(function(a, b) {
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) {
@@ -218,6 +231,29 @@
title : 'FTP files',
container : button
});
+
+ // 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]
+ });
+
+ // handle extension info popover
+ self.$el.parents().find('#extension-info_out').on('click' , function(e) { self._showExtensionInfo(); })
+ .on('mousedown', function(e) { e.preventDefault(); });
}
// show modal
@@ -230,6 +266,60 @@
this._updateScreen();
},
+ _showExtensionInfo : function() {
+ // 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 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();
+ }
+ },
+
+ _showSettings : function() {
+ // check if popover is visible
+ if (!this.settings.visible) {
+ // show popover
+ this.settings.empty();
+ this.settings.append((new UploadSettings(this)).$el);
+ this.settings.show();
+ } else {
+ // hide popover
+ this.settings.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.';
+ }
+ },
+
//
// events triggered by collection
//
@@ -513,6 +603,9 @@
// remove from queue
this.uploadbox.reset();
+
+ // reset value for universal type drop-down
+ this.select_extension.value(this.list_extensions[0]);
// reset button
this.ui_button.set('percentage', 0);
@@ -606,7 +699,12 @@
// load html template
_template: function(id, idInfo) {
- return '<div id="' + id + '" class="upload-box">' +
+ 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="' + id + '" class="upload-box">' +
'<table id="upload-table" class="table table-striped" style="display: none;">' +
'<thead>' +
'<tr>' +
@@ -622,7 +720,9 @@
'<tbody></tbody>' +
'</table>' +
'</div>' +
- '<h6 id="' + idInfo + '" class="upload-info"></h6>';
+ '<div class="uploadfoot">' +
+ '<h6 id="' + idInfo + '" class="upload-info"></h6>' +
+ '</div>' ;
}
});
https://bitbucket.org/galaxy/galaxy-central/commits/b73cb7a7cdca/
Changeset: b73cb7a7cdca
User: dannon
Date: 2015-01-23 16:10:17+00:00
Summary: Pack scripts
Affected #: 4 files
diff -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d static/scripts/packed/mvc/upload/upload-ftp.js
--- a/static/scripts/packed/mvc/upload/upload-ftp.js
+++ b/static/scripts/packed/mvc/upload/upload-ftp.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(e){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(t){this.app=t;var n=this;this.setElement(this._template()),e.get({url:galaxy_config.root+"api/ftp_files",success:function(e){n._fill(e)},error:function(){n._fill()}})},events:{mousedown:function(e){e.preventDefault()}},_fill:function(t){var n=this;if(t&&t.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var r=0;for(key in t)this.add(t[key]),r+=t[key].size;this.$el.find("#upload-ftp-number").html(t.length+" files"),this.$el.find("#upload-ftp-disk").html(e.bytesToString(r,!0));var s=this.$el.find("#selectAll");this._updateSelectAll(s),s.on("click",function(){var e=$(this).parents().find("tr.upload-ftp-row>td>div"),t=e.length;$this=$(this);var r=!$this.hasClass("fa-check-square-o");for(i=0;i<t;i++)r?e.eq(i).hasClass("fa-square-o")&&e.eq(i).trigger("updateUpBox"):e.eq(i).hasClass("fa-check-square-o")&&e.eq(i).trigger("updateUpBox");n._updateSelectAll(s)})}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},add:function(e){var t=this,n=$(this._templateRow(e)),r=n.find(".icon");$(this.el).find("tbody").append(n);var i="";this._find(e)?i=this.options.class_remove:i=this.options.class_add,r.addClass(i),n.on("updateUpBox",function(){var n=t._find(e);r.removeClass(),n?(t.app.collection.remove(n),r.addClass(t.options.class_add)):(t.app.uploadbox.add([{mode:"ftp",name:e.path,size:e.size,path:e.path}]),r.addClass(t.options.class_remove))}),n.on("click",function(){r.trigger("updateUpBox");var e=r.parents().find("#selectAll");t._updateSelectAll(e)})},_updateSelectAll:function(e){var t=e.parents().find("tr.upload-ftp-row>td>div"),n=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o"),r=t.length,i=n.length;i>0&&i!==r?(e.removeClass("fa-square-o fa-check-square-o"),e.addClass("fa-minus-square-o")):i===r?(e.removeClass("fa-square-o fa-minus-square-o"),e.addClass("fa-check-square-o")):i===0&&(e.removeClass("fa-check-square-o fa-minus-square-o"),e.addClass("fa-square-o"))},_find:function(e){var t=this.app.collection.where({file_path:e.path}),n=null;for(var r in t){var i=t[r];i.get("status")=="init"&&i.get("file_mode")=="ftp"&&(n=i.get("id"))}return n},_templateRow:function(t){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+t.path+"</p></td>"+'<td style="white-space: nowrap;">'+e.bytesToString(t.size)+"</td>"+'<td style="white-space: nowrap;">'+t.ctime+"</td>"+"</tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+"</strong> using your Galaxy credentials (email address and password).</div>"+'<div id="upload-ftp-content"></div>'+"<div>"}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.View.extend({options:{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o"},initialize:function(c){this.app=c;var b=this;this.setElement(this._template());a.get({url:galaxy_config.root+"api/ftp_files",success:function(d){b._fill(d)},error:function(){b._fill()}})},events:{mousedown:function(b){b.preventDefault()}},_fill:function(d){var b=this;if(d&&d.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var c=0;for(key in d){this.add(d[key]);c+=d[key].size}this.$el.find("#upload-ftp-number").html(d.length+" files");this.$el.find("#upload-ftp-disk").html(a.bytesToString(c,true));var e=this.$el.find("#selectAll");this._updateSelectAll(e);e.on("click",function(){var h=$(this).parents().find("tr.upload-ftp-row>td>div");var g=h.length;$this=$(this);var f=!($this.hasClass("fa-check-square-o"));for(i=0;i<g;i++){if(f){if(h.eq(i).hasClass("fa-square-o")){h.eq(i).trigger("updateUpBox")}}else{if(h.eq(i).hasClass("fa-check-square-o")){h.eq(i).trigger("updateUpBox")}}}b._updateSelectAll(e)})}else{this.$el.find("#upload-ftp-content").html($(this._templateInfo()))}this.$el.find("#upload-ftp-wait").hide()},add:function(f){var d=this;var e=$(this._templateRow(f));var b=e.find(".icon");$(this.el).find("tbody").append(e);var c="";if(this._find(f)){c=this.options.class_remove}else{c=this.options.class_add}b.addClass(c);e.on("updateUpBox",function(){var g=d._find(f);b.removeClass();if(!g){d.app.uploadbox.add([{mode:"ftp",name:f.path,size:f.size,path:f.path}]);b.addClass(d.options.class_remove)}else{d.app.collection.remove(g);b.addClass(d.options.class_add)}});e.on("click",function(){b.trigger("updateUpBox");var g=b.parents().find("#selectAll");d._updateSelectAll(g)})},_updateSelectAll:function(e){var d=e.parents().find("tr.upload-ftp-row>td>div");var f=e.parents().find("tr.upload-ftp-row>td>div.fa-check-square-o");var c=d.length;var b=f.length;if(b>0&&b!==c){e.removeClass("fa-square-o fa-check-square-o");e.addClass("fa-minus-square-o")}else{if(b===c){e.removeClass("fa-square-o fa-minus-square-o");e.addClass("fa-check-square-o")}else{if(b===0){e.removeClass("fa-check-square-o fa-minus-square-o");e.addClass("fa-square-o")}}}},_find:function(f){var c=this.app.collection.where({file_path:f.path});var b=null;for(var d in c){var e=c[d];if(e.get("status")=="init"&&e.get("file_mode")=="ftp"){b=e.get("id")}}return b},_templateRow:function(b){return'<tr class="upload-ftp-row" style="cursor: pointer;"><td><div class="icon"/></td><td style="width: 200px"><p style="width: inherit; word-wrap: break-word;">'+b.path+'</p></td><td style="white-space: nowrap;">'+a.bytesToString(b.size)+'</td><td style="white-space: nowrap;">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th><div id="selectAll" class="upload-icon-button fa fa-square-o" ></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody></tbody></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.app.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"></div><div>'}})});
\ No newline at end of file
diff -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d 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 e=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:!1,to_posix_lines:!0}}),t=Backbone.Collection.extend({model:e});return{Model:e,Collection:t}});
\ 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,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
diff -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d 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(e,t,n,r,i){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(e,n){this.app=e;var s="Auto-detect",o=this;this.model=new t.Model(n),this.setElement(this._template(n));var u=this.$el;this.settings=new r.View({title:"Upload configuration",container:u.find("#settings"),placement:"bottom"}),this.select_genome=new i.View({css:"genome",onchange:function(){o.model.set("genome",o.select_genome.value())},data:o.app.list_genomes,container:u.find("#genome"),value:o.model.get("genome")}),this.model.set("genome",o.select_genome.value()),this.app.select_extension.value()!=="---"&&(this.default_ext=this.app.select_extension.value()),this.select_extension=new i.View({css:"extension",onchange:function(){o.model.set("extension",o.select_extension.value());if(o.select_extension.value()!==e.select_extension.value()){var t="---";e.select_extension.value(t)}},data:o.app.list_extensions,container:u.find("#extension"),value:o.default_ext}),this.model.set("extension",o.select_extension.value()),u.find("#symbol").on("click",function(){o._removeRow()}),u.find("#extension-info").on("click",function(e){o._showExtensionInfo()}).on("mousedown",function(e){e.preventDefault()}),u.find("#settings").on("click",function(e){o._showSettings()}).on("mousedown",function(e){e.preventDefault()}),u.find("#text-content").on("keyup",function(e){o.model.set("url_paste",$(e.target).val()),o.model.set("file_size",$(e.target).val().length)}),u.find("#space_to_tabs").on("change",function(e){o.model.set("space_to_tabs",$(e.target).prop("checked"))}),this.model.on("change:percentage",function(){o._refreshPercentage()}),this.model.on("change:status",function(){o._refreshStatus()}),this.model.on("change:info",function(){o._refreshInfo()}),this.model.on("change:genome",function(){o._refreshGenome()}),this.model.on("change:file_size",function(){o._refreshFileSize()}),this.model.on("remove",function(){o.remove()}),this.app.collection.on("reset",function(){o.remove()}),o.model.set("row",o)},render:function(){var t=this.model.get("file_name"),n=this.model.get("file_size"),r=this.model.get("file_mode"),i=this.$el;i.find("#title").html(t),i.find("#size").html(e.bytesToString(n)),i.find("#mode").removeClass().addClass("mode");if(r=="new"){var s=i.find("#text"),o=this.options.padding,u=i.width()-2*o,a=i.height()-o;s.css("width",u+"px"),s.css("top",a+"px"),i.height(a+s.height()+2*o),s.show(),i.find("#mode").addClass("fa fa-pencil")}r=="local"&&i.find("#mode").addClass("fa fa-laptop"),r=="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 e=this.model.get("genome");this.select_genome.value(e)},_refreshInfo:function(){var e=this.model.get("info");e?this.$el.find("#info").html("<strong>Failed: </strong>"+e).show():this.$el.find("#info").hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$el.find(".progress-bar").css({width:e+"%"}),e!=100?this.$el.find("#percentage").html(e+"%"):this.$el.find("#percentage").html("Adding to history...")},_refreshStatus:function(){var e=this.$el,t=this.model.get("status"),n=this.status_classes[t],r=this.$el.find("#symbol");r.removeClass(),r.addClass(n),t=="init"?(this.select_genome.enable(),this.select_extension.enable(),e.find("#text-content").attr("disabled",!1),e.find("#space_to_tabs").attr("disabled",!1)):(this.select_genome.disable(),this.select_extension.disable(),e.find("#text-content").attr("disabled",!0),e.find("#space_to_tabs").attr("disabled",!0)),t=="success"&&(e.addClass("success"),e.find("#percentage").html("100%")),t=="error"&&(e.addClass("danger"),e.find(".progress").remove())},_refreshFileSize:function(){var t=this.model.get("file_size");this.$el.find("#size").html(e.bytesToString(t))},_removeRow:function(){var e=this.model.get("status");(e=="init"||e=="success"||e=="error")&&this.app.collection.remove(this.model)},_showExtensionInfo:function(){var e=$(this.el).find("#extension-info"),t=this.model.get("extension"),n=this.select_extension.text(),i=_.findWhere(this.app.list_extensions,{id:t});this.extension_popup||(this.extension_popup=new r.View({placement:"bottom",container:e})),this.extension_popup.visible?this.extension_popup.hide():(this.extension_popup.title(n),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(i)),this.extension_popup.show())},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append((new n(this)).$el),this.settings.show())},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(e){return'<tr id="upload-item-'+e.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(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
diff -r 693f01fe6a682a8b4934317a04c40c3919a3fbf6 -r b73cb7a7cdca3545d6347c5c4da24cfcc0841c2d 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","utils/uploadbox"],function(f,e,c,b,g,d,a){return Backbone.View.extend({options:{nginx_upload_path:""},modal:null,ui_button:null,uploadbox:null,current_history: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(i){var h=this;if(i){this.options=_.defaults(i,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(j){if(j){j.preventDefault();h.show()}},onunload:function(){if(h.counter.running>0){return"Several uploads are still processing."}}});$(".with-upload-button").append((new e.View(this.ui_button)).$el);var h=this;f.get({url:galaxy_config.root+"api/datatypes?extension_only=False",success:function(j){for(key in j){h.list_extensions.push({id:j[key].extension,text:j[key].extension,description:j[key].description,description_url:j[key].description_url})}h.list_extensions.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0});if(!h.options.datatypes_disable_auto){h.list_extensions.unshift(h.auto)}}});f.get({url:galaxy_config.root+"api/genomes",success:function(j){for(key in j){h.list_genomes.push({id:j[key][1],text:j[key][0]})}h.list_genomes.sort(function(l,k){return l.id>k.id?1:l.id<k.id?-1:0})}});this.collection.on("remove",function(j){h._eventRemove(j)});this.collection.on("change:genome",function(k){var j=k.get("genome");h.collection.each(function(l){if(l.get("status")=="init"&&l.get("genome")=="?"){l.set("genome",j)}})})},show:function(){var h=this;if(!Galaxy.currHistoryPanel||!Galaxy.currHistoryPanel.model){window.setTimeout(function(){h.show()},500);return}if(!this.modal){var h=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(){h.uploadbox.select()},"Choose FTP file":function(){h._eventFtp()},"Paste/Fetch data":function(){h._eventCreate()},Start:function(){h._eventStart()},Pause:function(){h._eventStop()},Reset:function(){h._eventReset()},Close:function(){h.modal.hide()},},height:"400",width:"900",closing_events:true});this.setElement("#upload-box");var h=this;this.uploadbox=this.$el.uploadbox({announce:function(j,k,l){h._eventAnnounce(j,k,l)},initialize:function(j,k,l){return h._eventInitialize(j,k,l)},progress:function(j,k,l){h._eventProgress(j,k,l)},success:function(j,k,l){h._eventSuccess(j,k,l)},error:function(j,k,l){h._eventError(j,k,l)},complete:function(){h._eventComplete()}});var i=this.modal.getButton("Choose FTP file");this.ftp=new d.View({title:"FTP files",container:i})}this.modal.show();this._updateUser();this._updateScreen()},_eventRemove:function(i){var h=i.get("status");if(h=="success"){this.counter.success--}else{if(h=="error"){this.counter.error--}else{this.counter.announce--}}this._updateScreen();this.uploadbox.remove(i.id)},_eventAnnounce:function(h,i,k){this.counter.announce++;this._updateScreen();var j=new b(this,{id:h,file_name:i.name,file_size:i.size,file_mode:i.mode,file_path:i.path});this.collection.add(j.model);$(this.el).find("tbody:first").append(j.$el);j.render()},_eventInitialize:function(m,j,s){var k=this.collection.get(m);k.set("status","running");var o=k.get("file_name");var n=k.get("file_path");var h=k.get("file_mode");var p=k.get("extension");var r=k.get("genome");var q=k.get("url_paste");var l=k.get("space_to_tabs");var i=k.get("to_posix_lines");if(!q&&!(j.size>0)){return null}this.uploadbox.configure({url:this.options.nginx_upload_path});if(h=="local"){this.uploadbox.configure({paramname:"files_0|file_data"})}else{this.uploadbox.configure({paramname:null})}tool_input={};if(h=="new"){tool_input["files_0|url_paste"]=q}if(h=="ftp"){tool_input["files_0|ftp_files"]=n}tool_input.dbkey=r;tool_input.file_type=p;tool_input["files_0|type"]="upload_dataset";tool_input["files_0|space_to_tab"]=l&&"Yes"||null;tool_input["files_0|to_posix_lines"]=i&&"Yes"||null;data={};data.history_id=this.current_history;data.tool_id="upload1";data.inputs=JSON.stringify(tool_input);return data},_eventProgress:function(i,j,h){var k=this.collection.get(i);k.set("percentage",h);this.ui_button.set("percentage",this._upload_percentage(h,j.size))},_eventSuccess:function(i,j,l){var k=this.collection.get(i);k.set("percentage",100);k.set("status","success");var h=k.get("file_size");this.ui_button.set("percentage",this._upload_percentage(100,h));this.upload_completed+=h*100;this.counter.announce--;this.counter.success++;this._updateScreen();Galaxy.currHistoryPanel.refreshContents()},_eventError:function(h,i,k){var j=this.collection.get(h);j.set("percentage",100);j.set("status","error");j.set("info",k);this.ui_button.set("percentage",this._upload_percentage(100,i.size));this.ui_button.set("status","danger");this.upload_completed+=i.size*100;this.counter.announce--;this.counter.error++;this._updateScreen()},_eventComplete:function(){this.collection.each(function(h){if(h.get("status")=="queued"){h.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 h=this;this.upload_size=0;this.upload_completed=0;this.collection.each(function(i){if(i.get("status")=="init"){i.set("status","queued");h.upload_size+=i.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.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(h,i){return(this.upload_completed+(h*i))/this.upload_size},_template:function(i,h){return'<div id="'+i+'" 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><h6 id="'+h+'" class="upload-info"></h6>'}})});
\ 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,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()}},_showSettings:function(){if(!this.settings.visible){this.settings.empty();this.settings.append((new UploadSettings(this)).$el);this.settings.show()}else{this.settings.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
https://bitbucket.org/galaxy/galaxy-central/commits/4da8605f69c8/
Changeset: 4da8605f69c8
Branch: upload-UI-enhancement
User: dannon
Date: 2015-01-23 16:12:35+00:00
Summary: Branch prune.
Affected #: 0 files
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/92258dc7b1e3/
Changeset: 92258dc7b1e3
User: dannon
Date: 2015-01-23 13:13:45+00:00
Summary: Add missing parameter in provenance controller.
Affected #: 1 file
diff -r fc8e37c905ef95395f3aeb2ea24f52d1a622015f -r 92258dc7b1e37eb21ad648724ffd1f3026fb59ab lib/galaxy/webapps/galaxy/api/provenance.py
--- a/lib/galaxy/webapps/galaxy/api/provenance.py
+++ b/lib/galaxy/webapps/galaxy/api/provenance.py
@@ -41,7 +41,7 @@
def _get_provenance( self, trans, item_class_name, item_id, follow=True ):
provenance_item = self.get_object( trans, item_id, item_class_name, check_ownership=False, check_accessible=False)
if item_class_name == "HistoryDatasetAssociation":
- self.hda_manager.error_unless_accessible( trans, provenance_item )
+ self.hda_manager.error_unless_accessible( trans, provenance_item, trans.user )
else:
self.security_check( trans, provenance_item, check_accessible=True )
out = self._get_record( trans, provenance_item, follow )
https://bitbucket.org/galaxy/galaxy-central/commits/58e5b7165b1a/
Changeset: 58e5b7165b1a
User: dannon
Date: 2015-01-23 13:14:02+00:00
Summary: Merge.
Affected #: 1 file
diff -r 92258dc7b1e37eb21ad648724ffd1f3026fb59ab -r 58e5b7165b1ad59d0547bf287e24988a3271449e templates/galaxy_client_app.mako
--- a/templates/galaxy_client_app.mako
+++ b/templates/galaxy_client_app.mako
@@ -83,7 +83,7 @@
users_api_controller = trans.webapp.api_controllers[ 'users' ]
tags_used = []
for tag in users_api_controller.get_user_tags_used( trans, user=trans.user ):
- tag = tag | h
+ tag = escape( tag )
if tag:
tags_used.append( tag )
user_dict[ 'tags_used' ] = tags_used
@@ -106,6 +106,8 @@
except Exception, exc:
pass
+ #TODO: no logging available?
+ #log.exception( exc )
return user_dict
%>
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.
1
0
commit/galaxy-central: carlfeberhard: Fix bootstrapped user data to use proper escaping (crap...) and allow history/hda tag to autocomplete again
by commits-noreply@bitbucket.org 22 Jan '15
by commits-noreply@bitbucket.org 22 Jan '15
22 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e5969ffd8f6b/
Changeset: e5969ffd8f6b
User: carlfeberhard
Date: 2015-01-22 23:55:37+00:00
Summary: Fix bootstrapped user data to use proper escaping (crap...) and allow history/hda tag to autocomplete again
Affected #: 1 file
diff -r fc8e37c905ef95395f3aeb2ea24f52d1a622015f -r e5969ffd8f6b548e064ee57d740e06f03ce7efc2 templates/galaxy_client_app.mako
--- a/templates/galaxy_client_app.mako
+++ b/templates/galaxy_client_app.mako
@@ -83,7 +83,7 @@
users_api_controller = trans.webapp.api_controllers[ 'users' ]
tags_used = []
for tag in users_api_controller.get_user_tags_used( trans, user=trans.user ):
- tag = tag | h
+ tag = escape( tag )
if tag:
tags_used.append( tag )
user_dict[ 'tags_used' ] = tags_used
@@ -106,6 +106,8 @@
except Exception, exc:
pass
+ #TODO: no logging available?
+ #log.exception( exc )
return user_dict
%>
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.
1
0
commit/galaxy-central: dannon: Resolve scope issues in visualization controller, add missing imports and organize.
by commits-noreply@bitbucket.org 22 Jan '15
by commits-noreply@bitbucket.org 22 Jan '15
22 Jan '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fc8e37c905ef/
Changeset: fc8e37c905ef
User: dannon
Date: 2015-01-22 23:24:25+00:00
Summary: Resolve scope issues in visualization controller, add missing imports and organize.
Affected #: 1 file
diff -r 0bedbfc59efdf459b62a70ee9da69449b1f12d45 -r fc8e37c905ef95395f3aeb2ea24f52d1a622015f lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -1,26 +1,25 @@
from __future__ import absolute_import
-import os
import copy
from sqlalchemy import desc, or_, and_
from paste.httpexceptions import HTTPNotFound, HTTPBadRequest
+from galaxy import managers
from galaxy import model, web
-from galaxy import managers
-from galaxy.model.item_attrs import UsesAnnotations, UsesItemRatings
-from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesVisualizationMixin
-from galaxy.web.framework.helpers import time_ago, grids, escape
from galaxy import util
from galaxy.datatypes.interval import Bed
+from galaxy.model.item_attrs import UsesAnnotations, UsesItemRatings
from galaxy.util.json import loads
from galaxy.util.sanitize_html import sanitize_html
-from galaxy.util import bunch
-from galaxy import util
from galaxy.visualization import registry
+from galaxy.visualization.data_providers.phyloviz import PhylovizDataProvider
+from galaxy.visualization.data_providers.genome import RawBedDataProvider
from galaxy.visualization.genomes import decode_dbkey
-from galaxy.visualization.data_providers.phyloviz import PhylovizDataProvider
from galaxy.visualization.genomes import GenomeRegion
+from galaxy.web import error
+from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesVisualizationMixin
+from galaxy.web.framework.helpers import escape, grids, time_ago
from .library import LibraryListGrid
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/501f5553f247/
Changeset: 501f5553f247
User: dannon
Date: 2015-01-22 23:18:14+00:00
Summary: misc cleanup, pep8 in page controller
Affected #: 1 file
diff -r 8ad3076155100bbc841efca1b4e4c91376e11568 -r 501f5553f24775044882d47f7e481f114eb092bb lib/galaxy/webapps/galaxy/controllers/page.py
--- a/lib/galaxy/webapps/galaxy/controllers/page.py
+++ b/lib/galaxy/webapps/galaxy/controllers/page.py
@@ -10,12 +10,14 @@
from galaxy.util.json import loads
from markupsafe import escape
+
def format_bool( b ):
if b:
return "yes"
else:
return ""
+
class PageListGrid( grids.Grid ):
# Custom column.
class URLColumn( grids.PublicURLColumn ):
@@ -26,7 +28,7 @@
use_panels = True
title = "Pages"
model_class = model.Page
- default_filter = { "published" : "All", "tags" : "All", "title" : "All", "sharing" : "All" }
+ default_filter = { "published": "All", "tags": "All", "title": "All", "sharing": "All" }
default_sort_key = "-update_time"
columns = [
grids.TextColumn( "Title", key="title", attach_popup=True, filterable="advanced" ),
@@ -37,12 +39,11 @@
grids.GridColumn( "Created", key="create_time", format=time_ago ),
grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
]
- columns.append(
- grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[2] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ columns.append( grids.MulticolFilterColumn(
+ "Search",
+ cols_to_filter=[ columns[0], columns[2] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
global_actions = [
grids.GridAction( "Add new page", dict( action='create' ) )
]
@@ -53,9 +54,11 @@
grids.GridOperation( "Share or Publish", allow_multiple=False, condition=( lambda item: not item.deleted ), async_compatible=False ),
grids.GridOperation( "Delete", confirm="Are you sure you want to delete this page?" ),
]
+
def apply_query_filter( self, trans, query, **kwargs ):
return query.filter_by( user=trans.user, deleted=False )
+
class PageAllPublishedGrid( grids.Grid ):
# Grid definition
use_panels = True
@@ -74,15 +77,18 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search title, annotation, owner, and tags",
- cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search title, annotation, owner, and tags",
+ cols_to_filter=[ columns[0], columns[1], columns[2], columns[4] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
def build_initial_query( self, trans, **kwargs ):
# Join so that searching history.user makes sense.
return trans.sa_session.query( self.model_class ).join( model.User.table )
+
def apply_query_filter( self, trans, query, **kwargs ):
- return query.filter( self.model_class.deleted==False ).filter( self.model_class.published==True )
+ return query.filter( self.model_class.deleted == False ).filter( self.model_class.published == True )
+
class ItemSelectionGrid( grids.Grid ):
""" Base class for pages' item selection grids. """
@@ -97,7 +103,7 @@
# Grid definition.
show_item_checkboxes = True
template = "/page/select_items_grid.mako"
- default_filter = { "deleted" : "False" , "sharing" : "All" }
+ default_filter = { "deleted": "False" , "sharing": "All" }
default_sort_key = "-update_time"
use_async = True
use_paging = True
@@ -106,6 +112,7 @@
def apply_query_filter( self, trans, query, **kwargs ):
return query.filter_by( user=trans.user )
+
class HistorySelectionGrid( ItemSelectionGrid ):
""" Grid for selecting histories. """
# Grid definition.
@@ -121,14 +128,15 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[1] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
def apply_query_filter( self, trans, query, **kwargs ):
return query.filter_by( user=trans.user, purged=False )
+
class HistoryDatasetAssociationSelectionGrid( ItemSelectionGrid ):
""" Grid for selecting HDAs. """
# Grid definition.
@@ -144,10 +152,11 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[1] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
def apply_query_filter( self, trans, query, **kwargs ):
# To filter HDAs by user, need to join HDA and History table and then filter histories by user. This is necessary because HDAs do not have
# a user relation.
@@ -169,10 +178,11 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[1] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
class PageSelectionGrid( ItemSelectionGrid ):
""" Grid for selecting pages. """
@@ -189,10 +199,11 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[1] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
class VisualizationSelectionGrid( ItemSelectionGrid ):
""" Grid for selecting visualizations. """
@@ -208,10 +219,11 @@
]
columns.append(
grids.MulticolFilterColumn(
- "Search",
- cols_to_filter=[ columns[0], columns[2] ],
- key="free-text-search", visible=False, filterable="standard" )
- )
+ "Search",
+ cols_to_filter=[ columns[0], columns[2] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
+
class _PageContentProcessor( _BaseHTMLProcessor ):
""" Processes page content to produce HTML that is suitable for display. For now, processor renders embedded objects. """
@@ -276,6 +288,7 @@
# Default behavior:
_BaseHTMLProcessor.unknown_endtag( self, tag )
+
class PageController( BaseUIController, SharableMixin,
UsesStoredWorkflowMixin, UsesVisualizationMixin, UsesItemRatings ):
@@ -309,7 +322,7 @@
return self.sharing( trans, **kwargs )
session.flush()
- #HACK: to prevent the insertion of an entire html document inside another
+ # HACK: to prevent the insertion of an entire html document inside another
kwargs[ 'embedded' ] = True
# Build grid HTML.
grid = self._page_list( trans, *args, **kwargs )
@@ -336,7 +349,6 @@
# Render grid wrapped in panels
return trans.fill_template( "page/list_published.mako", embedded_grid=grid )
-
@web.expose
@web.require_login( "create pages" )
def create( self, trans, page_title="", page_slug="", page_annotation="" ):
@@ -373,7 +385,7 @@
session.add( page )
session.flush()
# Display the management page
- ## trans.set_message( "Page '%s' created" % page.title )
+ # trans.set_message( "Page '%s' created" % page.title )
return trans.response.send_redirect( web.url_for(controller='page', action='list' ) )
return trans.show_form(
web.FormBuilder( web.url_for(controller='page', action='create'), "Create new page", submit_text="Submit" )
@@ -520,8 +532,8 @@
trans.set_message( "Page '%s' shared with user '%s'" % ( page_title, other_email ) )
return trans.response.send_redirect( url_for( controller='page', action='sharing', id=id ) )
return trans.fill_template( "/ind_share_base.mako",
- message = msg,
- messagetype = mtype,
+ message=msg,
+ messagetype=mtype,
item=page,
email=email,
use_panels=use_panels )
@@ -614,8 +626,11 @@
# Output is string, so convert to unicode for display.
page_content = unicode( processor.output(), 'utf-8' )
- return trans.fill_template_mako( "page/display.mako", item=page, item_data=page_content,
- user_item_rating = user_item_rating, ave_item_rating=ave_item_rating, num_ratings=num_ratings,
+ return trans.fill_template_mako( "page/display.mako", item=page,
+ item_data=page_content,
+ user_item_rating=user_item_rating,
+ ave_item_rating=ave_item_rating,
+ num_ratings=num_ratings,
content_only=True )
@web.expose
@@ -645,7 +660,7 @@
return trans.show_error_message( "The specified page does not exist." )
# Rate page.
- page_rating = self.rate_item( trans.sa_session, trans.get_user(), page, rating )
+ self.rate_item( trans.sa_session, trans.get_user(), page, rating )
return self.get_ave_item_rating_data( trans.sa_session, page )
@@ -667,7 +682,10 @@
if self.create_item_slug( trans.sa_session, page ):
trans.sa_session.flush()
- return_dict = { "name" : page.title, "link" : url_for(controller='page', action="display_by_username_and_slug", username=page.user.username, slug=page.slug ) }
+ return_dict = { "name": page.title, "link": url_for(controller='page',
+ action="display_by_username_and_slug",
+ username=page.user.username,
+ slug=page.slug ) }
return return_dict
@web.expose
@@ -727,7 +745,7 @@
"""
Returns html suitable for embedding in another page.
"""
- #TODO: should be moved to history controller and/or called via ajax from the template
+ # TODO: should be moved to history controller and/or called via ajax from the template
decoded_id = self.decode_id( id )
# histories embedded in pages are set to importable when embedded, check for access here
history = self.history_manager.get_accessible( trans, decoded_id, trans.user )
@@ -740,11 +758,13 @@
# include all datasets: hidden, deleted, and purged
history_data = self.history_manager._get_history_data( trans, history )
history_dictionary = history_data[ 'history' ]
- hda_dictionaries = history_data[ 'contents' ]
+ hda_dictionaries = history_data[ 'contents' ]
history_dictionary[ 'annotation' ] = history.annotation
filled = trans.fill_template( "history/embed.mako", item=history,
- user_is_owner=user_is_owner, history_dict=history_dictionary, hda_dicts=hda_dictionaries )
+ user_is_owner=user_is_owner,
+ history_dict=history_dictionary,
+ hda_dicts=hda_dictionaries )
return filled
def _get_embedded_visualization_html( self, trans, id ):
@@ -757,15 +777,16 @@
return None
# Fork to template based on visualization.type (registry or builtin).
- if( ( trans.app.visualizations_registry and visualization.type in trans.app.visualizations_registry.plugins )
- and ( visualization.type not in trans.app.visualizations_registry.BUILT_IN_VISUALIZATIONS ) ):
+ if(( trans.app.visualizations_registry and visualization.type in trans.app.visualizations_registry.plugins )
+ and ( visualization.type not in trans.app.visualizations_registry.BUILT_IN_VISUALIZATIONS ) ):
# if a registry visualization, load a version into an iframe :(
- #TODO: simplest path from A to B but not optimal - will be difficult to do reg visualizations any other way
- #TODO: this will load the visualization twice (once above, once when the iframe src calls 'saved')
+ # TODO: simplest path from A to B but not optimal - will be difficult to do reg visualizations any other way
+ # TODO: this will load the visualization twice (once above, once when the iframe src calls 'saved')
encoded_visualization_id = trans.security.encode_id( visualization.id )
return trans.fill_template( 'visualization/embed_in_frame.mako',
- item=visualization, encoded_visualization_id=encoded_visualization_id,
- content_only=True )
+ item=visualization,
+ encoded_visualization_id=encoded_visualization_id,
+ content_only=True )
return trans.fill_template( "visualization/embed.mako", item=visualization, item_data=None )
@@ -797,6 +818,3 @@
elif item_class == model.Page:
pass
-
-
-
https://bitbucket.org/galaxy/galaxy-central/commits/0bedbfc59efd/
Changeset: 0bedbfc59efd
User: dannon
Date: 2015-01-22 23:19:08+00:00
Summary: Remove a trailing semicolon in the page controller.
Affected #: 1 file
diff -r 501f5553f24775044882d47f7e481f114eb092bb -r 0bedbfc59efdf459b62a70ee9da69449b1f12d45 lib/galaxy/webapps/galaxy/controllers/page.py
--- a/lib/galaxy/webapps/galaxy/controllers/page.py
+++ b/lib/galaxy/webapps/galaxy/controllers/page.py
@@ -640,7 +640,7 @@
page = self.get_page( trans, id )
# Only set if importable value would change; this prevents a change in the update_time unless attribute really changed.
- importable = accessible in ['True', 'true', 't', 'T'];
+ importable = accessible in ['True', 'true', 't', 'T']
if page.importable != importable:
if importable:
self._make_item_accessible( trans.sa_session, page )
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.
1
0