Merge conflicts

This commit is contained in:
Carl Eberhard
2015-08-07 14:14:49 -04:00
143 changed files with 6269 additions and 1364 deletions
+4 -4
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(a,b){history={};var c=Backbone.View.extend({initialize:function(c,d){this.app=c,this.options=d;var e=this;this.setElement('<div class="ui-select-content"/>'),this.list={};var f=[];this.mode="data_collection"==d.type?"collection":d.multiple?"multiple":"single",this.current=this.mode,this.list={};var g=a.textify(d.extensions),h="No dataset available.";g&&(h="No "+g+" dataset available.");var i="No dataset list available.";g&&(i="No "+g+" dataset collection available."),"single"==this.mode&&(f.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new b.Select.View({optional:d.optional,error_text:h,onchange:function(){e.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(f.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new b.Select.View({multiple:!0,searchable:!1,optional:d.optional,error_text:h,onchange:function(){e.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),("single"==this.mode||"multiple"==this.mode||"collection"==this.mode)&&(f.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"}),this.select_collection=new b.Select.View({error_text:i,optional:d.optional,onchange:function(){e.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}),this.button_type=new b.RadioButton.View({value:this.current,data:f,onchange:function(a){e.current=a,e.refresh(),e.trigger("change")}}),this.$batch=$(this.template_batch());var j=_.size(this.list),k=0;j>1&&(this.$el.append(this.button_type.$el),k=Math.max(0,35*_.size(this.list))+"px");for(var l in this.list)this.$el.append(this.list[l].field.$el.css({"margin-left":k}));this.$el.append(this.$batch.css({"margin-left":k})),this.update(d.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){d.onchange&&d.onchange(e.value())})},wait:function(){for(var a in this.list)this.list[a].field.wait()},unwait:function(){for(var a in this.list)this.list[a].field.unwait()},update:function(a){function b(a,b){if(a){var c=[];for(var d in b){var e=b[d];c.push({label:e.hid+": "+e.name,value:e.id}),history[e.id+"_"+e.src]=e}a.update(c)}}b(this.select_single,a.hda),b(this.select_multiple,a.hda),b(this.select_collection,a.hdca)},value:function(a){if(void 0!==a)if(a&&a.values)try{var b=[];for(var c in a.values)b.push(a.values[c].id);a&&a.values.length>0&&"hdca"==a.values[0].src?(this.current="collection",this.select_collection.value(b[0])):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(b)):(this.current="single",this.select_single.value(b[0]))}catch(d){console.debug("tools-select-content::value() - Skipped.")}else for(var c in this.list)this.list[c].field.value(null);this.refresh();var e=this._select().value();if(null===e)return null;if(e instanceof Array||(e=[e]),0===e.length)return null;var f={batch:this._batch(),values:[]};for(var c in e){var g=history[e[c]+"_"+this.list[this.current].type];if(!g)return null;f.values.push(g)}return f.values.sort(function(a,b){return a.hid-b.hid}),f},refresh:function(){this.button_type.value(this.current);for(var a in this.list){var b=this.list[a].field.$el;this.current==a?b.show():b.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var a=history[this._select().value()+"_hdca"];if(a&&a.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'<div class="ui-table-form-info"><i class="fa fa-sitemap" style="font-size: 1.2em; padding: 2px 5px;"/>This is a batch mode input field. A separate job will be triggered for each dataset.</div>'}});return{View:c}});
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(a,b){var c=Backbone.View.extend({initialize:function(c,d){this.app=c,this.options=d,this.history={};var e=this;this.setElement('<div class="ui-select-content"/>'),this.list={};var f=[];this.mode="data_collection"==d.type?"collection":d.multiple?"multiple":"single",this.current=this.mode,this.list={};var g=a.textify(d.extensions),h="No dataset available.";g&&(h="No "+g+" dataset available.");var i="No dataset list available.";g&&(i="No "+g+" dataset collection available."),"single"==this.mode&&(f.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new b.Select.View({optional:d.optional,error_text:h,onchange:function(){e.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(f.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new b.Select.View({multiple:!0,searchable:!1,optional:d.optional,error_text:h,onchange:function(){e.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),("single"==this.mode||"multiple"==this.mode||"collection"==this.mode)&&(f.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"}),this.select_collection=new b.Select.View({error_text:i,optional:d.optional,onchange:function(){e.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}),this.button_type=new b.RadioButton.View({value:this.current,data:f,onchange:function(a){e.current=a,e.refresh(),e.trigger("change")}}),this.$batch=$(this.template_batch());var j=_.size(this.list),k=0;j>1&&(this.$el.append(this.button_type.$el),k=Math.max(0,35*_.size(this.list))+"px");for(var l in this.list)this.$el.append(this.list[l].field.$el.css({"margin-left":k}));this.$el.append(this.$batch.css({"margin-left":k})),this.update(d.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){d.onchange&&d.onchange(e.value())})},wait:function(){for(var a in this.list)this.list[a].field.wait()},unwait:function(){for(var a in this.list)this.list[a].field.unwait()},update:function(a){function b(a,b){if(a){var d=[];for(var e in b){var f=b[e];d.push({label:f.hid+": "+f.name,value:f.id}),c.history[f.id+"_"+f.src]=f}a.update(d)}}var c=this;b(this.select_single,a.hda),b(this.select_multiple,a.hda),b(this.select_collection,a.hdca)},value:function(a){if(void 0!==a)if(a&&a.values)try{var b=[];for(var c in a.values)b.push(a.values[c].id);a&&a.values.length>0&&"hdca"==a.values[0].src?(this.current="collection",this.select_collection.value(b[0])):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(b)):(this.current="single",this.select_single.value(b[0]))}catch(d){console.debug("tools-select-content::value() - Skipped.")}else for(var c in this.list)this.list[c].field.value(null);this.refresh();var e=this._select().value();if(null===e)return null;if(e instanceof Array||(e=[e]),0===e.length)return null;var f={batch:this._batch(),values:[]};for(var c in e){var g=this.history[e[c]+"_"+this.list[this.current].type];if(!g)return null;f.values.push(g)}return f.values.sort(function(a,b){return a.hid-b.hid}),f},refresh:function(){this.button_type.value(this.current);for(var a in this.list){var b=this.list[a].field.$el;this.current==a?b.show():b.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var a=this.history[this._select().value()+"_hdca"];if(a&&a.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'<div class="ui-table-form-info"><i class="fa fa-sitemap" style="font-size: 1.2em; padding: 2px 5px;"/>This is a batch mode input field. A separate job will be triggered for each dataset.</div>'}});return{View:c}});
//# sourceMappingURL=../../../maps/mvc/form/form-select-content.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/history/history-contents","mvc/base-mvc","utils/localization"],function(a,b){var c=Backbone.Model.extend(b.LoggableMixin).extend(b.mixin(b.SearchableModelMixin,{defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:!1},urlRoot:galaxy_config.root+"api/histories",initialize:function(b,c,d){d=d||{},this.logger=d.logger||null,this.log(this+".initialize:",b,c,d),this.log("creating history contents:",c),this.contents=new a.HistoryContents(c||[],{historyId:this.get("id")}),this._setUpListeners(),this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(a,b,c,d,e){this.errorHandler(a,b,c,d,e)}),this.contents&&this.listenTo(this.contents,"error",function(){this.trigger.apply(this,["error:contents"].concat(jQuery.makeArray(arguments)))}),this.on("change:id",function(a,b){this.contents&&(this.contents.historyId=b)},this)},errorHandler:function(){this.clearUpdateTimeout()},ownedByCurrUser:function(){return Galaxy&&Galaxy.currUser?Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")?!1:!0:!1},contentsCount:function(){return _.reduce(_.values(this.get("state_details")),function(a,b){return a+b},0)},searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},checkForUpdates:function(a){return this.contents.running().length?this.setUpdateTimeout():(this.trigger("ready"),_.isFunction(a)&&a.call(this)),this},setUpdateTimeout:function(a){a=a||c.UPDATE_DELAY;var b=this;return this.clearUpdateTimeout(),this.updateTimeoutId=setTimeout(function(){b.refresh()},a),this.updateTimeoutId},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},refresh:function(a,b){a=a||[],b=b||{};var c=this;b.data=b.data||{},a.length&&(b.data.details=a.join(","));var d=this.contents.fetch(b);return d.done(function(){c.checkForUpdates(function(){this.fetch()})}),d},_delete:function(a){return this.get("deleted")?jQuery.when():this.save({deleted:!0},a)},purge:function(a){return this.get("purged")?jQuery.when():this.save({deleted:!0,purged:!0},a)},undelete:function(a){return this.get("deleted")?this.save({deleted:!1},a):jQuery.when()},copy:function(a,b){if(a=void 0!==a?a:!0,!this.id)throw new Error("You must set the history ID before copying it.");var d={history_id:this.id};a&&(d.current=!0),b&&(d.name=b);var e=this,f=jQuery.post(this.urlRoot,d);return a?f.then(function(a){var b=new c(a);return b.setAsCurrent().done(function(){e.trigger("copied",e,a)})}):f.done(function(a){e.trigger("copied",e,a)})},setAsCurrent:function(){var a=this,b=jQuery.getJSON(galaxy_config.root+"history/set_as_current?id="+this.id);return b.done(function(){a.trigger("set-as-current",a)}),b},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}}));c.UPDATE_DELAY=4e3,c.getHistoryData=function(a,b){function c(){return"current"===a?jQuery.getJSON(galaxy_config.root+"history/current_history_json"):jQuery.ajax(galaxy_config.root+"api/histories/"+a)}function d(a){return a&&a.empty}function e(a){if(d(a))return[];_.isFunction(f)&&(f=f(a)),_.isFunction(g)&&(g=g(a));var b={};return f.length&&(b.dataset_details=f.join(",")),g.length&&(b.dataset_collection_details=g.join(",")),jQuery.ajax(galaxy_config.root+"api/histories/"+a.id+"/contents",{data:b})}b=b||{};var f=b.detailIdsFn||[],g=b.hdcaDetailIds||[],h=jQuery.Deferred(),i=null,j=b.historyFn||c,k=b.contentsFn||e,l=j(a);l.done(function(a){i=a,h.notify({status:"history data retrieved",historyJSON:i})}),l.fail(function(a){h.reject(a,"loading the history")});var m=l.then(k);return m.then(function(a){h.notify({status:"contents data retrieved",historyJSON:i,contentsJSON:a}),h.resolve(i,a)}),m.fail(function(a){h.reject(a,"loading the contents",{history:i})}),h};var d=Backbone.Collection.extend(b.LoggableMixin).extend({model:c,urlRoot:(window.galaxy_config?galaxy_config.root:"/")+"api/histories",initialize:function(a,b){b=b||{},this.log("HistoryCollection.initialize",arguments),this.includeDeleted=b.includeDeleted||!1,this.setUpListeners()},setUpListeners:function(){var a=this;this.on("change:deleted",function(b){this.debug("change:deleted",a.includeDeleted,b.get("deleted")),!a.includeDeleted&&b.get("deleted")&&a.remove(b)}),this.on("copied",function(a,b){this.unshift(new c(b,[]))})},create:function(a,b,d){var e=this,f=jQuery.getJSON(galaxy_config.root+"history/create_new_current");return f.done(function(a){var b=new c(a,[],d||{});e.unshift(b),e.trigger("new-current")})},toString:function(){return"HistoryCollection("+this.length+")"}});return{History:c,HistoryCollection:d}});
define(["mvc/history/history-contents","utils/utils","mvc/base-mvc","utils/localization"],function(a,b,c){var d=Backbone.Model.extend(c.LoggableMixin).extend(c.mixin(c.SearchableModelMixin,{defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:!1},urlRoot:galaxy_config.root+"api/histories",initialize:function(b,c,d){d=d||{},this.logger=d.logger||null,this.log(this+".initialize:",b,c,d),this.log("creating history contents:",c),this.contents=new a.HistoryContents(c||[],{historyId:this.get("id")}),this._setUpListeners(),this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(a,b,c,d,e){this.errorHandler(a,b,c,d,e)}),this.contents&&this.listenTo(this.contents,"error",function(){this.trigger.apply(this,["error:contents"].concat(jQuery.makeArray(arguments)))}),this.on("change:id",function(a,b){this.contents&&(this.contents.historyId=b)},this)},errorHandler:function(){this.clearUpdateTimeout()},nice_size:function(){return b.bytesToString(this.get("size"),!0,2)},toJSON:function(){return _.extend(Backbone.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(a){return"nice_size"===a?this.nice_size():Backbone.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return Galaxy&&Galaxy.currUser?Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")?!1:!0:!1},contentsCount:function(){return _.reduce(_.values(this.get("state_details")),function(a,b){return a+b},0)},searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},checkForUpdates:function(a){return this.contents.running().length?this.setUpdateTimeout():(this.trigger("ready"),_.isFunction(a)&&a.call(this)),this},setUpdateTimeout:function(a){a=a||d.UPDATE_DELAY;var b=this;return this.clearUpdateTimeout(),this.updateTimeoutId=setTimeout(function(){b.refresh()},a),this.updateTimeoutId},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},refresh:function(a,b){a=a||[],b=b||{};var c=this;b.data=b.data||{},a.length&&(b.data.details=a.join(","));var d=this.contents.fetch(b);return d.done(function(){c.checkForUpdates(function(){this.fetch()})}),d},_delete:function(a){return this.get("deleted")?jQuery.when():this.save({deleted:!0},a)},purge:function(a){return this.get("purged")?jQuery.when():this.save({deleted:!0,purged:!0},a)},undelete:function(a){return this.get("deleted")?this.save({deleted:!1},a):jQuery.when()},copy:function(a,b){if(a=void 0!==a?a:!0,!this.id)throw new Error("You must set the history ID before copying it.");var c={history_id:this.id};a&&(c.current=!0),b&&(c.name=b);var e=this,f=jQuery.post(this.urlRoot,c);return a?f.then(function(a){var b=new d(a);return b.setAsCurrent().done(function(){e.trigger("copied",e,a)})}):f.done(function(a){e.trigger("copied",e,a)})},setAsCurrent:function(){var a=this,b=jQuery.getJSON(galaxy_config.root+"history/set_as_current?id="+this.id);return b.done(function(){a.trigger("set-as-current",a)}),b},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}}));d.UPDATE_DELAY=4e3,d.getHistoryData=function(a,b){function c(){return"current"===a?jQuery.getJSON(galaxy_config.root+"history/current_history_json"):jQuery.ajax(galaxy_config.root+"api/histories/"+a)}function d(a){return a&&a.empty}function e(a){if(d(a))return[];_.isFunction(f)&&(f=f(a)),_.isFunction(g)&&(g=g(a));var b={};return f.length&&(b.dataset_details=f.join(",")),g.length&&(b.dataset_collection_details=g.join(",")),jQuery.ajax(galaxy_config.root+"api/histories/"+a.id+"/contents",{data:b})}b=b||{};var f=b.detailIdsFn||[],g=b.hdcaDetailIds||[],h=jQuery.Deferred(),i=null,j=b.historyFn||c,k=b.contentsFn||e,l=j(a);l.done(function(a){i=a,h.notify({status:"history data retrieved",historyJSON:i})}),l.fail(function(a){h.reject(a,"loading the history")});var m=l.then(k);return m.then(function(a){h.notify({status:"contents data retrieved",historyJSON:i,contentsJSON:a}),h.resolve(i,a)}),m.fail(function(a){h.reject(a,"loading the contents",{history:i})}),h};var e=Backbone.Collection.extend(c.LoggableMixin).extend({model:d,urlRoot:(window.galaxy_config?galaxy_config.root:"/")+"api/histories",initialize:function(a,b){b=b||{},this.log("HistoryCollection.initialize",arguments),this.includeDeleted=b.includeDeleted||!1,this.setUpListeners()},setUpListeners:function(){var a=this;this.on("change:deleted",function(b){this.debug("change:deleted",a.includeDeleted,b.get("deleted")),!a.includeDeleted&&b.get("deleted")&&a.remove(b)}),this.on("copied",function(a,b){this.unshift(new d(b,[]))})},create:function(a,b,c){var e=this,f=jQuery.getJSON(galaxy_config.root+"history/create_new_current");return f.done(function(a){var b=new d(a,[],c||{});e.unshift(b),e.trigger("new-current")})},toString:function(){return"HistoryCollection("+this.length+")"}});return{History:d,HistoryCollection:e}});
//# sourceMappingURL=../../../maps/mvc/history/history-model.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-table","mvc/ui/ui-list"],function(a,b,c,d){var e=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries"}),f=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),g=Backbone.View.extend({initialize:function(a){var c=this;this.libraries=new e,this.datasets=new f,this.options=a,this.library_select=new b.Select.View({onchange:function(a){c.datasets.config.set("library_id",a)}}),this.dataset_list=new d.View({name:"dataset",optional:a.optional,multiple:a.multiple,onchange:function(){c.trigger("change")}}),this.libraries.on("reset",function(){var a=[];c.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),c.library_select.update(a)}),this.datasets.on("reset",function(){var a=[],b=c.library_select.text();null!==b&&c.datasets.each(function(b){"file"===b.get("type")&&a.push({value:b.id,label:b.get("name")})}),c.dataset_list.update(a)}),this.on("change",function(){a.onchange&&a.onchange(c.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(){c.library_select.trigger("change"),void 0!==c.options.value&&c.value(c.options.value)}})},value:function(a){return this.dataset_list.value(a)},_template:function(){return'<div class="ui-select-library"><div class="library ui-margin-bottom"><span class="library-title">Select Library</span><span class="library-select"/></div></div>'}});return{View:g}});
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-table","mvc/ui/ui-list"],function(a,b,c,d){var e=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries?deleted=false"}),f=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),g=Backbone.View.extend({initialize:function(a){var c=this;this.libraries=new e,this.datasets=new f,this.options=a,this.library_select=new b.Select.View({onchange:function(a){c.datasets.config.set("library_id",a)}}),this.dataset_list=new d.View({name:"dataset",optional:a.optional,multiple:a.multiple,onchange:function(){c.trigger("change")}}),this.libraries.on("reset",function(){var a=[];c.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),c.library_select.update(a)}),this.datasets.on("reset",function(){var a=[],b=c.library_select.text();null!==b&&c.datasets.each(function(b){"file"===b.get("type")&&a.push({value:b.id,label:b.get("name")})}),c.dataset_list.update(a)}),this.on("change",function(){a.onchange&&a.onchange(c.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(){c.library_select.trigger("change"),void 0!==c.options.value&&c.value(c.options.value)}})},value:function(a){return this.dataset_list.value(a)},_template:function(){return'<div class="ui-select-library"><div class="library ui-margin-bottom"><span class="library-title">Select Library</span><span class="library-select"/></div></div>'}});return{View:g}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-select-library.js.map
@@ -0,0 +1,2 @@
define([],function(){function a(a,b){b=b||window.location.search.substr(1);var c=new RegExp(a+"=([^&#$]+)"),d=b.match(c);return d&&d.length?(d=d.splice(1),1===d.length?d[0]:d):void 0}return{get:a}});
//# sourceMappingURL=../../maps/utils/query-string-parsing.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function d(a){return $("<div/>").text(a).html()}function e(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function f(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function g(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):h({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function h(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function i(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function j(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function k(b,c){return b?a.defaults(b,c):c}function l(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"<strong>-</strong>";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:"<strong>"+d+"</strong> "+c}function m(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function n(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:j,cssGetAttribute:i,get:g,merge:k,bytesToString:l,uid:m,time:n,request:h,sanitize:d,textify:f,validate:e,deepeach:b,isJSON:c}});
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function d(a){return $("<div/>").text(a).html()}function e(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function f(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function g(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):h({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function h(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function i(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function j(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function k(b,c){return b?a.defaults(b,c):c}function l(a,b){for(var c=1,d=0;b>d;d++)c*=10;return Math.round(a*c)/c}function m(a,b,c){c=void 0!==c?c:1;var d="";if(a>=s)a/=s,d="TB";else if(a>=r)a/=r,d="GB";else if(a>=q)a/=q,d="MB";else if(a>=p)a/=p,d="KB";else{if(!(a>0))return b?"0 b":"<strong>-</strong>";d="b"}var e="b"==d?a:l(a,c);return b?e+" "+d:"<strong>"+e+"</strong> "+d}function n(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function o(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}var p=1024,q=p*p,r=q*p,s=r*p;return{cssLoadFile:j,cssGetAttribute:i,get:g,merge:k,bytesToString:m,uid:n,time:o,request:h,sanitize:d,textify:f,validate:e,deepeach:b,isJSON:c}});
//# sourceMappingURL=../../maps/utils/utils.js.map
File diff suppressed because one or more lines are too long