3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8e0034733cf9/ Changeset: 8e0034733cf9 Branch: next-stable User: jmchilton Date: 2014-05-22 18:01:04 Summary: Fix GUI for f24bb5d. Affected #: 1 file diff -r 316db249f068ded4e541415232b480250c7cdd56 -r 8e0034733cf936643078de18f77394256e55001d static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -667,8 +667,8 @@ if( ids.length != 2 ){ // TODO: Do something... } - element_identifiers.push( { name: "left", src: "hda", id: ids[ 0 ] } ); - element_identifiers.push( { name: "right", src: "hda", id: ids[ 1 ] } ); + element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } ); + element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } ); name = "New Dataset Pair"; } options.data = {type: "dataset_collection", https://bitbucket.org/galaxy/galaxy-central/commits/f0a5e3666e84/ Changeset: f0a5e3666e84 Branch: next-stable User: jmchilton Date: 2014-05-22 18:02:05 Summary: Pack scripts. Affected #: 1 file diff -r 8e0034733cf936643078de18f77394256e55001d -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 static/scripts/packed/mvc/dataset/hda-model.js --- a/static/scripts/packed/mvc/dataset/hda-model.js +++ b/static/scripts/packed/mvc/dataset/hda-model.js @@ -1,1 +1,1 @@ -define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"left",src:"hda",id:o[0]});q.push({name:"right",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}}); \ No newline at end of file +define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}}); \ No newline at end of file https://bitbucket.org/galaxy/galaxy-central/commits/cc19c4caa043/ Changeset: cc19c4caa043 User: jmchilton Date: 2014-05-22 18:02:17 Summary: Merge next-stable. Affected #: 2 files diff -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 -r cc19c4caa0434bd871b390a64113ad735c4ba223 static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -667,8 +667,8 @@ if( ids.length != 2 ){ // TODO: Do something... } - element_identifiers.push( { name: "left", src: "hda", id: ids[ 0 ] } ); - element_identifiers.push( { name: "right", src: "hda", id: ids[ 1 ] } ); + element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } ); + element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } ); name = "New Dataset Pair"; } options.data = {type: "dataset_collection", diff -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 -r cc19c4caa0434bd871b390a64113ad735c4ba223 static/scripts/packed/mvc/dataset/hda-model.js --- a/static/scripts/packed/mvc/dataset/hda-model.js +++ b/static/scripts/packed/mvc/dataset/hda-model.js @@ -1,1 +1,1 @@ -define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"left",src:"hda",id:o[0]});q.push({name:"right",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}}); \ No newline at end of file +define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}}); \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.