mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Utils conversion, minus _l
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define([],function(){var e=["log","debug","info","warn","error","metric"];return function(o,t){var i=void 0!==o.prototype?o.prototype:o;return void 0!==t&&(i._logNamespace=t),e.forEach(function(e){i[e]=function(){if(this.logger)return this.logger.emit?this.logger.emit(e,this._logNamespace,arguments):this.logger[e]?this.logger[e].apply(this.logger,arguments):void 0}}),o}})});
|
||||
define(["exports"],function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=["log","debug","info","warn","error","metric"];e.default=function(e,t){var r=void 0!==e.prototype?e.prototype:e;return void 0!==t&&(r._logNamespace=t),o.forEach(function(e){r[e]=function(){if(this.logger)return this.logger.emit?this.logger.emit(e,this._logNamespace,arguments):this.logger[e]?this.logger[e].apply(this.logger,arguments):void 0}}),e}});
|
||||
//# sourceMappingURL=../../maps/utils/add-logging.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define([],function(){function e(e){var t=this;return t.deferred=jQuery.Deferred(),t.queue=[],t.responses=[],t.numToProcess=0,t.running=!1,t.init(e||[]),t.start(),t}function t(t){var r=this;return r.names={},e.call(this,t),r}return e.prototype.init=function(e){var t=this;e.forEach(function(e){t.add(e)})},e.prototype.add=function(e){var t=this,r=this.queue.length;return this.numToProcess+=1,this.queue.push(function(){var n=r,o=e();o.done(function(e){t.deferred.notify({curr:n,total:t.numToProcess,response:e})}),o.always(function(e){t.responses.push(e),t.queue.length?t.queue.shift()():t.stop()})}),this},e.prototype.start=function(){return this.queue.length&&(this.running=!0,this.queue.shift()()),this},e.prototype.stop=function(e,t){return this.running=!1,this.queue=[],e?this.deferred.reject(t):this.deferred.resolve(this.responses),this.numToProcess=0,this.deferred=jQuery.Deferred(),this},e.prototype.done=function(e){return this.deferred.done(e)},e.prototype.fail=function(e){return this.deferred.fail(e)},e.prototype.always=function(e){return this.deferred.always(e)},e.prototype.progress=function(e){return this.deferred.progress(e)},e.create=function(t){return new e(t).deferred},t.prototype=new e,t.prototype.constructor=t,t.prototype.add=function(t){if(!t.hasOwnProperty("name")||!t.hasOwnProperty("fn"))throw new Error('NamedAjaxQueue.add requires an object with both "name" and "fn": '+JSON.stringify(t));if(!this.names.hasOwnProperty(t.name))return this.names[t.name]=!0,e.prototype.add.call(this,t.fn)},t.prototype.clear=function(){return this.names={},this},t.create=function(e){return new t(e).deferred},{AjaxQueue:e,NamedAjaxQueue:t}})});
|
||||
define(["exports"],function(e){"use strict";function t(e){var t=this;return t.deferred=jQuery.Deferred(),t.queue=[],t.responses=[],t.numToProcess=0,t.running=!1,t.init(e||[]),t.start(),t}function r(e){var r=this;return r.names={},t.call(this,e),r}Object.defineProperty(e,"__esModule",{value:!0}),t.prototype.init=function(e){var t=this;e.forEach(function(e){t.add(e)})},t.prototype.add=function(e){var t=this,r=this.queue.length;return this.numToProcess+=1,this.queue.push(function(){var n=r,s=e();s.done(function(e){t.deferred.notify({curr:n,total:t.numToProcess,response:e})}),s.always(function(e){t.responses.push(e),t.queue.length?t.queue.shift()():t.stop()})}),this},t.prototype.start=function(){return this.queue.length&&(this.running=!0,this.queue.shift()()),this},t.prototype.stop=function(e,t){return this.running=!1,this.queue=[],e?this.deferred.reject(t):this.deferred.resolve(this.responses),this.numToProcess=0,this.deferred=jQuery.Deferred(),this},t.prototype.done=function(e){return this.deferred.done(e)},t.prototype.fail=function(e){return this.deferred.fail(e)},t.prototype.always=function(e){return this.deferred.always(e)},t.prototype.progress=function(e){return this.deferred.progress(e)},t.create=function(e){return new t(e).deferred},(r.prototype=new t).constructor=r,r.prototype.add=function(e){if(!e.hasOwnProperty("name")||!e.hasOwnProperty("fn"))throw new Error('NamedAjaxQueue.add requires an object with both "name" and "fn": '+JSON.stringify(e));if(!this.names.hasOwnProperty(e.name))return this.names[e.name]=!0,t.prototype.add.call(this,e.fn)},r.prototype.clear=function(){return this.names={},this},r.create=function(e){return new r(e).deferred},e.default={AjaxQueue:t,NamedAjaxQueue:r}});
|
||||
//# sourceMappingURL=../../maps/utils/ajax-queue.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define(["jquery"],function(t){"use_strict";var e=t;return function(t,i,r,n,a,u,o,c,s){void 0===a&&(a=30),void 0===o&&(o=4),e("#"+t).click(function(){if(!(e("#renaming-active").length>0)){var t,f=e("#"+i),l=f.text();(t=u?e("<textarea></textarea>").attr({rows:o,cols:a}).text(e.trim(l)):e("<input type='text'></input>").attr({value:e.trim(l),size:a})).attr("id","renaming-active"),t.blur(function(){e(this).remove(),f.show(),s&&s(t)}),t.keyup(function(a){if(27===a.keyCode)e(this).trigger("blur");else if(13===a.keyCode){var u={};u[n]=e(this).val(),e(this).trigger("blur"),e.ajax({url:r,data:u,error:function(){alert("Text editing for elt "+i+" failed")},success:function(e){""!==e?f.text(e):f.html("<em>None</em>"),s&&s(t)}})}}),c&&c(t),f.hide(),t.insertAfter(f),t.focus(),t.select()}})}})});
|
||||
define(["exports","jquery"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(t).default;e.default=function(e,t,r,n,u,a,o,l,f){void 0===u&&(u=30),void 0===o&&(o=4),i("#"+e).click(function(){if(!(i("#renaming-active").length>0)){var e,s=i("#"+t),c=s.text();(e=a?i("<textarea></textarea>").attr({rows:o,cols:u}).text(i.trim(c)):i("<input type='text'></input>").attr({value:i.trim(c),size:u})).attr("id","renaming-active"),e.blur(function(){i(this).remove(),s.show(),f&&f(e)}),e.keyup(function(u){if(27===u.keyCode)i(this).trigger("blur");else if(13===u.keyCode){var a={};a[n]=i(this).val(),i(this).trigger("blur"),i.ajax({url:r,data:a,error:function(){alert("Text editing for elt "+t+" failed")},success:function(t){""!==t?s.text(t):s.html("<em>None</em>"),f&&f(e)}})}}),l&&l(e),s.hide(),e.insertAfter(s),e.focus(),e.select()}})}});
|
||||
//# sourceMappingURL=../../maps/utils/async-save-text.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define(["libs/underscore","viz/trackster/util","utils/config"],function(e,t,l){var o=Backbone.Model.extend({initialize:function(l){var o=this.get("key");this.set("id",o);var i=e.find([{key:"name",label:"Name",type:"text",default_value:""},{key:"color",label:"Color",type:"color",default_value:null},{key:"min_value",label:"Min Value",type:"float",default_value:null},{key:"max_value",label:"Max Value",type:"float",default_value:null},{key:"mode",type:"string",default_value:this.mode,hidden:!0},{key:"height",type:"int",default_value:32,hidden:!0},{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"block_color",label:"Block color",type:"color",default_value:null},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:!1},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:!0},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:null},{key:"show_differences",label:"Show differences only",type:"bool",default_value:!0}],function(e){return e.key===o});i&&this.set(e.extend({},i,l)),void 0===this.get("value")&&void 0!==this.get("default_value")&&(this.set_value(this.get("default_value")),this.get("value")||"color"!==this.get("type")||this.set("value",t.get_random_color()))},set_value:function(e,t){var l=this.get("type");"float"===l?e=parseFloat(e):"int"===l&&(e=parseInt(e,10)),this.set({value:e},t)}}),i=Backbone.Collection.extend({model:o,to_key_value_dict:function(){var e={};return this.each(function(t){e[t.get("key")]=t.get("value")}),e},get_value:function(e){var t=this.get(e);if(t)return t.get("value")},set_value:function(e,t,l){var o=this.get(e);if(o)return o.set_value(t,l)},set_default_value:function(e,t){var l=this.get(e);if(l)return l.set("default_value",t)}},{from_models_and_saved_values:function(t,l){return l&&(t=e.map(t,function(t){return e.extend({},t,{value:l[t.key]})})),new i(t)}}),a=Backbone.View.extend({className:"config-settings-view",render:function(){var l=this.$el;return this.collection.each(function(o,i){if(!o.get("hidden")){var a="param_"+i,n=o.get("type"),r=o.get("value"),s=$("<div class='form-row' />").appendTo(l);if(s.append($("<label />").attr("for",a).text(o.get("label")+":")),"bool"===n)s.append($('<input type="checkbox" />').attr("id",a).attr("name",a).attr("checked",r));else if("text"===n)s.append($('<input type="text"/>').attr("id",a).val(r).click(function(){$(this).select()}));else if("select"===n){var c=$("<select />").attr("id",a);e.each(o.get("options"),function(e){$("<option/>").text(e.label).attr("value",e.value).appendTo(c)}),c.val(r),s.append(c)}else if("color"===n){var u=$("<div/>").appendTo(s),d=$("<input />").attr("id",a).attr("name",a).val(r).css("float","left").appendTo(u).click(function(e){$(".tooltip").removeClass("in");var t=$(this).siblings(".tooltip").addClass("in");t.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-$(t).height()/2+$(this).height()/2}).show(),t.click(function(e){e.stopPropagation()}),$(document).bind("click.color-picker",function(){t.hide(),$(document).unbind("click.color-picker")}),e.stopPropagation()}),p=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(u).attr("title","Set new random color").tooltip(),f=$("<div class='tooltip right' style='position: absolute;' />").appendTo(u).hide(),h=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(f),v=($("<div class='tooltip-arrow'></div>").appendTo(f),$.farbtastic(h,{width:100,height:100,callback:d,color:r}));u.append($("<div/>").css("clear","both")),function(e){p.click(function(){e.setColor(t.get_random_color())})}(v)}else s.append($("<input />").attr("id",a).attr("name",a).val(r));o.help&&s.append($("<div class='help'/>").text(o.help))}}),this},render_in_modal:function(e){var t=this,l=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc")},o=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc"),t.update_from_form()};$(window).bind("keypress.check_enter_esc",function(e){27===(e.keyCode||e.which)?l():13===(e.keyCode||e.which)&&o()}),0===this.$el.children().length&&this.render(),Galaxy.modal.show({title:e||"Configure",body:this.$el,buttons:{Cancel:l,OK:o}})},update_from_form:function(){var e=this;this.collection.each(function(t,l){if(!t.get("hidden")){var o="param_"+l,i=e.$el.find("#"+o).val();"bool"===t.get("type")&&(i=e.$el.find("#"+o).is(":checked")),t.set_value(i)}})}});return{ConfigSetting:o,ConfigSettingCollection:i,ConfigSettingCollectionView:a}})});
|
||||
define(["exports","libs/underscore","viz/trackster/util","utils/config"],function(e,t,l,o){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var i=a(t),n=a(l),r=(a(o),Backbone.Model.extend({initialize:function(e){var t=this.get("key");this.set("id",t);var l=i.default.find([{key:"name",label:"Name",type:"text",default_value:""},{key:"color",label:"Color",type:"color",default_value:null},{key:"min_value",label:"Min Value",type:"float",default_value:null},{key:"max_value",label:"Max Value",type:"float",default_value:null},{key:"mode",type:"string",default_value:this.mode,hidden:!0},{key:"height",type:"int",default_value:32,hidden:!0},{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"block_color",label:"Block color",type:"color",default_value:null},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:!1},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:!0},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:null},{key:"show_differences",label:"Show differences only",type:"bool",default_value:!0}],function(e){return e.key===t});l&&this.set(i.default.extend({},l,e)),void 0===this.get("value")&&void 0!==this.get("default_value")&&(this.set_value(this.get("default_value")),this.get("value")||"color"!==this.get("type")||this.set("value",n.default.get_random_color()))},set_value:function(e,t){var l=this.get("type");"float"===l?e=parseFloat(e):"int"===l&&(e=parseInt(e,10)),this.set({value:e},t)}})),s=Backbone.Collection.extend({model:r,to_key_value_dict:function(){var e={};return this.each(function(t){e[t.get("key")]=t.get("value")}),e},get_value:function(e){var t=this.get(e);if(t)return t.get("value")},set_value:function(e,t,l){var o=this.get(e);if(o)return o.set_value(t,l)},set_default_value:function(e,t){var l=this.get(e);if(l)return l.set("default_value",t)}},{from_models_and_saved_values:function(e,t){return t&&(e=i.default.map(e,function(e){return i.default.extend({},e,{value:t[e.key]})})),new s(e)}}),c=Backbone.View.extend({className:"config-settings-view",render:function(){var e=this.$el;return this.collection.each(function(t,l){if(!t.get("hidden")){var o="param_"+l,a=t.get("type"),r=t.get("value"),s=$("<div class='form-row' />").appendTo(e);if(s.append($("<label />").attr("for",o).text(t.get("label")+":")),"bool"===a)s.append($('<input type="checkbox" />').attr("id",o).attr("name",o).attr("checked",r));else if("text"===a)s.append($('<input type="text"/>').attr("id",o).val(r).click(function(){$(this).select()}));else if("select"===a){var c=$("<select />").attr("id",o);i.default.each(t.get("options"),function(e){$("<option/>").text(e.label).attr("value",e.value).appendTo(c)}),c.val(r),s.append(c)}else if("color"===a){var u=$("<div/>").appendTo(s),d=$("<input />").attr("id",o).attr("name",o).val(r).css("float","left").appendTo(u).click(function(e){$(".tooltip").removeClass("in");var t=$(this).siblings(".tooltip").addClass("in");t.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-$(t).height()/2+$(this).height()/2}).show(),t.click(function(e){e.stopPropagation()}),$(document).bind("click.color-picker",function(){t.hide(),$(document).unbind("click.color-picker")}),e.stopPropagation()}),f=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(u).attr("title","Set new random color").tooltip(),p=$("<div class='tooltip right' style='position: absolute;' />").appendTo(u).hide(),h=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(p),v=($("<div class='tooltip-arrow'></div>").appendTo(p),$.farbtastic(h,{width:100,height:100,callback:d,color:r}));u.append($("<div/>").css("clear","both")),function(e){f.click(function(){e.setColor(n.default.get_random_color())})}(v)}else s.append($("<input />").attr("id",o).attr("name",o).val(r));t.help&&s.append($("<div class='help'/>").text(t.help))}}),this},render_in_modal:function(e){var t=this,l=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc")},o=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc"),t.update_from_form()};$(window).bind("keypress.check_enter_esc",function(e){27===(e.keyCode||e.which)?l():13===(e.keyCode||e.which)&&o()}),0===this.$el.children().length&&this.render(),Galaxy.modal.show({title:e||"Configure",body:this.$el,buttons:{Cancel:l,OK:o}})},update_from_form:function(){var e=this;this.collection.each(function(t,l){if(!t.get("hidden")){var o="param_"+l,a=e.$el.find("#"+o).val();"bool"===t.get("type")&&(a=e.$el.find("#"+o).is(":checked")),t.set_value(a)}})}});e.default={ConfigSetting:r,ConfigSettingCollection:s,ConfigSettingCollectionView:c}});
|
||||
//# sourceMappingURL=../../maps/utils/config.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define(["utils/utils"],function(e){return Backbone.Model.extend({initialize:function(){this.active={},this.last=null},execute:function(t){var i=this,a=e.uid(),n=t.length>0;this.active[a]=!0;var s=$.Deferred();s.promise().always(function(){delete i.active[a],n&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+a)}),$.when(this.last).always(function(){i.active[a]?(n&&Galaxy.emit.debug("deferred::execute()","Running "+a),t(s),!n&&s.resolve()):s.reject()}),this.last=s.promise()},reset:function(){Galaxy.emit.debug("deferred::execute()","Reset");for(var e in this.active)this.active[e]=!1},ready:function(){return $.isEmptyObject(this.active)}})})});
|
||||
define(["exports","utils/utils"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(t);e.default=Backbone.Model.extend({initialize:function(){this.active={},this.last=null},execute:function(e){var t=this,a=i.default.uid(),s=e.length>0;this.active[a]=!0;var n=$.Deferred();n.promise().always(function(){delete t.active[a],s&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+a)}),$.when(this.last).always(function(){t.active[a]?(s&&Galaxy.emit.debug("deferred::execute()","Running "+a),e(n),!s&&n.resolve()):n.reject()}),this.last=n.promise()},reset:function(){Galaxy.emit.debug("deferred::execute()","Reset");for(var e in this.active)this.active[e]=!1},ready:function(){return $.isEmptyObject(this.active)}})});
|
||||
//# sourceMappingURL=../../maps/utils/deferred.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define([],function(){return function(n,t){if(0===n.length)return t.length;if(0===t.length)return n.length;var e,r=[];for(e=0;e<=t.length;e++)r[e]=[e];var h;for(h=0;h<=n.length;h++)r[0][h]=h;for(e=1;e<=t.length;e++)for(h=1;h<=n.length;h++)t.charAt(e-1)===n.charAt(h-1)?r[e][h]=r[e-1][h-1]:r[e][h]=Math.min(r[e-1][h-1]+1,Math.min(r[e][h-1]+1,r[e-1][h]+1));return r[t.length][n.length]}})});
|
||||
define(["exports"],function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var n,r=[];for(n=0;n<=t.length;n++)r[n]=[n];var h;for(h=0;h<=e.length;h++)r[0][h]=h;for(n=1;n<=t.length;n++)for(h=1;h<=e.length;h++)t.charAt(n-1)===e.charAt(h-1)?r[n][h]=r[n-1][h-1]:r[n][h]=Math.min(r[n-1][h-1]+1,Math.min(r[n][h-1]+1,r[n-1][h]+1));return r[t.length][e.length]}});
|
||||
//# sourceMappingURL=../../maps/utils/levenshtein.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define([],function(){return function(e,t){var r=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",i=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(r,a+"$1"+a).split(a),f=i.replace(r,a+"$1"+a).split(a),u=new Date(n).getTime(),l=u?new Date(i).getTime():null;if(l){if(u<l)return-1;if(u>l)return 1}for(var g,s,c=0,p=Math.max(o.length,f.length);c<p;c++){if(g=parseFloat(o[c])||o[c],s=parseFloat(f[c])||f[c],g<s)return-1;if(g>s)return 1}return 0}})});
|
||||
define(["exports"],function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){var r=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",a=t.toString().toLowerCase()||"",i=String.fromCharCode(0),o=n.replace(r,i+"$1"+i).split(i),l=a.replace(r,i+"$1"+i).split(i),f=new Date(n).getTime(),u=f?new Date(a).getTime():null;if(u){if(f<u)return-1;if(f>u)return 1}for(var s,g,p=0,c=Math.max(o.length,l.length);p<c;p++){if(s=parseFloat(o[p])||o[p],g=parseFloat(l[p])||l[p],s<g)return-1;if(s>g)return 1}return 0}});
|
||||
//# sourceMappingURL=../../maps/utils/natural-sort.js.map
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define([],function(){return{get:function(n,e){e=e||window.location.search.substr(1);var t=new RegExp(n+"=([^&#$]+)","g"),r=e.match(t);if(r&&r.length)return 1===(r=_.map(r,function(e){return decodeURIComponent(e.substr(n.length+1).replace(/\+/g," "))})).length?r[0]:r},parse:function(n){if(!n)return{};var e={};return n.split("&").forEach(function(n){var t=n.split("=");e[t[0]]=decodeURI(t[1])}),e}}})});
|
||||
define(["exports"],function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={get:function(e,t){t=t||window.location.search.substr(1);var n=new RegExp(e+"=([^&#$]+)","g"),r=t.match(n);if(r&&r.length)return 1===(r=_.map(r,function(t){return decodeURIComponent(t.substr(e.length+1).replace(/\+/g," "))})).length?r[0]:r},parse:function(e){if(!e)return{};var t={};return e.split("&").forEach(function(e){var n=e.split("=");t[n[0]]=decodeURI(n[1])}),t}}});
|
||||
//# sourceMappingURL=../../maps/utils/query-string-parsing.js.map
|
||||
|
||||
Executable → Regular
@@ -1,2 +1,2 @@
|
||||
define([],function(){"use strict";define(["utils/localization"],function(t){function e(t,n){for(var r in t){var i=t[r];if(_.isObject(i)){var a=n(i);a&&(t[r]=a),e(i,n)}}}function n(t){var e={contentType:"application/json",type:t.type||"GET",data:t.data||{},url:t.url};"GET"==e.type||"DELETE"==e.type?($.isEmptyObject(e.data)||(e.url+=-1==e.url.indexOf("?")?"?":"&",e.url+=$.param(e.data,!0)),e.data=null):(e.dataType="json",e.url=e.url,e.data=JSON.stringify(e.data)),$.ajax(e).done(function(e){if("string"==typeof e)try{e=e.replace("Infinity,",'"Infinity",'),e=jQuery.parseJSON(e)}catch(t){console.debug(t)}t.success&&t.success(e)}).fail(function(e){var n=null;try{n=jQuery.parseJSON(e.responseText)}catch(t){n=e.responseText}t.error&&t.error(n,e.status)}).always(function(){t.complete&&t.complete()})}function r(t,e){for(var n=1,r=0;r<e;r++)n*=10;return Math.round(t*n)/n}var i=1024,a=i*i,s=a*i,o=s*i;return{cssLoadFile:function(t){$('link[href^="'+t+'"]').length||$('<link href="'+Galaxy.root+t+'" rel="stylesheet">').appendTo("head")},cssGetAttribute:function(t,e){var n=$('<div class="'+t+'"></div>');n.appendTo(":eq(0)");var r=n.css(e);return n.remove(),r},get:function(t){top.__utils__get__=top.__utils__get__||{};var e=JSON.stringify(t);t.cache&&top.__utils__get__[e]?(t.success&&t.success(top.__utils__get__[e]),window.console.debug("utils.js::get() - Fetching from cache ["+t.url+"].")):n({url:t.url,data:t.data,success:function(n){top.__utils__get__[e]=n,t.success&&t.success(n)},error:function(e,n){t.error&&t.error(e,n)}})},merge:function(t,e){return t?_.defaults(t,e):e},iframe:function(t){return'<iframe src="'+t+'" frameborder="0" style="width: 100%; height: 100%;"/>'},bytesToString:function(t,e,n){n=void 0!==n?n:1;var u="";if(t>=o)t/=o,u="TB";else if(t>=s)t/=s,u="GB";else if(t>=a)t/=a,u="MB";else if(t>=i)t/=i,u="KB";else{if(!(t>0))return e?"0 b":"<strong>-</strong>";u="b"}var c="b"==u?t:r(t,n);return e?c+" "+u:"<strong>"+c+"</strong> "+u},uid:function(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++},time:function(){var t=new Date,e=(t.getHours()<10?"0":"")+t.getHours(),n=(t.getMinutes()<10?"0":"")+t.getMinutes();return datetime=t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear()+", "+e+":"+n},request:n,sanitize:function(t){return $("<div/>").text(t).html()},textify:function(t){if($.isArray(t)){var e=(t=t.toString().replace(/,/g,", ")).lastIndexOf(", ");return-1!=e&&(t=t.substr(0,e)+" or "+t.substr(e+2)),t}return""},isEmpty:function(t){if(t instanceof Array||(t=[t]),0===t.length)return!0;for(var e in t)if(["__null__","__undefined__",null,void 0].indexOf(t[e])>-1)return!0;return!1},deepeach:e,isJSON:function(t){return/^[\],:{}\s]*$/.test(t.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))},clone:function(t){return JSON.parse(JSON.stringify(t)||null)},linkify:function(t){var e,n,r,i;return n=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,e=t.replace(n,'<a href="$1" target="_blank">$1</a>'),r=/(^|[^\/])(www\.[\S]+(\b|$))/gim,e=e.replace(r,'$1<a href="http://$2" target="_blank">$2</a>'),i=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim,e=e.replace(i,'<a href="mailto:$1">$1</a>')},appendScriptStyle:function(t){t.script&&""!==t.script&&$("<script/>",{type:"text/javascript"}).text(t.script).appendTo("head"),t.styles&&""!==t.styles&&$("<style/>",{type:"text/css"}).text(t.styles).appendTo("head")},getQueryString:function(t){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(t).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))},setWindowTitle:function(e){window.document.title=e?"Galaxy "+(window.Galaxy.config.brand?" | "+window.Galaxy.config.brand:"")+" | "+t(e):"Galaxy "+(window.Galaxy.config.brand?" | "+window.Galaxy.config.brand:"")}}})});
|
||||
define(["exports","utils/localization"],function(e,t){"use strict";function r(e,t){for(var n in e){var i=e[n];if(_.isObject(i)){var a=t(i);a&&(e[n]=a),r(i,t)}}}function n(e){var t={contentType:"application/json",type:e.type||"GET",data:e.data||{},url:e.url};"GET"==t.type||"DELETE"==t.type?($.isEmptyObject(t.data)||(t.url+=-1==t.url.indexOf("?")?"?":"&",t.url+=$.param(t.data,!0)),t.data=null):(t.dataType="json",t.url=t.url,t.data=JSON.stringify(t.data)),$.ajax(t).done(function(t){if("string"==typeof t)try{t=t.replace("Infinity,",'"Infinity",'),t=jQuery.parseJSON(t)}catch(e){console.debug(e)}e.success&&e.success(t)}).fail(function(t){var r=null;try{r=jQuery.parseJSON(t.responseText)}catch(e){r=t.responseText}e.error&&e.error(r,t.status)}).always(function(){e.complete&&e.complete()})}function i(e,t){for(var r=1,n=0;n<t;n++)r*=10;return Math.round(e*r)/r}Object.defineProperty(e,"__esModule",{value:!0});var a=function(e){return e&&e.__esModule?e:{default:e}}(t),s=1024,u=s*s,o=u*s,l=o*s;e.default={cssLoadFile:function(e){$('link[href^="'+e+'"]').length||$('<link href="'+Galaxy.root+e+'" rel="stylesheet">').appendTo("head")},cssGetAttribute:function(e,t){var r=$('<div class="'+e+'"></div>');r.appendTo(":eq(0)");var n=r.css(t);return r.remove(),n},get:function(e){top.__utils__get__=top.__utils__get__||{};var t=JSON.stringify(e);e.cache&&top.__utils__get__[t]?(e.success&&e.success(top.__utils__get__[t]),window.console.debug("utils.js::get() - Fetching from cache ["+e.url+"].")):n({url:e.url,data:e.data,success:function(r){top.__utils__get__[t]=r,e.success&&e.success(r)},error:function(t,r){e.error&&e.error(t,r)}})},merge:function(e,t){return e?_.defaults(e,t):t},iframe:function(e){return'<iframe src="'+e+'" frameborder="0" style="width: 100%; height: 100%;"/>'},bytesToString:function(e,t,r){r=void 0!==r?r:1;var n="";if(e>=l)e/=l,n="TB";else if(e>=o)e/=o,n="GB";else if(e>=u)e/=u,n="MB";else if(e>=s)e/=s,n="KB";else{if(!(e>0))return t?"0 b":"<strong>-</strong>";n="b"}var a="b"==n?e:i(e,r);return t?a+" "+n:"<strong>"+a+"</strong> "+n},uid:function(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++},time:function(){var e=new Date,t=(e.getHours()<10?"0":"")+e.getHours(),r=(e.getMinutes()<10?"0":"")+e.getMinutes();return datetime=e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+", "+t+":"+r},request:n,sanitize:function(e){return $("<div/>").text(e).html()},textify:function(e){if($.isArray(e)){var t=(e=e.toString().replace(/,/g,", ")).lastIndexOf(", ");return-1!=t&&(e=e.substr(0,t)+" or "+e.substr(t+2)),e}return""},isEmpty:function(e){if(e instanceof Array||(e=[e]),0===e.length)return!0;for(var t in e)if(["__null__","__undefined__",null,void 0].indexOf(e[t])>-1)return!0;return!1},deepeach:r,isJSON:function(e){return/^[\],:{}\s]*$/.test(e.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))},clone:function(e){return JSON.parse(JSON.stringify(e)||null)},linkify:function(e){var t,r,n,i;return r=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,t=e.replace(r,'<a href="$1" target="_blank">$1</a>'),n=/(^|[^\/])(www\.[\S]+(\b|$))/gim,t=t.replace(n,'$1<a href="http://$2" target="_blank">$2</a>'),i=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim,t=t.replace(i,'<a href="mailto:$1">$1</a>')},appendScriptStyle:function(e){e.script&&""!==e.script&&$("<script/>",{type:"text/javascript"}).text(e.script).appendTo("head"),e.styles&&""!==e.styles&&$("<style/>",{type:"text/css"}).text(e.styles).appendTo("head")},getQueryString:function(e){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(e).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))},setWindowTitle:function(e){window.document.title=e?"Galaxy "+(window.Galaxy.config.brand?" | "+window.Galaxy.config.brand:"")+" | "+(0,a.default)(e):"Galaxy "+(window.Galaxy.config.brand?" | "+window.Galaxy.config.brand:"")}}});
|
||||
//# sourceMappingURL=../../maps/utils/utils.js.map
|
||||
|
||||
Reference in New Issue
Block a user