diff --git a/client/galaxy/scripts/mvc/history/copy-dialog.js b/client/galaxy/scripts/mvc/history/copy-dialog.js
index ca9354ee6f2..4a6ef869a40 100644
--- a/client/galaxy/scripts/mvc/history/copy-dialog.js
+++ b/client/galaxy/scripts/mvc/history/copy-dialog.js
@@ -79,10 +79,12 @@ var CopyDialog = {
defaultCopyName = defaultCopyNameFn({ name: history.get( 'name' ) }),
// TODO: these two might be simpler as one 3 state option (all,active,no-choice)
defaultCopyWhat = options.allDatasets? 'copy-all' : 'copy-non-deleted',
- allowAll = !_.isUndefined( options.allowAll )? options.allowAll : true;
+ allowAll = !_.isUndefined( options.allowAll )? options.allowAll : true,
+ autoClose = !_.isUndefined( options.autoClose )? options.autoClose : true;
this.modal = modal;
+
// validate the name and copy if good
function checkNameAndCopy(){
var name = modal.$( '#copy-modal-title' ).val();
@@ -104,7 +106,7 @@ var CopyDialog = {
deferred.rejectWith( deferred, arguments );
})
.always( function(){
- modal.hide();
+ if( autoClose ){ modal.hide(); }
});
}
diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index 606f75a6659..0d619b6a77f 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1203,6 +1203,7 @@ class History( object, Dictifiable, UsesAnnotations, HasName ):
# Create new history.
if not name:
name = self.name
+ # wut. If it's an anon user, the target user becomes the original owner??
if not target_user:
target_user = self.user
quota = True
@@ -1213,10 +1214,6 @@ class History( object, Dictifiable, UsesAnnotations, HasName ):
db_session.add( new_history )
db_session.flush()
- print '-' * 40
- print 'target_user:', target_user, target_user.username, target_user.email
- print '-' * 40
-
# copy history tags and annotations (if copying user is not anonymous)
if target_user:
self.copy_item_annotation( db_session, self.user, self, target_user, new_history )
diff --git a/static/maps/mvc/history/copy-dialog.js.map b/static/maps/mvc/history/copy-dialog.js.map
index 69ab4121769..9c9d8ad6996 100644
--- a/static/maps/mvc/history/copy-dialog.js.map
+++ b/static/maps/mvc/history/copy-dialog.js.map
@@ -1 +1 @@
-{"version":3,"file":"copy-dialog.js","sources":["../../../src/mvc/history/copy-dialog.js"],"names":["define","MODAL","_l","CopyDialog","defaultName","_","template","title","submitLabel","errorMessage","progressive","activeLabel","allLabel","anonWarning","_template","join","_showAjaxIndicator","indicator","this","modal","$","empty","append","css","margin-top","dialog","history","options","checkNameAndCopy","name","val","show","copyAllDatasets","prop","copy","done","response","deferred","resolve","fail","alert","rejectWith","arguments","always","hide","jQuery","Deferred","defaultCopyNameFn","nameFn","defaultCopyName","get","defaultCopyWhat","allDatasets","allowAll","isUndefined","originalClosingCallback","closing_callback","extend","body","isAnon","Galaxy","user","isAnonymous","copyWhat","buttons","object","height","closing_events","cancelled","reject","focus","select","on","ev","keyCode","preventDefault","ImportDialog","historyCopyDialog","window","parent","View","useImport"],"mappings":"AAAAA,QACI,kBACA,sBACD,SAAUC,EAAOC,GAEpB,YAOA,IAAIC,IAGAC,YAAkBC,EAAEC,SAAU,yBAC9BC,MAAkBF,EAAEC,SAAUJ,EAAI,mBAAsB,kBACxDM,YAAkBN,EAAI,QACtBO,aAAkBP,EAAI,+BACtBQ,YAAkBR,EAAI,mBACtBS,YAAkBT,EAAI,8CACtBU,SAAkBV,EAAI,4CACtBW,YAAkBX,EAAI,2FACJA,EAAI,gCAGtBY,UAAYT,EAAEC,UAGV,sBACI,+BACI,qBACAJ,EAAI,WACJ,0BAA2BA,EAAI,cAAgB,QAASA,EAAI,MAAQ,IACpE,2BAA4BA,EAAI,iBAAmB,QACvD,SACJ,UACA,SACI,iCACIA,EAAI,qCAAuC,IAC/C,iBAGA,+FACA,iGACIA,EAAI,sCACR,OAEA,wBACI,SACA,MAAOA,EAAI,+DAAiE,OAE5E,uFACI,uEACJ,4DACA,SACA,uEACI,+DACJ,iDACJ,UACJ,WACFa,KAAM,KAGRC,mBAAqB,WACjB,GAAIC,GAAY,kDAAoDC,KAAKR,YAAc,SACvFQ,MAAKC,MAAMC,EAAG,eAAgBC,QAAQC,OAAQL,GAAYM,KAA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GACAA,EAAyBa,OAMzCjD,EAAMC,EAAG,qBAAsBkD,QAAQC,SACvCpD,EAAMC,EAAG,qBAAsBoD,GAAI,UAAW,SAAUC,GACjC,KAAfA,EAAGC,UACHD,EAAGE,iBACH/C,OAIDS,IASXuC,EAAevE,EAAEoD,UAAYtD,GAC7BC,YAAkBC,EAAEC,SAAU,yBAC9BC,MAAkBF,EAAEC,SAAUJ,EAAI,qBAAwB,kBAC1DM,YAAkBN,EAAI,UACtBO,aAAkBP,EAAI,iCACtBQ,YAAkBR,EAAI,qBACtBS,YAAkBT,EAAI,gDACtBU,SAAkBV,EAAI,8CACtBW,YAAkBX,EAAI,2FACJA,EAAI,oCAoBtB2E,EAAoB,SAAUnD,EAASC,GACvCA,EAAUA,KAEV,IAAIR,GAAQ2D,OAAOC,OAAOnB,OAAOzC,OAAS,GAAIlB,GAAM+E,QACpD,OAAOrD,GAAQsD,UACXL,EAAanD,OAAQN,EAAOO,EAASC,GACrCxB,EAAWsB,OAAQN,EAAOO,EAASC,GAKvC,OAAOkD"}
\ No newline at end of file
+{"version":3,"file":"copy-dialog.js","sources":["../../../src/mvc/history/copy-dialog.js"],"names":["define","MODAL","_l","CopyDialog","defaultName","_","template","title","submitLabel","errorMessage","progressive","activeLabel","allLabel","anonWarning","_template","join","_showAjaxIndicator","indicator","this","modal","$","empty","append","css","margin-top","dialog","history","options","checkNameAndCopy","name","val","show","copyAllDatasets","prop","copy","done","response","deferred","resolve","fail","alert","rejectWith","arguments","always","autoClose","hide","jQuery","Deferred","defaultCopyNameFn","nameFn","defaultCopyName","get","defaultCopyWhat","allDatasets","allowAll","isUndefined","originalClosingCallback","closing_callback","extend","body","isAnon","Galaxy","user","isAnonymous","copyWhat","buttons","object","height","closing_events","cancelled","reject","focus","select","on","ev","keyCode","preventDefault","ImportDialog","historyCopyDialog","window","parent","View","useImport"],"mappings":"AAAAA,QACI,kBACA,sBACD,SAAUC,EAAOC,GAEpB,YAOA,IAAIC,IAGAC,YAAkBC,EAA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AO1C,OAAS,GAAIlB,GAAMgF,QACpD,OAAOtD,GAAQuD,UACXL,EAAapD,OAAQN,EAAOO,EAASC,GACrCxB,EAAWsB,OAAQN,EAAOO,EAASC,GAKvC,OAAOmD"}
\ No newline at end of file
diff --git a/static/maps/mvc/tool/tools-form-base.js.map b/static/maps/mvc/tool/tools-form-base.js.map
index 5772dad9d56..89d5e6b947e 100644
--- a/static/maps/mvc/tool/tools-form-base.js.map
+++ b/static/maps/mvc/tool/tools-form-base.js.map
@@ -1 +1 @@
-{"version":3,"file":"tools-form-base.js","sources":["../../../src/mvc/tool/tools-form-base.js"],"names":["define","Utils","Deferred","Ui","Form","ToolTemplate","CitationModel","CitationView","Backbone","View","extend","initialize","options","this","merge","setElement","deferred","inputs","_buildForm","self","execute","process","_buildModel","remove","$el","hide","prototype","call","Galaxy","emit","debug","icon","title","name","description","version","operations","_operations","onchange","reset","_updateModel","customize","form","_footer","empty","append","hide_message","id","build_url","build_data","job_id","root","params","tool_id","$","request","type","url","data","success","new_model","message","update","status","persistent","resolve","error","response","error_message","err_msg","is","prepend","Message","large","modal","show","body","buttons","Close","reject","model_url","update_url","current_state","tool_version","create","wait","versions_button","ButtonMenu","narrow","tooltip","is_workflow","versions","length","i","addMenu","onclick","replace","menu_button","biostar_url","window","open","prompt","location","origin","user","get","href","download","requirements","visible","sharable_url","menu","help","citations","$citations","ToolCitationCollection","citation_list_view","CitationListView","el","collection","render","fetch"],"mappings":"AAGAA,QAAQ,cAAe,iBAAkB,iBAAkB,qBACnD,0BAA2B,8BAA+B,8BAC9D,SAASC,EAAOC,EAAUC,EAAIC,EAAMC,EAAcC,EAAeC,GAGjE,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GASjB,GARAC,KAAKD,QAAUX,EAAMa,MAAMF,MAC3BC,KAAKE,WAAW,UAIhBF,KAAKG,SAAW,GAAId,GAGhBU,EAAQK,OACRJ,KAAKK,WAAWN,OACb,CACH,GAAIO,GAAON,IACXA,MAAKG,SAAS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oCF,OAAOG,SAASC,OAAS3E,OAAOuB,KAAO,gBAAkBvC,EAAQmC,OAKhHnB,OAAO4E,MAAQ5E,OAAO4E,KAAKC,IAAI,aAC/BR,EAAYH,SACR/D,KAAU,cACVC,MAAU,WACVyD,QAAU,qBACViB,KAAU9E,OAAOuB,KAAO,aAAevC,EAAQmC,GAAK,YACpD4D,SAAU/F,EAAQmC,KAKtBnC,EAAQgG,cAAgBhG,EAAQgG,aAAahB,OAAS,GACtDK,EAAYH,SACR/D,KAAU,iBACVC,MAAU,eACVyD,QAAU,4BACVM,QAAU,WACDlF,KAAKgG,SAQNhG,KAAKgG,SAAU,EACf1F,EAAKuB,KAAKmB,QAAQC,QACdD,QAAc,OATlBhD,KAAKgG,SAAU,EACf1F,EAAKuB,KAAKmB,QAAQC,QACdE,YAAc,EACdH,QAAcxD,EAAauG,aAAahG,GACxCmD,OAAc,aAa9BnD,EAAQkG,cACRb,EAAYH,SACR/D,KAAU,mBACVC,MAAU,mBACVyD,QAAU,wBACVM,QAAU,WACNI,OAAOC,KAAKxF,EAAQkG,kBAO5BC,KAAcd,EACdN,SAAcL,IAKtB3C,QAAS,WAEL,GAAI/B,GAAUC,KAAKD,OAQnB,IALoB,IAAhBA,EAAQoG,MACRnG,KAAK6B,KAAKlB,IAAIqB,OAAOxC,EAAa2G,KAAKpG,IAIvCA,EAAQqG,UAAW,CACnB,GAAIC,GAAa5D,EAAE,UACf2D,EAAY,GAAI3G,GAAc6G,sBAClCF,GAAU5D,QAAUzC,EAAQmC,EAC5B,IAAIqE,GAAqB,GAAI7G,GAAa8G,kBAAmBC,GAAIJ,EAAYK,WAAYN,GACzFG,GAAmBI,SACnBP,EAAUQ,QACV5G,KAAK6B,KAAKlB,IAAIqB,OAAOqE"}
\ No newline at end of file
+{"version":3,"file":"tools-form-base.js","sources":["../../../src/mvc/tool/tools-form-base.js"],"names":["define","Utils","Deferred","Ui","Form","ToolTemplate","CitationModel","CitationView","Backbone","View","extend","initialize","options","this","merge","setElement","deferred","inputs","_buildForm","self","execute","process","_buildModel","remove","$el","hide","prototype","call","Galaxy","emit","debug","icon","title","name","description","version","operations","_operations","onchange","reset","_updateModel","customize","form","_footer","empty","append","hide_message","id","build_url","build_data","job_id","root","params","tool_id","$","request","type","url","data","success","new_model","message","update","status","persistent","resolve","error","response","error_message","err_msg","is","prepend","Message","large","modal","show","body","buttons","Close","reject","model_url","update_url","current_state","tool_version","create","wait","versions_button","ButtonMenu","narrow","tooltip","is_workflow","versions","length","i","addMenu","onclick","replace","menu_button","biostar_url","window","open","prompt","location","origin","user","get","href","download","requirements","visible","sharable_url","menu","help","citations","$citations","ToolCitationCollection","citation_list_view","CitationListView","el","collection","render","fetch"],"mappings":"AAGAA,QAAQ,cAAe,iBAAkB,iBAAkB,qBACnD,0BAA2B,8BAA+B,8BAC9D,SAASC,EAAOC,EAAUC,EAAIC,EAAMC,EAAcC,EAAeC,GAGjE,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GASjB,GARAC,KAAKD,QAAUX,EAAMa,MAAMF,MAC3BC,KAAKE,WAAW,UAIhBF,KAAKG,SAAW,GAAId,GAGhBU,EAAQK,OACRJ,KAAKK,WAAWN,OACb,CACH,GAAIO,GAAON,IACXA,MAAKG,SAASI,QAAQ,SAASC,GAC3BF,EAAKG,YAAYD,EAAST,GAAS,OAM/CW,OAAQ,WACJ,GAAIJ,GAAON,IACXA,MAAKW,IAAIC,OACTZ,KAAKG,SAASI,QAAQ,WAClBZ,SAASC,KAAKiB,UAAUH,OAAOI,KAAKR,GACpCS,OAAOC,KAAKC,MAAM,4BAA6B,oBAKvDZ,WAAY,SAASN,GAEjB,GAAIO,GAAON,IAGXA,MAAKD,QAAUX,EAAMa,MAAMF,EAASC,KAAKD,SACzCC,KAAKD,QAAUX,EAAMa,OACjBiB,KAAkB,YAClBC,MAAkB,MAAQpB,EAAQqB,KAAO,QAAUrB,EAAQsB,YAAc,yBAA2BtB,EAAQuB,QAAU,IACtHC,WAAkBvB,K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,QACdD,QAAc,OATlBhD,KAAKgG,SAAU,EACf1F,EAAKuB,KAAKmB,QAAQC,QACdE,YAAc,EACdH,QAAcxD,EAAauG,aAAahG,GACxCmD,OAAc,aAa9BnD,EAAQkG,cACRb,EAAYH,SACR/D,KAAU,mBACVC,MAAU,mBACVyD,QAAU,wBACVM,QAAU,WACNI,OAAOC,KAAKxF,EAAQkG,kBAO5BC,KAAcd,EACdN,SAAcL,IAKtB3C,QAAS,WAEL,GAAI/B,GAAUC,KAAKD,OAQnB,IALoB,IAAhBA,EAAQoG,MACRnG,KAAK6B,KAAKlB,IAAIqB,OAAOxC,EAAa2G,KAAKpG,IAIvCA,EAAQqG,UAAW,CACnB,GAAIC,GAAa5D,EAAE,UACf2D,EAAY,GAAI3G,GAAc6G,sBAClCF,GAAU5D,QAAUzC,EAAQmC,EAC5B,IAAIqE,GAAqB,GAAI7G,GAAa8G,kBAAmBC,GAAIJ,EAAYK,WAAYN,GACzFG,GAAmBI,SACnBP,EAAUQ,QACV5G,KAAK6B,KAAKlB,IAAIqB,OAAOqE"}
\ No newline at end of file
diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js
index a9629c85e66..89c0717df84 100644
--- a/static/scripts/bundled/analysis.bundled.js
+++ b/static/scripts/bundled/analysis.bundled.js
@@ -6,7 +6,7 @@ this.model.on("change",function(t,e){this.model.changedAttributes().state&&this.
t.type=t.display||"checkbox",t.multiple="checkbox"==t.display,e.BaseIcons.prototype.initialize.call(this,t),this.initial=!0},value:function(t){var i=e.BaseIcons.prototype.value.call(this,t);if(this.initial&&null!==i&&this.header_index){this.initial=!1;var n=i;a.isArray(n)||(n=[n]);for(var s in n){var o=this.header_index[n[s]];for(var r in o)this._setState(o[r],!0)}}return i},_setState:function(t,e){var i=this.$(".button-"+t),n=this.$(".subgroup-"+t);i.data("is_expanded",e),e?(n.fadeIn("fast"),i.removeClass("toggle-expand"),i.addClass("toggle")):(n.hide(),i.removeClass("toggle"),i.addClass("toggle-expand"))},_templateOptions:function(e){function n(t,e){var i=t.find(".button-"+e);i.on("click",function(){o._setState(e,!i.data("is_expanded"))})}function s(e,r,l){l=l||[];for(i in r){var c=r[i],d=c.options.length>0,h=l.slice(0);o.header_index[c.value]=h.slice(0);var u=a("
");if(d){var p=t.uid(),f=a(' '),g=a('
');h.push(p);var m=a("
");m.append(f),m.append(o._templateOption({label:c.name,value:c.value})),u.append(m),s(g,c.options,h),u.append(g),n(u,p)}else u.append(o._templateOption({label:c.name,value:c.value}));e.append(u)}}var o=this;this.header_index={};var r=a("
");return s(r,e),r},_template:function(t){return'
'}});return{View:n}}.apply(e,s),!(void 0!==o&&(t.exports=o))}).call(e,n(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4),i(17)],s=function(t,e){var i=o.View.extend({optionsDefault:{id:t.uid(),cls:"ui-select",error_text:"No options available",empty_text:"Nothing selected",visible:!0,wait:!1,multiple:!1,searchable:!0,optional:!1},initialize:function(i){var n=this;this.options=t.merge(i,this.optionsDefault),this.setElement(this._template(this.options)),this.$select=this.$el.find(".select"),this.$icon_dropdown=this.$el.find(".icon-dropdown");var s=null;this.$(".icon-resize").on("mousedown",function(t){var e=t.pageY,i=n.$select.height();s=s||i,a("#dd-helper").show().on("mousemove",function(t){n.$select.height(Math.max(i+(t.pageY-e),s))}).on("mouseup mouseleave",function(){a("#dd-helper").hide().off()})}),this.options.multiple&&(this.options.searchable?(this.all_button=new e.ButtonCheck({onclick:function(){var t=[];0!==n.all_button.value()&&(t=n._availableOptions()),n.value(t),n.trigger("change")}}),this.$el.prepend(this.all_button.$el)):this.$el.addClass("ui-select-multiple"),this.$select.prop("multiple",!0),this.$icon_dropdown.remove()),this.update(this.options.data),void 0!==this.options.value&&this.value(this.options.value),this.options.visible||this.hide(),this.options.wait?this.wait():this.show(),this.$select.on("change",function(){n.trigger("change")}),this.on("change",function(){n.options.onchange&&n.options.onchange(this.value())})},value:function(t){void 0!==t&&(null===t&&(t="__null__"),(this.exists(t)||this.options.multiple)&&(this.$select.val(t),this.$select.select2&&this.$select.select2("val",t)));var e=this._getValue();return this.all_button&&this.all_button.value(a.isArray(e)&&e.length||0,this._size()),e},first:function(){var t=this.$select.find("option").first();return t.length>0?t.val():null},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_dropdown.removeClass(),this.$icon_dropdown.addClass("icon-dropdown fa fa-spinner fa-spin")},unwait:function(){this.$icon_dropdown.removeClass(),this.$icon_dropdown.addClass("icon-dropdown fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",!1)},disable:function(){this.$select.prop("disabled",!0)},update:function(t){var e=this._getValue();this.$select.find("option").remove(),!this.options.multiple&&this.options.optional&&this.$select.append(this._templateOption({value:"__null__",label:this.options.empty_text}));for(var i in t)this.$select.append(this._templateOption(t[i]));0==this._size()?(this.disable(),this.$select.append(this._templateOption({value:"__null__",label:this.options.error_text}))):this.enable(),this.options.searchable&&(this.$select.select2("destroy"),this.$select.select2({closeOnSelect:!this.options.multiple}),this.$(".select2-container .select2-search input").off("blur")),this.value(e),null!==this._getValue()||this.options.multiple&&this.options.optional||this.value(this.first())},setOnChange:function(t){this.options.onchange=t},exists:function(t){return this.$select.find('option[value="'+t+'"]').length>0},_getValue:function(){var e=this.$select.val();return t.validate(e)?e:null},_availableOptions:function(){var t=[];return this.$select.find("option").each(function(e,i){t.push(a(i).attr("value"))}),t},_size:function(){return this.$select.find("option").length},_templateOption:function(t){return''+r.escape(t.label)+" "},_template:function(t){return''}});return{View:i}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(o){n=[i(4),i(24)],s=function(t,e){var i=o.View.extend({initialize:function(i){var n=this;this.ftpfile_list=new e.View({name:"file",optional:i.optional,multiple:i.multiple,onchange:function(){i.onchange&&i.onchange(n.value())}}),this.setElement(this.ftpfile_list.$el),t.get({url:Galaxy.root+"api/remote_files",success:function(t){var e=[];for(var i in t)e.push({value:t[i].path,label:t[i].path});n.ftpfile_list.update(e)}})},value:function(t){return this.ftpfile_list.value(t)}});return{View:i}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o){n=[i(4),i(7),i(18),i(24)],s=function(t,e,i,n){var s=o.Collection.extend({url:Galaxy.root+"api/libraries?deleted=false"}),a=o.Collection.extend({initialize:function(){var t=this;this.config=new o.Model({library_id:null}),this.config.on("change",function(){t.fetch({reset:!0})})},url:function(){return Galaxy.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),r=o.View.extend({initialize:function(t){var i=this;this.libraries=new s,this.datasets=new a,this.options=t,this.library_select=new e.Select.View({onchange:function(t){i.datasets.config.set("library_id",t)}}),this.dataset_list=new n.View({name:"dataset",optional:t.optional,multiple:t.multiple,onchange:function(){i.trigger("change")}}),this.libraries.on("reset",function(){var t=[];i.libraries.each(function(e){t.push({value:e.id,label:e.get("name")})}),i.library_select.update(t)}),this.datasets.on("reset",function(){var t=[],e=i.library_select.text();null!==e&&i.datasets.each(function(e){"file"===e.get("type")&&t.push({value:e.id,label:e.get("name")})}),i.dataset_list.update(t)}),this.on("change",function(){t.onchange&&t.onchange(i.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$el.append(this.dataset_list.$el),this.libraries.fetch({reset:!0,success:function(){i.library_select.trigger("change"),void 0!==i.options.value&&i.value(i.options.value)}})},value:function(t){return this.dataset_list.value(t)},_template:function(){return''}});return{View:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o,a){n=[i(4)],s=function(t){var e=o.View.extend({optionsDefault:{id:t.uid(),min:null,max:null,step:null,precise:!1,split:1e4},initialize:function(e){var i=this;this.options=t.merge(e,this.optionsDefault),this.setElement(this._template(this.options)),this.useslider=null!==this.options.max&&null!==this.options.min&&this.options.max>this.options.min,null===this.options.step&&(this.options.step=1,this.options.precise&&this.useslider&&(this.options.step=(this.options.max-this.options.min)/this.options.split)),this.useslider?(this.$slider=this.$el.find("#slider"),this.$slider.slider(this.options),this.$slider.on("slide",function(t,e){i.value(e.value)})):this.$el.find(".ui-form-slider-text").css("width","100%"),this.$text=this.$el.find("#text"),void 0!==this.options.value&&this.value(this.options.value),this.$text.on("change",function(){i.value(a(this).val())});var n=[];this.$text.on("keyup",function(t){n[t.which]=!1,i.options.onchange&&i.options.onchange(a(this).val())}),this.$text.on("keydown",function(t){var e=t.which;n[e]=!0,8==e||9==e||13==e||37==e||39==e||e>=48&&57>=e||e>=96&&105>=e||(190==e||110==e)&&-1==a(this).val().indexOf(".")&&i.options.precise||(189==e||109==e)&&-1==a(this).val().indexOf("-")||n[91]||n[17]||event.preventDefault()})},value:function(t){return void 0!==t&&(null!==t&&""!==t&&(isNaN(t)&&(t=0),null!==this.options.max&&(t=Math.min(t,this.options.max)),null!==this.options.min&&(t=Math.max(t,this.options.min))),this.$slider&&this.$slider.slider("value",t),this.$text.val(t),this.options.onchange&&this.options.onchange(t)),this.$text.val()},_template:function(t){return''}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i){n=[],s=function(){var t=i.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_name:"",file_mode:"",file_size:0,file_type:null,file_path:"",file_data:null,percentage:0,space_to_tab:!1,to_posix_lines:!0,enabled:!0},reset:function(t){this.clear().set(this.defaults).set(t)}}),e=i.Collection.extend({model:t});return{Model:t,Collection:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},,function(t,e,i){var n,s;(function(o,a){n=[i(4)],s=function(t){return o.Model.extend({initialize:function(){this.active={},this.last=null},execute:function(e){var i=this,n=t.uid(),s=e.length>0;this.active[n]=!0;var o=a.Deferred();o.promise().always(function(){delete i.active[n],s&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+n)}),a.when(this.last).always(function(){i.active[n]?(s&&Galaxy.emit.debug("deferred::execute()","Running "+n),e(o),!s&&o.resolve()):o.reject()}),this.last=o.promise()},reset:function(){Galaxy.emit.debug("deferred::execute()","Reset");for(var t in this.active)this.active[t]=!1},ready:function(){return a.isEmptyObject(this.active)}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;n=[],s=function(){function t(t,e){e=e||window.location.search.substr(1);var i=new RegExp(t+"=([^$]+)"),n=e.match(i);if(n&&n.length)return n=n.splice(1),1===n.length?n[0]:n}function e(t){if(!t)return{};var e={},i=t.split("&");return i.forEach(function(t){var i=t.split("=");e[i[0]]=decodeURI(i[1])}),e}return{get:t,parse:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))},,function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a=null!=e?e:{},r=i.helperMissing,l="function",c=t.escapeExpression;return'\n\n
\n
'},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({1:function(t,e,i,n,s){var o,a,r=null!=e?e:{},l=i.helperMissing,c="function",d=t.escapeExpression;return'
\n'},compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a,r=null!=e?e:{},l=i.helperMissing,c="function",d=t.escapeExpression;return'
'+d((a=null!=(a=i.name||(null!=e?e.name:e))?a:l,typeof a===c?a.call(r,{name:"name",hash:{},data:s}):a))+" (version "+d((a=null!=(a=i.version||(null!=e?e.version:e))?a:l,typeof a===c?a.call(r,{name:"version",hash:{},data:s}):a))+')
\n
\n'+(null!=(o=i.each.call(r,null!=e?e.inputs:e,{name:"each",hash:{},fn:t.program(1,s,0),inverse:t.noop,data:s}))?o:"")+'
\n
\n \n
\n
"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({1:function(t,e,i,n,s){var o=t.lambda,a=t.escapeExpression;return'
'+a(o(e,e))+" "},compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a,r=null!=e?e:{},l=i.helperMissing,c="function",d=t.escapeExpression;return'
'+(null!=(o=i.each.call(r,null!=e?e.labels:e,{name:"each",hash:{},fn:t.program(1,s,0),inverse:t.noop,data:s}))?o:"")+' \n
'+d((a=null!=(a=i.name||(null!=e?e.name:e))?a:l,typeof a===c?a.call(r,{name:"name",hash:{},data:s}):a))+" \n"+d((a=null!=(a=i.description||(null!=e?e.description:e))?a:l,typeof a===c?a.call(r,{name:"description",hash:{},data:s}):a))+"\n"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a=null!=e?e:{},r=i.helperMissing,l="function",c=t.escapeExpression;return'
\n
\n
\n'},useData:!0})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function o(){var t=new r.HandlebarsEnvironment;return p.extend(t,r),t.SafeString=c["default"],t.Exception=h["default"],t.Utils=p,t.escapeExpression=p.escapeExpression,t.VM=g,t.template=function(e){return g.template(e,t)},t}e.__esModule=!0;var a=i(27),r=s(a),l=i(82),c=n(l),d=i(9),h=n(d),u=i(8),p=s(u),f=i(81),g=s(f),m=i(80),v=n(m),_=o();_.create=o,v["default"](_),_["default"]=_,e["default"]=_,t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){a["default"](t)}e.__esModule=!0,e.registerDefaultDecorators=s;var o=i(70),a=n(o)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerDecorator("inline",function(t,e,i,s){var o=t;return e.partials||(e.partials={},o=function(s,o){var a=i.partials;i.partials=n.extend({},a,e.partials);var r=t(s,o);return i.partials=a,r}),e.partials[s.args[0]]=s.fn,o})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){a["default"](t),l["default"](t),d["default"](t),u["default"](t),f["default"](t),m["default"](t),_["default"](t)}e.__esModule=!0,e.registerDefaultHelpers=s;var o=i(72),a=n(o),r=i(73),l=n(r),c=i(74),d=n(c),h=i(75),u=n(h),p=i(76),f=n(p),g=i(77),m=n(g),v=i(78),_=n(v)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("blockHelperMissing",function(e,i){var s=i.inverse,o=i.fn;if(e===!0)return o(this);if(e===!1||null==e)return s(this);if(n.isArray(e))return e.length>0?(i.ids&&(i.ids=[i.name]),t.helpers.each(e,i)):s(this);if(i.data&&i.ids){var a=n.createFrame(i.data);a.contextPath=n.appendContextPath(i.data.contextPath,i.name),i={data:a}}return o(e,i)})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(8),o=i(9),a=n(o);e["default"]=function(t){t.registerHelper("each",function(t,e){function i(e,i,o){c&&(c.key=e,c.index=i,c.first=0===i,c.last=!!o,d&&(c.contextPath=d+e)),l+=n(t[e],{data:c,blockParams:s.blockParams([t[e],e],[d+e,null])})}if(!e)throw new a["default"]("Must pass iterator to #each");var n=e.fn,o=e.inverse,r=0,l="",c=void 0,d=void 0;if(e.data&&e.ids&&(d=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(c=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var h=t.length;h>r;r++)r in t&&i(r,r,r===t.length-1);else{var u=void 0;for(var p in t)t.hasOwnProperty(p)&&(void 0!==u&&i(u,r-1),u=p,r++);void 0!==u&&i(u,r-1,!0)}return 0===r&&(l=o(this)),l})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(9),o=n(s);e["default"]=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new o["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e["default"]},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("if",function(t,e){return n.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||n.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,i){return t.helpers["if"].call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})})},t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t){t.registerHelper("log",function(){for(var e=[void 0],i=arguments[arguments.length-1],n=0;n
=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;i>o;o++)n[o-1]=arguments[o];console[e].apply(console,n)}}};e["default"]=s,t.exports=e["default"]},function(t,e){(function(i){"use strict";e.__esModule=!0,e["default"]=function(t){var e="undefined"!=typeof i?i:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}},t.exports=e["default"]}).call(e,function(){return this}())},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function o(t){var e=t&&t[0]||1,i=v.COMPILER_REVISION;if(e!==i){if(i>e){var n=v.REVISION_CHANGES[i],s=v.REVISION_CHANGES[e];throw new m["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+s+").")}throw new m["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function a(t,e){function i(i,n,s){s.hash&&(n=f.extend({},n,s.hash),s.ids&&(s.ids[0]=!0)),i=e.VM.resolvePartial.call(this,i,n,s);var o=e.VM.invokePartial.call(this,i,n,s);if(null==o&&e.compile&&(s.partials[s.name]=e.compile(i,t.compilerOptions,e),o=s.partials[s.name](n,s)),null!=o){if(s.indent){for(var a=o.split("\n"),r=0,l=a.length;l>r&&(a[r]||r+1!==l);r++)a[r]=s.indent+a[r];o=a.join("\n")}return o}throw new m["default"]("The partial "+s.name+" could not be compiled when running in runtime-only mode")}function n(e){function i(e){return""+t.main(s,e,s.helpers,s.partials,a,l,r)}var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=o.data;n._setup(o),!o.partial&&t.useData&&(a=h(e,a));var r=void 0,l=t.useBlockParams?[]:void 0;return t.useDepths&&(r=o.depths?e!==o.depths[0]?[e].concat(o.depths):o.depths:[e]),(i=u(t.main,i,s,o.depths||[],a,l))(e,o)}if(!e)throw new m["default"]("No environment passed to template");if(!t||!t.main)throw new m["default"]("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s={strict:function(t,e){if(!(e in t))throw new m["default"]('"'+e+'" not defined in '+t);return t[e]},lookup:function(t,e){for(var i=t.length,n=0;i>n;n++)if(t[n]&&null!=t[n][e])return t[n][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:f.escapeExpression,invokePartial:i,fn:function(e){var i=t[e];return i.decorator=t[e+"_d"],i},programs:[],program:function(t,e,i,n,s){var o=this.programs[t],a=this.fn(t);return e||s||n||i?o=r(this,t,a,e,i,n,s):o||(o=this.programs[t]=r(this,t,a)),o},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var i=t||e;return t&&e&&t!==e&&(i=f.extend({},e,t)),i},noop:e.VM.noop,compilerInfo:t.compiler};return n.isTop=!0,n._setup=function(i){i.partial?(s.helpers=i.helpers,s.partials=i.partials,s.decorators=i.decorators):(s.helpers=s.merge(i.helpers,e.helpers),t.usePartial&&(s.partials=s.merge(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(s.decorators=s.merge(i.decorators,e.decorators)))},n._child=function(e,i,n,o){if(t.useBlockParams&&!n)throw new m["default"]("must pass block params");if(t.useDepths&&!o)throw new m["default"]("must pass parent depths");return r(s,e,t[e],i,0,n,o)},n}function r(t,e,i,n,s,o,a){function r(e){var s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=a;return a&&e!==a[0]&&(r=[e].concat(a)),i(t,e,t.helpers,t.partials,s.data||n,o&&[s.blockParams].concat(o),r)}return r=u(i,r,t,a,n,o),r.program=e,r.depth=a?a.length:0,r.blockParams=s||0,r}function l(t,e,i){return t?t.call||i.name||(i.name=t,t=i.partials[t]):t="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name],t}function c(t,e,i){i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath);var n=void 0;if(i.fn&&i.fn!==d&&(i.data=v.createFrame(i.data),n=i.data["partial-block"]=i.fn,n.partials&&(i.partials=f.extend({},i.partials,n.partials))),void 0===t&&n&&(t=n),void 0===t)throw new m["default"]("The partial "+i.name+" could not be found");return t instanceof Function?t(e,i):void 0}function d(){return""}function h(t,e){return e&&"root"in e||(e=e?v.createFrame(e):{},e.root=t),e}function u(t,e,i,n,s,o){if(t.decorator){var a={};e=t.decorator(e,a,i,n&&n[0],s,o,n),f.extend(e,a)}return e}e.__esModule=!0,e.checkRevision=o,e.template=a,e.wrapProgram=r,e.resolvePartial=l,e.invokePartial=c,e.noop=d;var p=i(8),f=s(p),g=i(9),m=n(g),v=i(27)},function(t,e){"use strict";function i(t){this.string=t}e.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},e["default"]=i,t.exports=e["default"]},,,,,,,,,,function(t,e,i){var n,s;(function(o,a){n=[i(6),i(5),i(20)],s=function(t,e){var i=o.View.extend(t.LoggableMixin).extend(t.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(t){t=t||{},this.tooltipConfig=t.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(t.$activator,t)},render:function(){var t=this;return this.$el.html(this._template()),this.$el.find("[title]").tooltip(this.tooltipConfig),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(e){t.$annotation().text(e),t.model.save({annotation:e},{silent:!0}).fail(function(){t.$annotation().text(t.model.previous("annotation"))})}}),this},_template:function(){var t=this.model.get("annotation");return['',e("Annotation")," ",'',a.escape(t),"
"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off(),this.stopListening(this.model),o.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:i}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3))},function(t,e,i){var n,s;(function(o){n=[i(100),i(35),i(34),i(6),i(5)],s=function(t,e,i,n,s){var a="collections",r=t.ModelListPanel,l=r.extend({_logNamespace:a,className:r.prototype.className+" dataset-collection-panel",DatasetDCEViewClass:i.DatasetDCEListItemView,NestedDCDCEViewClass:i.NestedDCDCEListItemView,modelCollectionKey:"elements",initialize:function(t){r.prototype.initialize.call(this,t),this.linkTarget=t.linkTarget||"_blank",this.hasUser=t.hasUser,this.panelStack=[],this.parentName=t.parentName,this.foldoutStyle=t.foldoutStyle||"foldout"},_filterCollection:function(){return this.model.getVisibleContents()},_getItemViewClass:function(t){switch(t.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.NestedDCDCEViewClass}throw new TypeError("Unknown element type:",t.get("element_type"))},_getItemViewOptions:function(t){var e=r.prototype._getItemViewOptions.call(this,t);return o.extend(e,{linkTarget:this.linkTarget,hasUser:this.hasUser,foldoutStyle:this.foldoutStyle})},_setUpItemViewListeners:function(t){var e=this;return r.prototype._setUpItemViewListeners.call(e,t),t.on("expanded:drilldown",function(t,e){this._expandDrilldownPanel(e)},this),t.on("collapsed:drilldown",function(t,e){this._collapseDrilldownPanel(e)},this),this},_expandDrilldownPanel:function(t){this.panelStack.push(t),this.$("> .controls").add(this.$list()).hide(),t.parentName=this.model.get("name"),this.$el.append(t.render().$el)},_collapseDrilldownPanel:function(t){this.panelStack.pop(),this.render()},events:{"click .navigation .back":"close"},close:function(t){this.$el.remove(),this.trigger("close")},toString:function(){return"CollectionView("+(this.model?this.model.get("name"):"")+")"}});l.prototype.templates=function(){var t=n.wrapTemplate(['','
",'
','
<%- collection.name || collection.element_identifier %>
','
','<% if( collection.collection_type === "list" ){ %>',s("a list of datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',s("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',s("a list of paired datasets"),"<% } %>","
","
","
"],"collection");return o.extend(o.clone(r.prototype.templates),{controls:t})}();var c=l.extend({DatasetDCEViewClass:i.DatasetDCEListItemView,toString:function(){return"ListCollectionView("+(this.model?this.model.get("name"):"")+")"}}),d=c.extend({toString:function(){return"PairCollectionView("+(this.model?this.model.get("name"):"")+")"}}),h=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemView.extend({foldoutPanelClass:d}),toString:function(){return"ListOfPairsCollectionView("+(this.model?this.model.get("name"):"")+")"}});return{CollectionView:l,ListCollectionView:c,PairCollectionView:d,ListOfPairsCollectionView:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(o,a){n=[i(15),i(37),i(101),i(92),i(26),i(6),i(5)],s=function(t,e,n,s,r,l,c){var d=e.DatasetListItemView,h=d.extend({initialize:function(t){d.prototype.initialize.call(this,t),this.hasUser=t.hasUser,this.purgeAllowed=t.purgeAllowed||!1,this.tagsEditorShown=t.tagsEditorShown||!1,this.annotationEditorShown=t.annotationEditorShown||!1},_renderPrimaryActions:function(){var e=d.prototype._renderPrimaryActions.call(this);return this.model.get("state")===t.NOT_VIEWABLE?e:d.prototype._renderPrimaryActions.call(this).concat([this._renderEditButton(),this._renderDeleteButton()])},_renderEditButton:function(){if(this.model.get("state")===t.DISCARDED||!this.model.get("accessible"))return null;var e=this.model.get("purged"),i=this.model.get("deleted"),n={title:c("Edit attributes"),href:this.model.urls.edit,target:this.linkTarget,faIcon:"fa-pencil",classes:"edit-btn"};return i||e?(n.disabled=!0,e?n.title=c("Cannot edit attributes of datasets removed from disk"):i&&(n.title=c("Undelete dataset to edit attributes"))):o.contains([t.UPLOAD,t.NEW],this.model.get("state"))&&(n.disabled=!0,n.title=c("This dataset is not yet editable")),r(n)},_renderDeleteButton:function(){if(!this.model.get("accessible"))return null;var t=this,e=this.model.isDeletedOrPurged();return r({title:c(e?"Dataset is already deleted":"Delete"),disabled:e,faIcon:"fa-times",classes:"delete-btn",onclick:function(){t.$el.find(".icon-btn.delete-btn").trigger("mouseout"),t.model["delete"]()}})},_renderDetails:function(){var e=d.prototype._renderDetails.call(this),i=this.model.get("state");return!this.model.isDeletedOrPurged()&&o.contains([t.OK,t.FAILED_METADATA],i)&&(this._renderTags(e),this._renderAnnotation(e),this._makeDbkeyEditLink(e)),this._setUpBehaviors(e),e},_renderSecondaryActions:function(){var e=d.prototype._renderSecondaryActions.call(this);switch(this.model.get("state")){case t.UPLOAD:case t.NEW:case t.NOT_VIEWABLE:return e;case t.ERROR:return e.unshift(this._renderErrButton()),e.concat([this._renderRerunButton()]);case t.OK:case t.FAILED_METADATA:return e.concat([this._renderRerunButton(),this._renderVisualizationsButton()])}return e.concat([this._renderRerunButton()])},_renderErrButton:function(){return r({title:c("View or report this error"),
href:this.model.urls.report_error,classes:"report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_renderRerunButton:function(){var t=this.model.get("creating_job");return this.model.get("rerunnable")?r({title:c("Run this job again"),href:this.model.urls.rerun,classes:"rerun-btn",target:this.linkTarget,faIcon:"fa-refresh",onclick:function(e){e.preventDefault(),!function(){var e=[i(23)];(function(e){var i=new e.View({job_id:t});i.deferred.execute(function(){Galaxy.app.display(i)})}).apply(null,e)}()}}):void 0},_renderVisualizationsButton:function(){var t=this.model.get("visualizations");if(this.model.isDeletedOrPurged()||!this.hasUser||!this.model.hasData()||o.isEmpty(t))return null;if(!o.isObject(t[0]))return this.warn("Visualizations have been switched off"),null;var e=a(this.templates.visualizations(t,this));return e.find('[target="galaxy_main"]').attr("target",this.linkTarget),this._addScratchBookFn(e.find(".visualization-link").addBack(".visualization-link")),e},_addScratchBookFn:function(t){t.click(function(t){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Visualization",type:"url",content:a(this).attr("href")}),t.preventDefault(),t.stopPropagation())})},_renderTags:function(t){if(this.hasUser){var e=this;this.tagsEditor=new n.TagsEditor({model:this.model,el:t.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){e.tagsEditorShown=!0},onhide:function(){e.tagsEditorShown=!1},$activator:r({title:c("Edit dataset tags"),classes:"tag-btn",faIcon:"fa-tags"}).appendTo(t.find(".actions .right"))}),this.tagsEditorShown&&this.tagsEditor.toggle(!0)}},_renderAnnotation:function(t){if(this.hasUser){var e=this;this.annotationEditor=new s.AnnotationEditor({model:this.model,el:t.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){e.annotationEditorShown=!0},onhide:function(){e.annotationEditorShown=!1},$activator:r({title:c("Edit dataset annotation"),classes:"annotate-btn",faIcon:"fa-comment"}).appendTo(t.find(".actions .right"))}),this.annotationEditorShown&&this.annotationEditor.toggle(!0)}},_makeDbkeyEditLink:function(t){if("?"===this.model.get("metadata_dbkey")&&!this.model.isDeletedOrPurged()){var e=a('? ').attr("href",this.model.urls.edit).attr("target",this.linkTarget);t.find(".dbkey .value").replaceWith(e)}},events:o.extend(o.clone(d.prototype.events),{"click .undelete-link":"_clickUndeleteLink","click .purge-link":"_clickPurgeLink","click .edit-btn":function(t){this.trigger("edit",this,t)},"click .delete-btn":function(t){this.trigger("delete",this,t)},"click .rerun-btn":function(t){this.trigger("rerun",this,t)},"click .report-err-btn":function(t){this.trigger("report-err",this,t)},"click .visualization-btn":function(t){this.trigger("visualize",this,t)},"click .dbkey a":function(t){this.trigger("edit",this,t)}}),_clickUndeleteLink:function(t){return this.model.undelete(),!1},_clickPurgeLink:function(t){return this.model.purge(),!1},toString:function(){var t=this.model?this.model+"":"(no model)";return"HDAEditView("+t+")"}});return h.prototype.templates=function(){var t=o.extend({},d.prototype.templates.warnings,{failed_metadata:l.wrapTemplate(['<% if( dataset.state === "failed_metadata" ){ %>','","<% } %>"],"dataset"),deleted:l.wrapTemplate(["<% if( dataset.deleted && !dataset.purged ){ %>",'',c("This dataset has been deleted"),'
',c("Undelete it")," ","<% if( view.purgeAllowed ){ %>",'
',c("Permanently remove it from disk")," ","<% } %>","
","<% } %>"],"dataset")}),e=l.wrapTemplate(["<% if( visualizations.length === 1 ){ %>",'">',' '," ","<% } else { %>",'","<% } %>"],"visualizations");return o.extend({},d.prototype.templates,{warnings:t,visualizations:e})}(),{DatasetListItemEdit:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(15),i(6),i(5)],s=function(t,e,i){var n="dataset",s=e.SearchableModelMixin,l=o.Model.extend(e.LoggableMixin).extend(e.mixin(s,{_logNamespace:n,defaults:{state:t.NEW,deleted:!1,purged:!1,name:"(unnamed dataset)",accessible:!0,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(e,i){this.debug(this+"(Dataset).initialize",e,i),this.get("accessible")||this.set("state",t.NOT_VIEWABLE),this.urls=this._generateUrls(),this._setUpListeners()},_generateUrls:function(){var t=this.get("id");if(!t)return{};var e={purge:"datasets/"+t+"/purge_async",display:"datasets/"+t+"/display/?preview=True",edit:"datasets/"+t+"/edit",download:"datasets/"+t+"/display?to_ext="+this.get("file_ext"),report_error:"dataset/errors?id="+t,rerun:"tool_runner/rerun?id="+t,show_params:"datasets/"+t+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+t+"&metadata_name="};return a.each(e,function(t,i){e[i]=Galaxy.root+t}),this.urls=e,e},_setUpListeners:function(){this.on("change:state",function(t,e){this.log(this+" has changed state:",t,e),this.inReadyState()&&this.trigger("state:ready",t,e,this.previous("state"))}),this.on("change:id change:file_ext",function(t){this._generateUrls()})},toJSON:function(){var t=o.Model.prototype.toJSON.call(this);return a.extend(t,{urls:this.urls})},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},inReadyState:function(){var e=a.contains(t.READY_STATES,this.get("state"));return this.isDeletedOrPurged()||e},hasDetails:function(){return a.has(this.attributes,"genome_build")},hasData:function(){return this.get("file_size")>0},fetch:function(t){var e=this;return o.Model.prototype.fetch.call(this,t).always(function(){e._generateUrls()})},"delete":function(t){return this.get("deleted")?r.when():this.save({deleted:!0},t)},undelete:function(t){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},t)},purge:function(t){if(this.get("purged"))return r.when();t=t||{},t.url=this.urls.purge;var e=this,n=r.ajax(t);return n.done(function(t,i,n){e.set({deleted:!0,purged:!0})}),n.fail(function(n,s,o){var a=i("Unable to purge dataset"),r="Removal of datasets by users is not allowed in this Galaxy instance";n.responseJSON&&n.responseJSON.error?a=n.responseJSON.error:-1!==n.responseText.indexOf(r)&&(a=r),n.responseText=a,e.trigger("error",e,n,t,i(a),{error:a})}),n},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 t=this.get("id")||"";return this.get("name")&&(t='"'+this.get("name")+'",'+t),"Dataset("+t+")"}})),c=o.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,model:l,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(t){return t.get("id")})},notReady:function(){return this.filter(function(t){return!t.inReadyState()})},haveDetails:function(){return this.all(function(t){return t.hasDetails()})},ajaxQueue:function(t,e){var i=r.Deferred(),n=this.length,s=[];if(!n)return i.resolve([]),i;var o=this.chain().reverse().map(function(a,r){return function(){var l=t.call(a,e);l.done(function(t){i.notify({curr:r,total:n,response:t,model:a})}),l.always(function(t){s.push(t),o.length?o.shift()():i.resolve(s)})}}).value();return o.shift()(),i},matches:function(t){return this.filter(function(e){return e.matches(t)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});return{DatasetAssociation:l,DatasetAssociationCollection:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(o){n=[i(37),i(6),i(5)],s=function(t,e,i){var n=t.DatasetListItemView,s=n.extend({className:n.prototype.className+" history-content",initialize:function(t,e){n.prototype.initialize.call(this,t,e)},toString:function(){var t=this.model?this.model+"":"(no model)";return"HDAListItemView("+t+")"}});return s.prototype.templates=function(){var t=e.wrapTemplate(['','
','
','<%- dataset.hid %> ','<%- dataset.name %> ',"
","
"],"dataset"),s=o.extend({},n.prototype.templates.warnings,{hidden:e.wrapTemplate(["<% if( !dataset.visible ){ %>",'',i("This dataset has been hidden"),"
","<% } %>"],"dataset")});return o.extend({},n.prototype.templates,{titleBar:t,warnings:s})}(),{HDAListItemView:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(o){n=[i(95),i(46),i(6),i(5)],s=function(t,e,i,n){var s=t.DatasetAssociation,a=e.HistoryContentMixin,r=s.extend(i.mixin(a,{constructor:function(t,e){a.constructor.call(this,t,e)},defaults:o.extend({},s.prototype.defaults,a.defaults,{model_class:"HistoryDatasetAssociation"}),initialize:function(t,e){s.prototype.initialize.call(this,t,e),a.initialize.call(this,t,e)},toString:function(){var t=this.get("id")||"";return this.get("name")&&(t=this.get("hid")+' :"'+this.get("name")+'",'+t),"HDA("+t+")"}}));return{HistoryDatasetAssociation:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(o){n=[i(15),i(34),i(93),i(6),i(5)],s=function(t,e,i,n,s){var a=e.DCListItemView,r=a.extend({className:a.prototype.className+" history-content",_setUpListeners:function(){a.prototype._setUpListeners.call(this),this.model.on({"change:populated change:visible":function(t,e){this.render()}},this)},_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return i.ListCollectionView;case"paired":return i.PairCollectionView;case"list:paired":return i.ListOfPairsCollectionView}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_swapNewRender:function(e){a.prototype._swapNewRender.call(this,e);var i=this.model.get("populated")?t.OK:t.RUNNING;return this.$el.addClass("state-"+i),this.$el},toString:function(){var t=this.model?this.model+"":"(no model)";return"HDCAListItemView("+t+")"}});return r.prototype.templates=function(){var t=o.extend({},a.prototype.templates.warnings,{hidden:n.wrapTemplate(["<% if( !collection.visible ){ %>",'',s("This collection has been hidden"),"
","<% } %>"],"collection")}),e=n.wrapTemplate(['','
','
','<%- collection.hid %> ','<%- collection.name %> ',"
",'
',"
"],"collection");return o.extend({},a.prototype.templates,{warnings:t,titleBar:e})}(),{HDCAListItemView:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3))},function(t,e,i){var n,s;(function(o,a,r){n=[i(47),i(4),i(6),i(5)],s=function(t,e,i,n){var s="history",l=o.Model.extend(i.LoggableMixin).extend(i.mixin(i.SearchableModelMixin,{_logNamespace:s,defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",deleted:!1},urlRoot:Galaxy.root+"api/histories",initialize:function(e,i,n){n=n||{},this.logger=n.logger||null,this.log(this+".initialize:",e,i,n),this.log("creating history contents:",i),this.contents=new t.HistoryContents(i||[],{historyId:this.get("id")}),this._setUpListeners(),this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(t,e,i,n,s){this.errorHandler(t,e,i,n,s)}),this.contents&&this.listenTo(this.contents,"error",function(){this.trigger.apply(this,["error:contents"].concat(a.makeArray(arguments)))}),this.on("change:id",function(t,e){this.contents&&(this.contents.historyId=e)},this)},errorHandler:function(t,e,i,n,s){this.clearUpdateTimeout()},nice_size:function(){return e.bytesToString(this.get("size"),!0,2)},toJSON:function(){return r.extend(o.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(t){return"nice_size"===t?this.nice_size():o.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return Galaxy&&Galaxy.user?Galaxy.user.isAnonymous()||Galaxy.user.id!==this.get("user_id")?!1:!0:!1},contentsCount:function(){return r.reduce(r.values(this.get("state_details")),function(t,e){return t+e},0)},searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},checkForUpdates:function(t){return this.contents.running().length?this.setUpdateTimeout():(this.trigger("ready"),r.isFunction(t)&&t.call(this)),this},setUpdateTimeout:function(t){t=t||l.UPDATE_DELAY;var e=this;return this.clearUpdateTimeout(),this.updateTimeoutId=setTimeout(function(){e.refresh()},t),this.updateTimeoutId},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},refresh:function(t,e){t=t||[],e=e||{};var i=this;e.data=e.data||{},t.length&&(e.data.details=t.join(","));var n=this.contents.fetch(e);return n.done(function(t){i.checkForUpdates(function(){this.fetch()})}),n},_delete:function(t){return this.get("deleted")?a.when():this.save({deleted:!0},t)},purge:function(t){return this.get("purged")?a.when():this.save({deleted:!0,purged:!0},t)},undelete:function(t){return this.get("deleted")?this.save({deleted:!1},t):a.when()},copy:function(t,e,i){if(t=void 0!==t?t:!0,!this.id)throw new Error("You must set the history ID before copying it.");var n={history_id:this.id};t&&(n.current=!0),e&&(n.name=e),i||(n.all_datasets=!1);var s=this,o=a.post(this.urlRoot,n);return t?o.then(function(t){var e=new l(t);return e.setAsCurrent().done(function(){s.trigger("copied",s,t)})}):o.done(function(t){s.trigger("copied",s,t)})},setAsCurrent:function(){var t=this,e=a.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return e.done(function(){t.trigger("set-as-current",t)}),e},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}}));l.UPDATE_DELAY=4e3,l.getHistoryData=function(t,e){function i(e){return"current"===t?a.getJSON(Galaxy.root+"history/current_history_json"):a.ajax(Galaxy.root+"api/histories/"+t)}function n(t){return t&&t.empty}function s(t){if(n(t))return[];r.isFunction(o)&&(o=o(t)),r.isFunction(l)&&(l=l(t));var e={};return o.length&&(e.dataset_details=o.join(",")),l.length&&(e.dataset_collection_details=l.join(",")),a.ajax(Galaxy.root+"api/histories/"+t.id+"/contents",{data:e})}e=e||{};var o=e.detailIdsFn||[],l=e.hdcaDetailIds||[],c=a.Deferred(),d=null,h=e.historyFn||i,u=e.contentsFn||s,p=h(t);p.done(function(t){d=t,c.notify({status:"history data retrieved",historyJSON:d})}),p.fail(function(t,e,i){c.reject(t,"loading the history")});var f=p.then(u);return f.then(function(t){c.notify({status:"contents data retrieved",historyJSON:d,contentsJSON:t}),c.resolve(d,t)}),f.fail(function(t,e,i){c.reject(t,"loading the contents",{history:d})}),c};var c={fetch:function(t){return t=t||{},t.data=t.data||this._buildFetchData(t),t.traditional=!0,o.Collection.prototype.fetch.call(this,t)},_fetchOptions:["order","limit","offset","view","keys"],_buildFetchData:function(t){var e={},i=this._fetchDefaults();t=r.defaults(t||{},i),e=r.pick(t,this._fetchOptions);var n=r.has(t,"filters")?t.filters:i.filters||{};return r.isEmpty(n)||r.extend(e,this._buildFetchFilters(n)),e},_fetchDefaults:function(){return{}},_buildFetchFilters:function(t){var e={q:[],qv:[]};return r.each(t,function(t,i){t===!0&&(t="True"),t===!1&&(t="False"),e.q.push(i),e.qv.push(t)}),e}},d=o.Collection.extend(i.LoggableMixin).extend(c).extend({_logNamespace:s,model:l,DEFAULT_ORDER:"update_time",sortOrders:{update_time:{getter:function(t){return new Date(t.get("update_time"))},asc:!1},"update_time-asc":{getter:function(t){return new Date(t.get("update_time"))},asc:!0},name:{getter:function(t){return t.get("name")},asc:!0},"name-dsc":{getter:function(t){return t.get("name")},asc:!1},size:{getter:function(t){return t.get("size")},asc:!1},"size-asc":{getter:function(t){return t.get("size")},asc:!0}},initialize:function(t,e){e=e||{},this.log("HistoryCollection.initialize",arguments),this.includeDeleted=e.includeDeleted||!1,this.setOrder(e.order||this.DEFAULT_ORDER),this.currentHistoryId=e.currentHistoryId,this.allFetched=e.allFetched||!1,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},_fetchDefaults:function(){var t={order:this.order,view:"detailed"};return this.includeDeleted||(t.filters={deleted:!1,purged:!1}),t},setUpListeners:function(){this.on({"change:deleted":function(t){this.debug("change:deleted",this.includeDeleted,t.get("deleted")),!this.includeDeleted&&t.get("deleted")&&this.remove(t)},copied:function(t,e){this.setCurrent(new l(e,[]))},"set-as-current":function(t){var e=this.currentHistoryId;this.trigger("no-longer-current",e),this.currentHistoryId=t.id}},this)},sort:function(t){return t=t||{},this.setOrder(t.order),o.Collection.prototype.sort.call(this,t)},setOrder:function(t){var e=this,i=this.sortOrders[t];if(!r.isUndefined(i))return e.order=t,e.comparator=function(t,n){var s=e.currentHistoryId;return t.id===s?-1:n.id===s?1:(t=i.getter(t),n=i.getter(n),i.asc?t===n?0:t>n?1:-1:t===n?0:t>n?-1:1)},e.trigger("changed-order",e.order,e),e},fetch:function(t){if(t=t||{},this.allFetched)return a.when({});var e=this,i=r.defaults(t,{remove:!1,offset:e.length>=1?e.length-1:0,order:e.order}),n=t.limit;return r.isUndefined(n)||(i.limit=n),c.fetch.call(this,i).done(function(t){var i=r.isArray(t)?t.length:0;(!n||n>i)&&(e.allFetched=!0,e.trigger("all-fetched",e))})},create:function(t,e,i,n){var s=this,o=a.getJSON(Galaxy.root+"history/create_new_current");return o.done(function(t){s.setCurrent(new l(t,[],i||{}))})},setCurrent:function(t,e){return e=e||{},this.unshift(t,e),this.currentHistoryId=t.get("id"),e.silent||this.trigger("new-current",t,this),this},reset:function(t,e){return this.allFetched=!1,o.Collection.prototype.reset.call(this,t,e)},toString:function(){return"HistoryCollection("+this.length+")"}});return{History:l,HistoryCollection:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(o,a,r){n=[i(48),i(142),i(6),i(5),i(107)],s=function(t,e,i,n){var s="list",l=o.View.extend(i.LoggableMixin).extend({_logNamespace:s,viewClass:t.ListItemView,collectionClass:o.Collection,tagName:"div",className:"list-panel",fxSpeed:"fast",emptyMsg:n("This list is empty"),noneFoundMsg:n("No matching items found"),searchPlaceholder:n("search"),initialize:function(t,i){t=t||{},t.logger&&(this.logger=t.logger),this.log(this+".initialize:",t),this.fxSpeed=a.has(t,"fxSpeed")?t.fxSpeed:this.fxSpeed,this.filters=[],this.searchFor=t.searchFor||"",this.indicator=new e(this.$el),this.selecting=void 0!==t.selecting?t.selecting:!0,this.selected=t.selected||[],this.lastSelected=null,this.dragItems=t.dragItems||!1,this.viewClass=t.viewClass||this.viewClass,this.views=[],this.collection=t.collection||new this.collectionClass([]),this.filters=t.filters||[],this.$scrollContainer=t.$scrollContainer||this.$scrollContainer,this.title=t.title||"",this.subtitle=t.subtitle||"",this._setUpListeners()},freeViews:function(){return a.each(this.views,function(t){t.off()}),this.views=[],this},_setUpListeners:function(){return this.off(),this.on("error",function(t,e,i,n,s){console.error(t,e,i,n,s)},this),this.on("loading",function(){this._showLoadingIndicator("loading...",40)},this),this.on("loading-done",function(){this._hideLoadingIndicator(40)},this),this.once("rendered",function(){this.trigger("rendered:initial",this)},this),this.logger&&this.on("all",function(t){this.log(this+"",arguments)},this),this._setUpCollectionListeners(),this._setUpViewListeners(),this},_setUpCollectionListeners:function(){return this.log(this+"._setUpCollectionListeners",this.collection),this.collection.off(),this.collection.on("error",function(t,e,i,n,s){this.trigger("error",t,e,i,n,s)},this),this.collection.on("reset",function(){this.renderItems()},this),this.collection.on("add",this.addItemView,this),this.collection.on("remove",this.removeItemView,this),this.logger&&this.collection.on("all",function(t){this.info(this+"(collection)",arguments)},this),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on("view:selected",function(t,e){if(e&&e.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(t,i)}else e&&e.altKey&&!this.selecting&&this.showSelectors();this.selected.push(t.model.id),this.lastSelected=t.model.id},this),this.on("view:de-selected",function(t,e){this.selected=a.without(this.selected,t.model.id)},this)},render:function(t){this.log(this+".render",t);var e=this._buildNewRender();return this._setUpBehaviors(e),this._queueNewRender(e,t),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var t=r(this.templates.el({},this));return this._renderControls(t),this._renderTitle(t),this._renderSubtitle(t),this._renderSearch(t),this.renderItems(t),t},_renderControls:function(t){this.debug(this+"(ListPanel)._renderControls");var e=r(this.templates.controls({},this));return t.find(".controls").replaceWith(e),e},_renderTitle:function(t){},_renderSubtitle:function(t){},_queueNewRender:function(t,e){e=void 0===e?this.fxSpeed:e;var i=this;i.log("_queueNewRender:",t,e),r(i).queue("fx",[function(t){this.$el.fadeOut(e,t)},function(e){i._swapNewRender(t),e()},function(t){this.$el.fadeIn(e,t)},function(t){i.trigger("rendered",i),t()}])},_swapNewRender:function(t){return this.$el.empty().attr("class",this.className).append(t.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(t){return t=t||this.$el,t.find(".controls [title]").tooltip({placement:"bottom"}),this._renderMultiselectActionMenu(t),this},_renderMultiselectActionMenu:function(t){t=t||this.$el;var e=t.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return e.empty();var s=r(['"].join("")),o=i.map(function(t){var e=['',t.html," "].join("");return r(e).click(function(e){return e.preventDefault(),t.func(e)})});return s.find("ul").append(o),e.replaceWith(s),s},multiselectActions:function(){return[]},$scrollContainer:function(){return this.$el.parent().parent()},$list:function(t){return(t||this.$el).find("> .list-items")},$messages:function(t){return(t||this.$el).find("> .controls .messages")},$emptyMessage:function(t){return(t||this.$el).find("> .empty-message")},renderItems:function(t){t=t||this.$el;var e=this;e.log(this+".renderItems",t);var i=e.$list(t);return e.views=e._filterCollection().map(function(t){return e._createItemView(t).render(0)}),i.empty(),e.views.length?(e._attachItems(t),e.$emptyMessage(t).hide()):e._renderEmptyMessage(t).show(),e.trigger("views:ready",e.views),e.views},_filterCollection:function(){var t=this;return t.collection.filter(a.bind(t._filterItem,t))},_filterItem:function(t){var e=this;return a.every(e.filters.map(function(e){return e.call(t)}))&&(!e.searchFor||t.matchesAll(e.searchFor))},_createItemView:function(t){var e=this._getItemViewClass(t),i=a.extend(this._getItemViewOptions(t),{model:t}),n=new e(i);return this._setUpItemViewListeners(n),n},_getItemViewClass:function(t){return this.viewClass},_getItemViewOptions:function(t){return{fxSpeed:this.fxSpeed,expanded:!1,selectable:this.selecting,selected:a.contains(this.selected,t.id),draggable:this.dragItems}},_setUpItemViewListeners:function(t){var e=this;return t.on("all",function(){var t=Array.prototype.slice.call(arguments,0);t[0]="view:"+t[0],e.trigger.apply(e,t)}),t.on("draggable:dragstart",function(t,e){var i={},n=this.getSelectedModels();i=n.length?n.toJSON():[e.model.toJSON()],t.dataTransfer.setData("text",JSON.stringify(i))},this),e},_attachItems:function(t){return this.$list(t).append(this.views.map(function(t){return t.$el})),this},_renderEmptyMessage:function(t){this.debug("_renderEmptyMessage",t,this.searchFor);var e=this.searchFor?this.noneFoundMsg:this.emptyMsg;return this.$emptyMessage(t).text(e)},expandAll:function(){a.each(this.views,function(t){t.expand()})},collapseAll:function(){a.each(this.views,function(t){t.collapse()})},addItemView:function(t,e,i){this.log(this+".addItemView:",t);var n=this;if(n._filterItem(t)){var s=n._createItemView(t);return r(s).queue("fx",[function(t){n.$emptyMessage().fadeOut(n.fxSpeed,t)},function(t){n._attachView(s),t()}]),s}},_attachView:function(t){var e=this;e.views.push(t),e.$list().append(t.render(0).$el.hide()),e.trigger("view:attached",t),t.$el.slideDown(e.fxSpeed,function(){e.trigger("view:attached:rendered")})},removeItemView:function(t,e,i){this.log(this+".removeItemView:",t);var n=this,s=n.viewFromModel(t);if(s)return n.views=a.without(n.views,s),n.trigger("view:removed",s),r({}).queue("fx",[function(t){s.$el.fadeOut(n.fxSpeed,t)},function(t){s.remove(),n.trigger("view:removed:rendered"),n.views.length?t():n._renderEmptyMessage().fadeIn(n.fxSpeed,t)}]),s},viewFromModelId:function(t){for(var e=0;ei?this.views.slice(i,n+1):this.views.slice(n,i+1)},_renderSearch:function(t){return t.find(".controls .search-input").searchInput({placeholder:this.searchPlaceholder,initialVal:this.searchFor,onfirstsearch:a.bind(this._firstSearch,this),onsearch:a.bind(this.searchItems,this),onclear:a.bind(this.clearSearch,this)}),t},_firstSearch:function(t){return this.log("onFirstSearch",t),this.searchItems(t)},searchItems:function(t){return this.searchFor=t,this.trigger("search:searching",t,this),this.renderItems(),this.$("> .controls .search-query").val(t),this},clearSearch:function(t){return this.searchFor="",this.trigger("search:clear",this),this.$("> .controls .search-query").val(""),this.renderItems(),this},THROTTLE_SELECTORS_AT:20,showSelectors:function(t){t=void 0!==t?t:this.fxSpeed,this.selecting=!0,this.$(".list-actions").slideDown(t),t=this.views.length>=this.THROTTLE_SELECTORS_AT?0:t,a.each(this.views,function(e){e.showSelector(t)})},hideSelectors:function(t){t=void 0!==t?t:this.fxSpeed,this.selecting=!1,this.$(".list-actions").slideUp(t),t=this.views.length>=this.THROTTLE_SELECTORS_AT?0:t,a.each(this.views,function(e){e.hideSelector(t)}),this.selected=[],this.lastSelected=null},toggleSelectors:function(){this.selecting?this.hideSelectors():this.showSelectors()},selectAll:function(t){a.each(this.views,function(e){e.select(t)})},deselectAll:function(t){this.lastSelected=null,a.each(this.views,function(e){e.deselect(t)})},selectRange:function(t,e){var i=this.viewRange(t,e);return a.each(i,function(t){t.select()}),i},getSelectedViews:function(){return a.filter(this.views,function(t){return t.selected})},getSelectedModels:function(){return new this.collection.constructor(a.map(this.getSelectedViews(),function(t){return t.model}))},_showLoadingIndicator:function(t,i,n){this.debug("_showLoadingIndicator",this.indicator,t,i,n),i=void 0!==i?i:this.fxSpeed,this.indicator||(this.indicator=new e(this.$el,this.$el.parent()),this.debug(" created",this.indicator)),this.$el.is(":visible")?(this.$el.fadeOut(i),this.indicator.show(t,i,n)):this.indicator.show(0,n)},_hideLoadingIndicator:function(t,e){this.debug("_hideLoadingIndicator",this.indicator,t,e),t=void 0!==t?t:this.fxSpeed,this.indicator&&this.indicator.hide(t,e)},scrollPosition:function(){return this.$scrollContainer().scrollTop()},scrollTo:function(t,e){return e=e||0,this.$scrollContainer().animate({scrollTop:t},e),this},scrollToTop:function(t){return this.scrollTo(0,t)},scrollToItem:function(t,e){if(!t)return this;var i=t.$el.position().top;return this.scrollTo(i,e)},scrollToId:function(t,e){return this.scrollToItem(this.viewFromModelId(t),e)},events:{"click .select-all":"selectAll","click .deselect-all":"deselectAll"},toString:function(){return"ListPanel("+this.collection+")"}});l.prototype.templates=function(){var t=i.wrapTemplate([""]),e=i.wrapTemplate(['','
",'
<%- view.subtitle %>
','
','
','
",'
','
','',n("All")," ",'',n("None")," ","
",'","
","
"]);return{el:t,controls:e}}();var c=l.extend({modelCollectionKey:"contents",initialize:function(t){l.prototype.initialize.call(this,t),this.selecting=void 0!==t.selecting?t.selecting:!1,this.setModel(this.model,t)},setModel:function(t,e){if(e=e||{},this.debug(this+".setModel:",t,e),this.freeModel(),this.freeViews(),t){var i=this.model?this.model.get("id"):null;this.model=t,this.logger&&(this.model.logger=this.logger),this._setUpModelListeners(),this.collection.off(),this.collection=this.model[this.modelCollectionKey]?this.model[this.modelCollectionKey]:e.collection||new this.collectionClass([]),this._setUpCollectionListeners(),i&&t.get("id")!==i&&this.trigger("new-model",this)}return this},freeModel:function(){return this.model&&this.stopListening(this.model),this},_setUpModelListeners:function(){return this.log(this+"._setUpModelListeners",this.model),this.model.on("error",function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("error"),this.trigger.apply(this,t)},this),this},_renderControls:function(t){this.debug(this+"(ListPanel)._renderControls");var e=this.model?this.model.toJSON():{},i=r(this.templates.controls(e,this));return t.find(".controls").replaceWith(i),i},toString:function(){return"ModelListPanel("+this.model+")"}});return c.prototype.templates=function(){var t=i.wrapTemplate(['','
",'
<%- view.subtitle %>
','
','
','
",'
','
','',n("All")," ",'',n("None")," ","
",'","
","
"]);
return a.extend(a.clone(l.prototype.templates),{controls:t})}(),{ListPanel:l,ModelListPanel:c}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(o,a){n=[i(6),i(5)],s=function(t,e){var i=o.View.extend(t.LoggableMixin).extend(t.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(t){this.listenTo(this.model,"change:tags",function(){this.render()}),this.hiddenUntilActivated(t.$activator,t)},render:function(){var t=this;return this.$el.html(this._template()),this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return t._getTagsUsed()}}),this._setUpBehaviors(),this},_template:function(){return['',e("Tags")," ",' '].join("")},tagsToCSV:function(){var t=this.model.get("tags");return!a.isArray(t)||a.isEmpty(t)?"":t.map(function(t){return a.escape(t)}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.user.get("tags_used")},_setUpBehaviors:function(){var t=this;this.$input().on("change",function(e){t.model.save({tags:e.val},{silent:!0}),e.added&&t._addNewTagToTagsUsed(e.added.text+"")})},_addNewTagToTagsUsed:function(t){var e=Galaxy.user.get("tags_used");a.contains(e,t)||(e.push(t),e.sort(),Galaxy.user.set("tags_used",e))},remove:function(){this.$input.off(),this.stopListening(this.model),o.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:i}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3))},function(t,e,i){var n,s;(function(o,a){n=[i(4)],s=function(t){return o.View.extend({initialize:function(e){this.options=t.merge(e,{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}});var i=this;this.collection=this.options.collection,this.setElement(this._template()),this.rows=[],t.get({url:Galaxy.root+"api/remote_files",success:function(t){i._fill(t)},error:function(){i._fill()}})},events:{mousedown:function(t){t.preventDefault()}},_fill:function(e){if(e&&e.length>0){this.$el.find("#upload-ftp-content").html(a(this._templateTable()));var i=0;for(index in e)this.rows.push(this._add(e[index])),i+=e[index].size;if(this.$el.find("#upload-ftp-number").html(e.length+" files"),this.$el.find("#upload-ftp-disk").html(t.bytesToString(i,!0)),this.collection){var n=this;this.$("._has_collection").show(),this.$select_all=a("#upload-selectall"),this.$select_all.addClass(this.options.class_add),this.$select_all.on("click",function(){var t=n.$select_all.hasClass(n.options.class_add);for(index in e){var i=e[index],s=n._find(i);(!s&&t||s&&!t)&&n.rows[index].trigger("click")}}),this._refresh()}}else this.$el.find("#upload-ftp-content").html(a(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},_add:function(t){var e=this,i=a(this._templateRow(t)),n=i.find(".icon");if(a(this.el).find("tbody").append(i),this.collection){var s="";s=this._find(t)?this.options.class_remove:this.options.class_add,n.addClass(s),i.on("click",function(){var i=e._find(t);n.removeClass(),i?(e.options.onremove(i),n.addClass(e.options.class_add)):(e.options.onadd(t),n.addClass(e.options.class_remove)),e._refresh()})}else i.on("click",function(){e.options.onchange(t)});return i},_refresh:function(){var t=this.collection.where({file_mode:"ftp",enabled:!0});this.$select_all.removeClass(),0==t.length?this.$select_all.addClass(this.options.class_add):t.length==this.rows.length?this.$select_all.addClass(this.options.class_remove):this.$select_all.addClass(this.options.class_partial)},_find:function(t){var e=this.collection.findWhere({file_path:t.path,file_mode:"ftp",enabled:!0});return e&&e.get("id")},_templateRow:function(e){return'
'+e.path+' '+t.bytesToString(e.size)+' '+e.ctime+" "},_templateTable:function(){return'Available files: '},_templateInfo:function(){return'Your FTP directory does not contain any files.
'},_template:function(){return'
This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at '+this.options.ftp_upload_site+' using your Galaxy credentials (email address and password).
'}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o){n=[i(4)],s=function(t){return o.View.extend({options:{class_check:"upload-icon-button fa fa-check-square-o",class_uncheck:"upload-icon-button fa fa-square-o"},initialize:function(t){this.app=t;var e=this;this.setElement(this._template()),this.model=this.app.model,this.$("#upload-space-to-tab").on("click",function(){e._switchState("#upload-space-to-tab","space_to_tab")}),this.$("#upload-to-posix-lines").on("click",function(){e._switchState("#upload-to-posix-lines","to_posix_lines")}),this.render()},events:{mousedown:function(t){t.preventDefault()}},render:function(){this._renderState("#upload-space-to-tab",this.model.get("space_to_tab")),this._renderState("#upload-to-posix-lines",this.model.get("to_posix_lines"));var t=this.$("#upload-settings-cover");this.model.get("enabled")?t.hide():t.show()},_switchState:function(t,e){if(this.model.get("enabled")){var i=!this.model.get(e);this.model.set(e,i),this._renderState(t,i)}},_renderState:function(t,e){var i=this.$(t);i.removeClass(),e?i.addClass(this.options.class_check):i.addClass(this.options.class_uncheck)},_template:function(){return'
Convert spaces to tabs
Use POSIX standard
'}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},,,function(t,e,i){var n,s,o;(function(i,a){!function(i){s=[],n=i,o="function"==typeof n?n.apply(e,s):n,!(void 0!==o&&(t.exports=o))}(function(){i.fn.extend({hoverhighlight:function(t,e){return t=t||"body",this.size()?(a(this).each(function(){var i=a(this),n=i.data("target");n&&i.mouseover(function(i){a(n,t).css({background:e})}).mouseout(function(t){a(n).css({background:""})})}),this):this}})})}).call(e,i(1),i(1))},function(t,e,i){var n,s,o;(function(i,a){!function(i){s=[],n=i,o="function"==typeof n?n.apply(e,s):n,!(void 0!==o&&(t.exports=o))}(function(){function t(t,n){function s(t){var e=i(this).parent().children("input");e.focus().val("").trigger("clear:searchInput"),n.onclear()}function o(t,e){i(this).trigger("search:searchInput",e),"function"==typeof n.onfirstsearch&&g?(g=!1,n.onfirstsearch(e)):n.onsearch(e)}function r(){return['
"].join("")}function l(){return i(r()).focus(function(t){i(this).select()}).keyup(function(t){if(t.preventDefault(),t.stopPropagation(),i(this).val()||i(this).blur(),t.which===u&&n.escWillClear)s.call(this,t);else{var e=i(this).val();t.which===p||n.minSearchLen&&e.length>=n.minSearchLen?o.call(this,t,e):e.length||s.call(this,t)}}).on("change",function(t){o.call(this,t,i(this).val())}).val(n.initialVal)}function c(){return i(['
'].join("")).tooltip({placement:"bottom"}).click(function(t){s.call(this,t)})}function d(){return i(['
'].join("")).hide().tooltip({placement:"bottom"})}function h(){f.find(".search-loading").toggle(),f.find(".search-clear").toggle()}var u=27,p=13,f=i(t),g=!0,m={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(t){},minSearchLen:0,escWillClear:!0,oninit:function(){}};return"string"===a.type(n)?("toggle-loading"===n&&h(),f):("object"===a.type(n)&&(n=a.extend(!0,{},m,n)),f.addClass("search-input").prepend([l(),c(),d()]))}var e=window._l||function(t){return t};a.fn.extend({searchInput:function(e){return this.each(function(){return t(this,e)})}})})}).call(e,i(1),i(1))},,function(t,e,i){var n,s;n=[],s=function(){function t(t,e){var i=/(-?[0-9\.]+)/g,n=t.toString().toLowerCase()||"",s=e.toString().toLowerCase()||"",o=String.fromCharCode(0),a=n.replace(i,o+"$1"+o).split(o),r=s.replace(i,o+"$1"+o).split(o),l=new Date(n).getTime(),c=l?new Date(s).getTime():null;if(c){if(c>l)return-1;if(l>c)return 1}for(var d,h,u=0,p=Math.max(a.length,r.length);p>u;u++){if(d=parseFloat(a[u])||a[u],h=parseFloat(r[u])||r[u],h>d)return-1;if(d>h)return 1}return 0}return t}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){(function(t){!function(e){t.event.props.push("dataTransfer"),e.uploadpost=function(i){var n=e.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use an FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},i),s=n.data;if(s.error_message)return void n.error(s.error_message);var o=new FormData;for(var a in s.payload)o.append(a,s.payload[a]);var r=0;for(var a in s.files){var l=s.files[a];o.append(l.name,l.file,l.file.name),r+=l.file.size}return r>1048576*n.maxfilesize?void n.error(n.error_filesize):(xhr=new XMLHttpRequest,xhr.open("POST",n.url,!0),xhr.setRequestHeader("Accept","application/json"),xhr.setRequestHeader("Cache-Control","no-cache"),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.onreadystatechange=function(){if(xhr.readyState==xhr.DONE){var e=null;if(xhr.responseText)try{e=t.parseJSON(xhr.responseText)}catch(i){e=xhr.responseText}if(xhr.status<200||xhr.status>299){var s=xhr.statusText;403==xhr.status?s=n.error_login:0==xhr.status?s=n.error_server:s||(s=n.error_default),n.error(s+" ("+xhr.status+")")}else n.success(e)}},xhr.upload.addEventListener("progress",function(t){t.lengthComputable&&n.progress(Math.round(100*t.loaded/t.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),void xhr.send(o))},e.fn.uploadinput=function(t){var i=this,n=e.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},t),s=e('
");return i.append(s).change(function(t){n.onchange(t.target.files),e(this).val("")}),i.on("drop",function(t){n.ondragleave(t),t.dataTransfer&&(n.onchange(t.dataTransfer.files),t.preventDefault())}),i.on("dragover",function(t){t.preventDefault(),n.ondragover(t)}),i.on("dragleave",function(t){t.stopPropagation(),n.ondragleave(t)}),{dialog:function(){s.trigger("click")}}},e.fn.uploadbox=function(t){function i(t){if(t&&t.length&&!g){for(var e=p,i=0;i
','
'," "].join("")},toString:function(){return"HistoryPanel"}});t.exports=a},function(t,e,i){(function(e,n){var s=i(13).LeftPanel,o=i(51),a=i(138),r=i(5),l=s.extend({title:r("Tools"),initialize:function(t){s.prototype.initialize.call(this,t),this.log(this+".initialize:",t),this.stored_workflow_menu_entries=t.stored_workflow_menu_entries||[];var e=new o.ToolSearch({spinner_url:t.spinner_url,search_url:t.search_url,hidden:!1}),i=new o.ToolCollection(t.toolbox);this.tool_panel=new o.ToolPanel({tool_search:e,tools:i,layout:t.toolbox_in_panel}),this.tool_panel_view=new o.ToolPanelView({model:this.tool_panel}),this.uploadButton=new a({nginx_upload_path:t.nginx_upload_path,ftp_upload_site:t.ftp_upload_site,default_genome:t.default_genome,default_extension:t.default_extension})},render:function(){var t=this;s.prototype.render.call(t),t.$(".panel-header-buttons").append(t.uploadButton.$el),t.tool_panel.get("layout").size()>0&&(t.tool_panel_view.render(),t.$(".toolMenu").show()),t.$(".toolMenuContainer").prepend(t.tool_panel_view.$el),t._renderWorkflowMenu(),t.$("a[minsizehint]").click(function(){parent.handle_minwidth_hint&&parent.handle_minwidth_hint(e(t).attr("minsizehint"))})},_renderWorkflowMenu:function(){var t=this;t.$("#internal-workflows").append(t._templateTool({title:r("All workflows"),href:"workflow/list_for_run"})),n.each(t.stored_workflow_menu_entries,function(e){t.$("#internal-workflows").append(t._templateTool({title:e.stored_workflow.name,href:"workflow/run?id="+e.encoded_stored_workflow_id}))})},_templateTool:function(t){return['
"].join("")},_templateBody:function(){return['
','","
"].join("")},toString:function(){return"ToolPanel"}});t.exports=l}).call(e,i(1),i(3))},,,,,,,,,,function(t,e,i){var n,s;(function(o,a){n=[i(34),i(94),i(6),i(5)],s=function(t,e,i,n){var s=t.DCListItemView,r=s.extend({initialize:function(t){s.prototype.initialize.call(this,t)},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCListItemEdit("+t+")"}}),l=t.DCEListItemView,c=l.extend({initialize:function(t){l.prototype.initialize.call(this,t)},toString:function(){var t=this.model?this.model+"":"(no model)";return"DCEListItemEdit("+t+")"}}),d=e.DatasetListItemEdit.extend({initialize:function(t){e.DatasetListItemEdit.prototype.initialize.call(this,t)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):o.when()},_renderDeleteButton:function(){return null},toString:function(){var t=this.model?this.model+"":"(no model)";return"DatasetDCEListItemEdit("+t+")"}});d.prototype.templates=function(){return a.extend({},e.DatasetListItemEdit.prototype.templates,{titleBar:t.DatasetDCEListItemView.prototype.templates.titleBar})}();var h=t.NestedDCDCEListItemView.extend({toString:function(){var t=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemEdit("+t+")"}});return{DCListItemEdit:r,DCEListItemEdit:c,DatasetDCEListItemEdit:d,NestedDCDCEListItemEdit:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(1),i(3))},function(t,e,i){var n,s;n=[i(93),i(35),i(122),i(6),i(5),i(20)],s=function(t,e,i,n,s){var o=t.CollectionView,a=o.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,NestedDCDCEViewClass:i.NestedDCDCEListItemEdit,initialize:function(t){o.prototype.initialize.call(this,t)},_setUpBehaviors:function(t){if(t=t||this.$el,o.prototype._setUpBehaviors.call(this,t),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()){var e=this,i="> .controls .name";t.find(i).attr("title",s("Click to rename collection")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(t){var n=e.model.get("name");t&&t!==n?(e.$el.find(i).text(t),e.model.save({name:t}).fail(function(){e.$el.find(i).text(e.model.previous("name"))})):e.$el.find(i).text(n)}})}},toString:function(){return"CollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),r=a.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,toString:function(){return"ListCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),l=r.extend({toString:function(){return"PairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),c=l.extend({_setUpBehaviors:function(t){o.prototype._setUpBehaviors.call(this,t)},toString:function(){return"NestedPairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),d=a.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemEdit.extend({foldoutPanelClass:c}),toString:function(){return"ListOfPairsCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}});return{CollectionViewEdit:a,ListCollectionViewEdit:r,PairCollectionViewEdit:l,ListOfPairsCollectionViewEdit:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(145),i(109),i(36),i(6),i(5),i(106)],s=function(t,e,i,n,s){function c(t){function e(){return i.length||(i=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]),i}t=t||{},t.createPair=t.createPair||function(t){return this.debug("creating pair:",t.listA[t.indexA].name,t.listB[t.indexB].name),t=t||{},this._pair(t.listA.splice(t.indexA,1)[0],t.listB.splice(t.indexB,1)[0],{silent:!0})};var i=[];return t.preprocessMatch=t.preprocessMatch||function(t){var i=e.call(this);return a.extend(t,{matchTo:t.matchTo.name.replace(i[0],""),possible:t.possible.name.replace(i[1],"")})},function(e){this.debug("autopair _strategy ---------------------------"),e=e||{};var i,n=e.listA,s=e.listB,o=0,a={score:0,index:null},r=[];for(this.debug("starting list lens:",n.length,s.length),this.debug("bestMatch (starting):",JSON.stringify(a,null," "));o
=d?(this.debug("creating pair"),r.push(t.createPair.call(this,{listA:n,indexA:o,listB:s,indexB:a.index})),this.debug("list lens now:",n.length,s.length)):o+=1,!n.length||!s.length)return r}return this.debug("paired:",JSON.stringify(r,null," ")),this.debug("autopair _strategy ---------------------------"),r}}function d(t){var e=t.toJSON();return f(e,{historyId:t.historyId})}var h="collections",u=o.View.extend(n.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"dataset paired",initialize:function(t){this.pair=t.pair||{}},template:a.template(['<%- pair.forward.name %> ','','<%- pair.name %> '," ",'<%- pair.reverse.name %> '].join("")),render:function(){return this.$el.attr("draggable",!0).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container"),this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(t){t.currentTarget.style.opacity="0.4",t.originalEvent&&(t=t.originalEvent),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",JSON.stringify(this.pair)),this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(t){t.currentTarget.style.opacity="1.0",this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(t){this.$el.parent().trigger(t)},toString:function(){return"PairView("+this.pair.name+")"}}),p=o.View.extend(n.LoggableMixin).extend({_logNamespace:h,className:"list-of-pairs-collection-creator collection-creator flex-row-container",initialize:function(t){this.metric("PairedCollectionCreator.initialize",t),t=a.defaults(t,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:!0,strategy:"lcs",matchPercentage:.9,twoPassAutopairing:!0}),this.initialList=t.datasets,this.historyId=t.historyId,this.filters=this.commonFilters[t.filters]||this.commonFilters[this.DEFAULT_FILTERS],a.isArray(t.filters)&&(this.filters=t.filters),this.automaticallyPair=t.automaticallyPair,this.strategy=this.strategies[t.strategy]||this.strategies[this.DEFAULT_STRATEGY],a.isFunction(t.strategy)&&(this.strategy=t.strategy),this.matchPercentage=t.matchPercentage,this.twoPassAutopairing=t.twoPassAutopairing,this.removeExtensions=!0,this.oncancel=t.oncancel,this.oncreate=t.oncreate,this.autoscrollDist=t.autoscrollDist||24,this.unpairedPanelHidden=!1,this.pairedPanelHidden=!1,this.$dragging=null,this.blocking=!1,this._setUpBehaviors(),this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[],this.unpaired=[],this.selectedIds=[],this._sortInitialList(),this._ensureIds(),this.unpaired=this.initialList.slice(0),this.automaticallyPair&&(this.autoPair(),this.once("rendered:initial",function(){this.trigger("autopair")}))},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(t){return t.sort(function(t,i){return e(t.name,i.name)}),t},_ensureIds:function(){return this.initialList.forEach(function(t){t.hasOwnProperty("id")||(t.id=a.uniqueId())}),this.initialList},_splitByFilters:function(){function t(t,e){return e.test(t.name)}var e=this.filters.map(function(t){return new RegExp(t)}),i=[[],[]];return this.unpaired.forEach(function(n){e.forEach(function(e,s){t(n,e)&&i[s].push(n)})}),i},_addToUnpaired:function(t){var i=function(n,s){if(n===s)return n;var o=Math.floor((s-n)/2)+n,a=e(t.name,this.unpaired[o].name);if(0>a)return i(n,o);if(a>0)return i(o+1,s);for(;this.unpaired[o]&&this.unpaired[o].name===t.name;)o++;return o}.bind(this);this.unpaired.splice(i(0,this.unpaired.length),0,t)},autoPair:function(t){var e=this._splitByFilters(),i=[];return this.twoPassAutopairing&&(i=this.autopairSimple({listA:e[0],listB:e[1]}),e=this._splitByFilters()),t=t||this.strategy,e=this._splitByFilters(),i=i.concat(this[t].call(this,{listA:e[0],listB:e[1]}))},autopairSimple:c({scoreThreshold:function(){return 1},match:function(t){return t=t||{},t.matchTo===t.possible?{index:t.index,score:1}:t.bestMatch}}),autopairLevenshtein:c({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var i=t(e.matchTo,e.possible),n=1-i/Math.max(e.matchTo.length,e.possible.length);return n>e.bestMatch.score?{index:e.index,score:n}:e.bestMatch}}),autopairLCS:c({scoreThreshold:function(){return this.matchPercentage},match:function(t){t=t||{};var e=this._naiveStartingAndEndingLCS(t.matchTo,t.possible).length,i=e/Math.max(t.matchTo.length,t.possible.length);return i>t.bestMatch.score?{index:t.index,score:i}:t.bestMatch}}),_naiveStartingAndEndingLCS:function(t,e){for(var i="",n="",s=0,o=0;s=0&&o>=0&&t[s]===e[o];)n=[t[s],n].join(""),s-=1,o-=1;return i+n},_pair:function(t,e,i){i=i||{};var n=this._createPair(t,e,i.name);return this.paired.push(n),this.unpaired=a.without(this.unpaired,t,e),i.silent||this.trigger("pair:new",n),n},_createPair:function(t,e,i){if(!t||!e||t===e)throw new Error("Bad pairing: "+[JSON.stringify(t),JSON.stringify(e)]);return i=i||this._guessNameForPair(t,e),{forward:t,name:i,reverse:e}},_guessNameForPair:function(t,e,i){i=void 0!==i?i:this.removeExtensions;var n=t.name,s=e.name,o=this._naiveStartingAndEndingLCS(n.replace(new RegExp(this.filters[0]),""),s.replace(new RegExp(this.filters[1]),""));if(i){var a=o.lastIndexOf(".");if(a>0){var r=o.slice(a,o.length);o=o.replace(r,""),n=n.replace(r,""),s=s.replace(r,"")}}return o||n+" & "+s},_unpair:function(t,e){if(e=e||{},!t)throw new Error("Bad pair: "+JSON.stringify(t));return this.paired=a.without(this.paired,t),this._addToUnpaired(t.forward),this._addToUnpaired(t.reverse),e.silent||this.trigger("pair:unpair",[t]),t},unpairAll:function(){for(var t=[];this.paired.length;)t.push(this._unpair(this.paired[0],{silent:!0}));this.trigger("pair:unpair",t)},_pairToJSON:function(t,e){return e=e||"hda",{collection_type:"paired",src:"new_collection",name:t.name,element_identifiers:[{name:"forward",id:t.forward.id,src:e},{name:"reverse",id:t.reverse.id,src:e}]}},createList:function(t){var e=this,i=Galaxy.root+"api/histories/"+this.historyId+"/contents/dataset_collections",n={type:"dataset_collection",collection_type:"list:paired",name:a.escape(t||e.$(".collection-name").val()),element_identifiers:e.paired.map(function(t){return e._pairToJSON(t)})};return e.blocking=!0,r.ajax(i,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(n)}).always(function(){e.blocking=!1}).fail(function(t,i,n){e._ajaxErrHandler(t,i,n)}).done(function(t,i,n){e.trigger("collection:created",t,i,n),e.metric("collection:created",t),"function"==typeof e.oncreate&&e.oncreate.call(this,t,i,n)})},_ajaxErrHandler:function(t,e,i){this.error(t,e,i);var n=s("An error occurred while creating this collection");t&&(n+=0===t.readyState&&0===t.status?": "+s("Galaxy could not be reached and may be updating.")+s(" Try again in a few minutes."):t.responseJSON?""+JSON.stringify(t.responseJSON)+" ":": "+i),creator._showAlert(n,"alert-danger")},render:function(t,e){return this.$el.empty().html(p.templates.main()),this._renderHeader(t),this._renderMiddle(t),this._renderFooter(t),this._addPluginComponents(),this.trigger("rendered",this),this},_renderHeader:function(t,e){var i=this.$(".header").empty().html(p.templates.header()).find(".help-content").prepend(l(p.templates.helpContent()));return this._renderFilters(),i},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(t,e){var i=this.$(".middle").empty().html(p.templates.middle());return this.unpairedPanelHidden?this.$(".unpaired-columns").hide():this.pairedPanelHidden&&this.$(".paired-columns").hide(),this._renderUnpaired(),this._renderPaired(),i},_renderUnpaired:function(t,e){var i,n,o=this,a=[],r=this._splitByFilters();return this.$(".forward-column .title").text([r[0].length,s("unpaired forward")].join(" ")),this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[0].length)),this.$(".reverse-column .title").text([r[1].length,s("unpaired reverse")].join(" ")),this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[1].length)),this.$(".unpaired-columns .column-datasets").empty(),this.$(".autopair-link").toggle(0!==this.unpaired.length),0===this.unpaired.length?void this._renderUnpairedEmpty():(n=r[1].map(function(t,e){return void 0!==r[0][e]&&r[0][e]!==t&&a.push(o._renderPairButton()),o._renderUnpairedDataset(t)}),i=r[0].map(function(t){return o._renderUnpairedDataset(t)}),i.length||n.length?(this.$(".unpaired-columns .forward-column .column-datasets").append(i).add(this.$(".unpaired-columns .paired-column .column-datasets").append(a)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(n)),void this._adjUnpairedOnScrollbar()):void this._renderUnpairedNotShown())},_renderUnpairedDisplayStr:function(t){return["(",t," ",s("filtered out"),")"].join("")},_renderUnpairedDataset:function(t){return l(" ").attr("id","dataset-"+t.id).addClass("dataset unpaired").attr("draggable",!0).addClass(t.selected?"selected":"").append(l(" ").addClass("dataset-name").text(t.name)).data("dataset",t)},_renderPairButton:function(){return l(" ").addClass("dataset unpaired").append(l(" ").addClass("dataset-name").text(s("Pair these datasets")))},_renderUnpairedEmpty:function(){var t=l('
').text("("+s("no remaining unpaired datasets")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(t),t},_renderUnpairedNotShown:function(){var t=l('
').text("("+s("no datasets were found matching the current filters")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(t),t},_adjUnpairedOnScrollbar:function(){var t=this.$(".unpaired-columns").last(),e=this.$(".unpaired-columns .reverse-column .dataset").first();if(e.size()){var i=t.offset().left+t.outerWidth(),n=e.offset().left+e.outerWidth(),s=Math.floor(i)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",s>0?s:0)}},_renderPaired:function(t,e){if(this.$(".paired-column-title .title").text([this.paired.length,s("paired")].join(" ")),this.$(".unpair-all-link").toggle(0!==this.paired.length),0===this.paired.length)return void this._renderPairedEmpty();
-this.$(".remove-extensions-link").show(),this.$(".paired-columns .column-datasets").empty();var i=this;this.paired.forEach(function(t,e){var n=new u({pair:t});i.$(".paired-columns .column-datasets").append(n.render().$el).append(['',' '," "].join(""))})},_renderPairedEmpty:function(){var t=l('
').text("("+s("no paired datasets yet")+")");return this.$(".paired-columns .column-datasets").empty().prepend(t),t},_renderFooter:function(t,e){var i=this.$(".footer").empty().html(p.templates.footer());return this.$(".remove-extensions").prop("checked",this.removeExtensions),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),i},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link"),this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(t){function e(t,e){return['',s("Forward"),": ",t,", ",s("Reverse"),": ",e," "].join("")}var i=l(a.template(['','
',s("Choose from the following filters to change which unpaired reads are shown in the display"),":
",a.values(this.commonFilters).map(function(t){return e(t[0],t[1])}).join(""),"
"].join(""))({}));return this.$(t).popover({container:".collection-creator",placement:"bottom",html:!0,content:i})},_validationWarning:function(t,e){var i="validation-warning";"name"===t&&(t=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),e?(t=t||this.$("."+i),t.removeClass(i)):t.addClass(i)},_setUpBehaviors:function(){return this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("pair:new",function(){this._renderUnpaired(),this._renderPaired(),this.$(".paired-columns").scrollTop(8e6)}),this.on("pair:unpair",function(t){this._renderUnpaired(),this._renderPaired(),this.splitView()}),this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()],this.metric("filter-change",this.filters),this._renderFilters(),this._renderUnpaired()}),this.on("autopair",function(){this._renderUnpaired(),this._renderPaired();var t,e=null;this.paired.length?(e="alert-success",t=this.paired.length+" "+s("pairs created"),this.unpaired.length||(t+=": "+s("all datasets have been successfully paired"),this.hideUnpaired(),this.$(".collection-name").focus())):t=s("Could not automatically create any pairs from the given dataset names"),this._showAlert(t,e)}),this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(t){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(t){l(t.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(t){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(t){l(t.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(t){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","click .cancel-create":function(t){"function"==typeof this.oncancel&&this.oncancel.call(this)},"click .create-collection":"_clickCreate"},_clickMoreHelp:function(t){this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(t){this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_showAlert:function(t,e){e=e||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(e).show().find(".alert-message").html(t)},_hideAlert:function(t){this.$(".main-help").show(),this.$(".header .alert").hide()},_clickShowOnlyUnpaired:function(t){this.$(".paired-columns").is(":visible")?this.hidePaired():this.splitView()},_clickShowOnlyPaired:function(t){this.$(".unpaired-columns").is(":visible")?this.hideUnpaired():this.splitView()},hideUnpaired:function(t,e){this.unpairedPanelHidden=!0,this.pairedPanelHidden=!1,this._renderMiddle(t,e)},hidePaired:function(t,e){this.unpairedPanelHidden=!1,this.pairedPanelHidden=!0,this._renderMiddle(t,e)},splitView:function(t,e){return this.unpairedPanelHidden=this.pairedPanelHidden=!1,this._renderMiddle(t,e),this},_clickUnpairAll:function(t){this.metric("unpairAll"),this.unpairAll()},_clickAutopair:function(t){var e=this.autoPair();this.metric("autopair",e.length,this.unpaired.length),this.trigger("autopair")},_clickFilterChoice:function(t){var e=l(t.currentTarget);this.$(".forward-unpaired-filter input").val(e.data("forward")),this.$(".reverse-unpaired-filter input").val(e.data("reverse")),this._hideChooseFilters(),this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide"),this.$(".popover").css("display","none")},_clearFilters:function(t){this.$(".forward-unpaired-filter input").val(""),this.$(".reverse-unpaired-filter input").val(""),this.trigger("filter-change")},_clickUnpairedDataset:function(t){return t.stopPropagation(),this.toggleSelectUnpaired(l(t.currentTarget))},toggleSelectUnpaired:function(t,e){e=e||{};var i=t.data("dataset"),n=void 0!==e.force?e.force:!t.hasClass("selected");return t.size()&&void 0!==i?(n?(t.addClass("selected"),e.waitToPair||this.pairAllSelected()):t.removeClass("selected"),t):t},pairAllSelected:function(t){t=t||{};var e=this,i=[],n=[],s=[];return e.$(".unpaired-columns .forward-column .dataset.selected").each(function(){i.push(l(this).data("dataset"))}),e.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){n.push(l(this).data("dataset"))}),i.length=n.length=Math.min(i.length,n.length),i.forEach(function(t,i){try{s.push(e._pair(t,n[i],{silent:!0}))}catch(o){e.error(o)}}),s.length&&!t.silent&&this.trigger("pair:new",s),s},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(t){if(t.shiftKey){var e=this,i=l(t.target).addClass("selected"),n=function(t){e.$(t.target).filter(".dataset").addClass("selected")};i.parent().on("mousemove",n),l(document).one("mouseup",function(t){i.parent().off("mousemove",n),e.pairAllSelected()})}},_clickPairRow:function(t){var e=l(t.currentTarget).index(),i=l(".unpaired-columns .forward-column .dataset").eq(e).data("dataset"),n=l(".unpaired-columns .reverse-column .dataset").eq(e).data("dataset");this._pair(i,n)},_startPartitionDrag:function(t){function e(t){n.$(".flexible-partition-drag").css("color",""),l("body").css("cursor","").unbind("mousemove",i)}function i(t){var e=t.pageY-s;n.adjPartition(e)||l("body").trigger("mouseup"),n._adjUnpairedOnScrollbar(),s+=e}var n=this,s=t.pageY;l("body").css("cursor","ns-resize"),n.$(".flexible-partition-drag").css("color","black"),l("body").mousemove(i),l("body").one("mouseup",e)},adjPartition:function(t){var e=this.$(".unpaired-columns"),i=this.$(".paired-columns"),n=parseInt(e.css("height"),10),s=parseInt(i.css("height"),10);n=Math.max(10,n+t),s-=t;var o=0>t;if(o){if(this.unpairedPanelHidden)return!1;if(10>=n)return this.hideUnpaired(),!1}else this.unpairedPanelHidden&&(e.show(),this.unpairedPanelHidden=!1);if(o)this.pairedPanelHidden&&(i.show(),this.pairedPanelHidden=!1);else{if(this.pairedPanelHidden)return!1;if(15>=s)return this.hidePaired(),!1}return e.css({height:n+"px",flex:"0 0 auto"}),!0},selectPair:function(t){t.stopPropagation(),l(t.currentTarget).toggleClass("selected")},clearSelectedPaired:function(t){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(t){t.stopPropagation();var e=l(t.currentTarget),i=e.parent().parent(),n=i.index(".dataset.paired"),s=this.paired[n],o=prompt("Enter a new name for the pair:",s.name);o&&(s.name=o,s.customizedName=!0,e.text(s.name))},_clickUnpair:function(t){var e=Math.floor(l(t.currentTarget).index(".unpair-btn"));this._unpair(this.paired[e])},_dragoverPairedColumns:function(t){t.preventDefault();var e=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(e,t.originalEvent.clientY);var i=this._getNearestPairedDatasetLi(t.originalEvent.clientY);l(".element-drop-placeholder").remove();var n=l('
');i.size()?i.before(n):e.append(n)},_checkForAutoscroll:function(t,e){var i=2,n=t.offset(),s=t.scrollTop(),o=e-n.top,a=n.top+t.outerHeight()-e;o>=0&&o=0&&at&&t>o-a)return s}return l()},_dropPairedColumns:function(t){t.preventDefault(),t.dataTransfer.dropEffect="move";var e=this._getNearestPairedDatasetLi(t.originalEvent.clientY);return e.size()?this.$dragging.insertBefore(e):this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last()),this._syncPairsToDom(),!1},_syncPairsToDom:function(){var t=[];this.$(".paired-columns .dataset.paired").each(function(){t.push(l(this).data("pair"))}),this.paired=t,this._renderPaired()},_pairDragstart:function(t,e){e.$el.addClass("selected");var i=this.$(".paired-columns .dataset.selected");this.$dragging=i},_pairDragend:function(t,e){l(".element-drop-placeholder").remove(),this.$dragging=null},toggleExtensions:function(t){var e=this;e.removeExtensions=void 0!==t?t:!e.removeExtensions,a.each(e.paired,function(t){t.customizedName||(t.name=e._guessNameForPair(t.forward,t.reverse))}),e._renderPaired(),e._renderFooter()},_changeName:function(t){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(t){13!==t.keyCode||this.blocking||this._clickCreate()},_getName:function(){return a.escape(this.$(".collection-name").val())},_clickCreate:function(t){var e=this._getName();e?this.blocking||this.createList():this._validationWarning("name")},_printList:function(t){var e=this;a.each(t,function(i){t===e.paired&&e._printPair(i)})},_printPair:function(t){this.debug(t.forward.name,t.reverse.name,": ->",t.name)},toString:function(){return"PairedCollectionCreator"}});p.templates=p.templates||{main:a.template(['','
','