diff --git a/client/galaxy/scripts/mvc/library/library-folderrow-view.js b/client/galaxy/scripts/mvc/library/library-folderrow-view.js index 6c357d1458d..c58080c7853 100644 --- a/client/galaxy/scripts/mvc/library/library-folderrow-view.js +++ b/client/galaxy/scripts/mvc/library/library-folderrow-view.js @@ -66,7 +66,7 @@ var FolderRowView = Backbone.View.extend({ var dataset_id = $(event.target).closest('tr')[0].id; var dataset = Galaxy.libraries.folderListView.collection.get(dataset_id); dataset.url = dataset.urlRoot + dataset.id + '?undelete=true'; - dataset.destroy({ + dataset.destroy({ success : function(model, response){ Galaxy.libraries.folderListView.collection.remove(dataset_id); var updated_dataset = new mod_library_model.Item(response); @@ -76,7 +76,7 @@ var FolderRowView = Backbone.View.extend({ var folder_id = that.model.get('folder_id'); window.location='#folders/' + folder_id + '/datasets/' + that.id; }}); - }, + }, error : function(model, response){ if (typeof response.responseJSON !== "undefined"){ mod_toastr.error('Dataset was not undeleted. ' + response.responseJSON.err_msg); @@ -103,7 +103,7 @@ var FolderRowView = Backbone.View.extend({ Galaxy.libraries.folderListView.collection.add(updated_folder); Galaxy.libraries.folderListView.collection.sortByNameAsc(); mod_toastr.success('Folder undeleted.'); - }, + }, error : function(model, response){ if (typeof response.responseJSON !== "undefined"){ mod_toastr.error('Folder was not undeleted. ' + response.responseJSON.err_msg); @@ -157,7 +157,7 @@ var FolderRowView = Backbone.View.extend({ tmpl_array.push(''); return _.template(tmpl_array.join('')); - }, + }, templateRowDeletedFile: function(){ tmpl_array = []; @@ -180,7 +180,7 @@ var FolderRowView = Backbone.View.extend({ templateRowDeletedFolder: function(){ tmpl_array = []; - tmpl_array.push(''); + tmpl_array.push(''); tmpl_array.push(' '); tmpl_array.push(' '); tmpl_array.push(' '); @@ -196,7 +196,7 @@ var FolderRowView = Backbone.View.extend({ return _.template(tmpl_array.join('')); } - + }); return { diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index b81a839ed7b..785b2410233 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -63,7 +63,7 @@ var FolderToolbarView = Backbone.View.extend({ ' to set your data to the format you think it should be.' + ' You can also upload compressed files, which will automatically be decompressed.' }, - + // genomes list_genomes : [], @@ -99,7 +99,7 @@ var FolderToolbarView = Backbone.View.extend({ renderPaginator: function( options ){ this.options = _.extend( this.options, options ); var paginator_template = this.templatePaginator(); - this.$el.find( '#folder_paginator' ).html( paginator_template({ + this.$el.find( '#folder_paginator' ).html( paginator_template({ id: this.options.id, show_page: parseInt( this.options.show_page ), page_count: parseInt( this.options.page_count ), @@ -163,7 +163,7 @@ var FolderToolbarView = Backbone.View.extend({ var folder = new mod_library_model.FolderAsModel(); url_items = Backbone.history.fragment.split('/'); current_folder_id = url_items[url_items.length-1]; - folder.url = folder.urlRoot + '/' + current_folder_id ; + folder.url = folder.urlRoot + current_folder_id ; folder.save(folderDetails, { success: function (folder) { @@ -281,7 +281,7 @@ var FolderToolbarView = Backbone.View.extend({ } this.initChainCallControl( { length: datasets_to_import.length, action: 'to_history', history_name: history_name } ); - // set the used history as current so user will see the last one + // set the used history as current so user will see the last one // that he imported into in the history panel on the 'analysis' page jQuery.getJSON( galaxy_config.root + 'history/set_as_current?id=' + history_id ); this.chainCallImportingIntoHistory( datasets_to_import, history_name ); @@ -360,7 +360,7 @@ var FolderToolbarView = Backbone.View.extend({ Galaxy.libraries.library_router.back(); } }); - + // user should always have a history, even anonymous user if (self.histories.models.length > 0){ self.fetchAndDisplayHistoryContents(self.histories.models[0].id); @@ -393,7 +393,7 @@ var FolderToolbarView = Backbone.View.extend({ // TODO: should not trigger routes outside of the router Galaxy.libraries.library_router.navigate( 'folders/' + that.id, { trigger: true } ); } - }); + }); this.renderSelectBoxes(); }, @@ -439,7 +439,7 @@ var FolderToolbarView = Backbone.View.extend({ renderSelectBoxes: function(){ // This won't work properly unlesss we already have the data fetched. // See this.fetchExtAndGenomes() - // TODO switch to common resources: + // TODO switch to common resources: // https://trello.com/c/dIUE9YPl/1933-ui-common-resources-and-data-into-galaxy-object var that = this; this.select_genome = new mod_select.View( { @@ -469,7 +469,7 @@ var FolderToolbarView = Backbone.View.extend({ title : 'Please select folders or files', body : template_modal({}), buttons : { - 'Import' : function() { + 'Import' : function() { that.importFromJstreePath( that, options ); }, 'Close' : function() { @@ -503,7 +503,7 @@ var FolderToolbarView = Backbone.View.extend({ that.renderJstree( options ); } } - ); + ); }, /** @@ -518,9 +518,9 @@ var FolderToolbarView = Backbone.View.extend({ var target = options.source || 'userdir'; var disabled_jstree_element = this.options.disabled_jstree_element; this.jstree = new mod_library_model.Jstree(); - this.jstree.url = this.jstree.urlRoot + - '?target=' + target + - '&format=jstree' + + this.jstree.url = this.jstree.urlRoot + + '?target=' + target + + '&format=jstree' + '&disable=' + disabled_jstree_element; this.jstree.fetch({ success: function(model, response){ @@ -583,8 +583,8 @@ var FolderToolbarView = Backbone.View.extend({ }; this.initChainCallControl( { length: valid_paths.length, action: 'adding_datasets' } ); this.chainCallImportingFolders( { paths: valid_paths, - preserve_dirs: preserve_dirs, - link_data: link_data, + preserve_dirs: preserve_dirs, + link_data: link_data, source: 'admin_path', file_type: file_type, dbkey: dbkey } ); @@ -626,9 +626,9 @@ var FolderToolbarView = Backbone.View.extend({ /** * Take the selected items from the jstree, create a request queue - * and send them one by one to the server for importing into - * the current folder. - * + * and send them one by one to the server for importing into + * the current folder. + * * jstree.js has to be loaded before * @see renderJstree */ @@ -653,8 +653,8 @@ var FolderToolbarView = Backbone.View.extend({ if ( selection_type === 'folder' ){ var full_source = options.source + '_folder'; this.chainCallImportingFolders( { paths: paths, - preserve_dirs: preserve_dirs, - link_data: link_data, + preserve_dirs: preserve_dirs, + link_data: link_data, source: full_source, file_type: file_type, dbkey: dbkey } ); @@ -767,7 +767,7 @@ var FolderToolbarView = Backbone.View.extend({ } return true; } - var promise = $.when( $.post( ( window.galaxy_config ? galaxy_config.root : '/' ) + 'api/libraries/datasets?encoded_folder_id=' + that.id + + var promise = $.when( $.post( ( window.galaxy_config ? galaxy_config.root : '/' ) + 'api/libraries/datasets?encoded_folder_id=' + that.id + '&source=' + options.source + '&path=' + popped_item + '&file_type=' + options.file_type + @@ -789,7 +789,7 @@ var FolderToolbarView = Backbone.View.extend({ * @param {array} paths paths relative to Galaxy root folder * @param {boolean} preserve_dirs indicates whether to preserve folder structure * @param {boolean} link_data copy files to Galaxy or link instead - * @param {str} source string representing what type of folder + * @param {str} source string representing what type of folder * is the source of import */ chainCallImportingFolders: function( options ){ @@ -825,7 +825,7 @@ var FolderToolbarView = Backbone.View.extend({ }, /** - * Take the array of hdas and create a request for each. + * Take the array of hdas and create a request for each. * Call them in chain and update progress bar in between each. * @param {array} hdas_set array of empty hda objects */ @@ -859,7 +859,7 @@ var FolderToolbarView = Backbone.View.extend({ }, /** - * Take the array of lddas, create request for each and + * Take the array of lddas, create request for each and * call them in chain. Update progress bar in between each. * @param {array} lddas_set array of lddas to delete */ @@ -953,7 +953,7 @@ var FolderToolbarView = Backbone.View.extend({ var items_total = dataset_ids.length + folder_ids.length this.progressStep = 100 / items_total; this.progress = 0; - + // prepare the dataset items to be added var items_to_delete = []; for (var i = dataset_ids.length - 1; i >= 0; i--) { @@ -1017,7 +1017,7 @@ var FolderToolbarView = Backbone.View.extend({ case "importdir": this.importFilesFromGalaxyFolderModal( { source: 'importdir' } ); break; - case "path": + case "path": this.importFilesFromPathModal(); break; case "userdir": @@ -1215,7 +1215,7 @@ var FolderToolbarView = Backbone.View.extend({ tmpl_array.push('
All files you select will be imported into the current folder.
'); tmpl_array.push(''); - + tmpl_array.push('
'); tmpl_array.push('