Minimal gulp task to run uglify, babel, sourcemaps. The new 'clean'

approach also removed some cruft we had sitting in the static/scripts
folder and were unintentionally shipping.
This commit is contained in:
Dannon Baker
2017-04-06 09:34:42 -04:00
parent cbb119c718
commit aae2cd352f
428 changed files with 668 additions and 665 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a,c){var d=void 0!==a.prototype?a.prototype:a;return void 0!==c&&(d._logNamespace=c),b.forEach(function(a){d[a]=function(){return this.logger?this.logger.emit?this.logger.emit(a,this._logNamespace,arguments):this.logger[a]?this.logger[a].apply(this.logger,arguments):void 0:void 0}}),a}var b=["log","debug","info","warn","error","metric"];return a});
//# sourceMappingURL=../../maps/utils/add-logging.js.map
define([],function(){function o(o,r){var t=void 0!==o.prototype?o.prototype:o;return void 0!==r&&(t._logNamespace=r),e.forEach(function(o){t[o]=function(){if(this.logger)return this.logger.emit?this.logger.emit(o,this._logNamespace,arguments):this.logger[o]?this.logger[o].apply(this.logger,arguments):void 0}}),o}var e=["log","debug","info","warn","error","metric"];return o});
//# sourceMappingURL=../../maps/utils/add-logging.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a){var b=this;return b.deferred=jQuery.Deferred(),b.queue=[],b.responses=[],b.numToProcess=0,b.running=!1,b.init(a||[]),b.start(),b}function b(b){var c=this;return c.names={},a.call(this,b),c}return a.prototype.init=function(a){var b=this;a.forEach(function(a){b.add(a)})},a.prototype.add=function(a){var b=this,c=this.queue.length;return this.numToProcess+=1,this.queue.push(function(){var d=c,e=a();e.done(function(a){b.deferred.notify({curr:d,total:b.numToProcess,response:a})}),e.always(function(a){b.responses.push(a),b.queue.length?b.queue.shift()():b.stop()})}),this},a.prototype.start=function(){return this.queue.length&&(this.running=!0,this.queue.shift()()),this},a.prototype.stop=function(a,b){return this.running=!1,this.queue=[],a?this.deferred.reject(b):this.deferred.resolve(this.responses),this.numToProcess=0,this.deferred=jQuery.Deferred(),this},a.prototype.done=function(a){return this.deferred.done(a)},a.prototype.fail=function(a){return this.deferred.fail(a)},a.prototype.always=function(a){return this.deferred.always(a)},a.prototype.progress=function(a){return this.deferred.progress(a)},a.create=function(b){return new a(b).deferred},b.prototype=new a,b.prototype.constructor=b,b.prototype.add=function(b){if(!b.hasOwnProperty("name")||!b.hasOwnProperty("fn"))throw new Error('NamedAjaxQueue.add requires an object with both "name" and "fn": '+JSON.stringify(b));if(!this.names.hasOwnProperty(b.name))return this.names[b.name]=!0,a.prototype.add.call(this,b.fn)},b.prototype.clear=function(){return this.names={},this},b.create=function(a){return new b(a).deferred},{AjaxQueue:a,NamedAjaxQueue:b}});
//# sourceMappingURL=../../maps/utils/ajax-queue.js.map
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}});
//# sourceMappingURL=../../maps/utils/ajax-queue.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define(["jquery"],function(a){"use_strict";function b(a,b,d,e,f,g,h,i,j){void 0===f&&(f=30),void 0===h&&(h=4),c("#"+a).click(function(){if(!(c("#renaming-active").length>0)){var a,k=c("#"+b),l=k.text();a=g?c("<textarea></textarea>").attr({rows:h,cols:f}).text(c.trim(l)):c("<input type='text'></input>").attr({value:c.trim(l),size:f}),a.attr("id","renaming-active"),a.blur(function(){c(this).remove(),k.show(),j&&j(a)}),a.keyup(function(f){if(27===f.keyCode)c(this).trigger("blur");else if(13===f.keyCode){var g={};g[e]=c(this).val(),c(this).trigger("blur"),c.ajax({url:d,data:g,error:function(){alert("Text editing for elt "+b+" failed")},success:function(b){""!==b?k.text(b):k.html("<em>None</em>"),j&&j(a)}})}}),i&&i(a),k.hide(),a.insertAfter(k),a.focus(),a.select()}})}var c=a;return b});
//# sourceMappingURL=../../maps/utils/async-save-text.js.map
define(["jquery"],function(t){"use_strict";function e(t,e,r,n,a,u,o,c,s){void 0===a&&(a=30),void 0===o&&(o=4),i("#"+t).click(function(){if(!(i("#renaming-active").length>0)){var t,f=i("#"+e),l=f.text();t=u?i("<textarea></textarea>").attr({rows:o,cols:a}).text(i.trim(l)):i("<input type='text'></input>").attr({value:i.trim(l),size:a}),t.attr("id","renaming-active"),t.blur(function(){i(this).remove(),f.show(),s&&s(t)}),t.keyup(function(a){if(27===a.keyCode)i(this).trigger("blur");else if(13===a.keyCode){var u={};u[n]=i(this).val(),i(this).trigger("blur"),i.ajax({url:r,data:u,error:function(){alert("Text editing for elt "+e+" 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()}})}var i=t;return e});
//# sourceMappingURL=../../maps/utils/async-save-text.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define(["libs/underscore","viz/trackster/util","utils/config"],function(a,b){var c=Backbone.Model.extend({initialize:function(d){var e=this.get("key");this.set("id",e);var f=a.find(c.known_settings_defaults,function(a){return a.key===e});f&&this.set(a.extend({},f,d)),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",b.get_random_color()))},set_value:function(a,b){var c=this.get("type");"float"===c?a=parseFloat(a):"int"===c&&(a=parseInt(a,10)),this.set({value:a},b)}},{known_settings_defaults:[{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:"mode",type:"string",default_value:this.mode,hidden:!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},{key:"mode",type:"string",default_value:this.mode,hidden:!0}]}),d=Backbone.Collection.extend({model:c,to_key_value_dict:function(){var a={};return this.each(function(b){a[b.get("key")]=b.get("value")}),a},get_value:function(a){var b=this.get(a);return b?b.get("value"):void 0},set_value:function(a,b,c){var d=this.get(a);return d?d.set_value(b,c):void 0},set_default_value:function(a,b){var c=this.get(a);return c?c.set("default_value",b):void 0}},{from_models_and_saved_values:function(b,c){return c&&(b=a.map(b,function(b){return a.extend({},b,{value:c[b.key]})})),new d(b)}}),e=Backbone.View.extend({className:"config-settings-view",render:function(){var c=this.$el;return this.collection.each(function(d,e){if(!d.get("hidden")){var f="param_"+e,g=d.get("type"),h=d.get("value"),i=$("<div class='form-row' />").appendTo(c);if(i.append($("<label />").attr("for",f).text(d.get("label")+":")),"bool"===g)i.append($('<input type="checkbox" />').attr("id",f).attr("name",f).attr("checked",h));else if("text"===g)i.append($('<input type="text"/>').attr("id",f).val(h).click(function(){$(this).select()}));else if("select"===g){var j=$("<select />").attr("id",f);a.each(d.get("options"),function(a){$("<option/>").text(a.label).attr("value",a.value).appendTo(j)}),j.val(h),i.append(j)}else if("color"===g){var k=$("<div/>").appendTo(i),l=$("<input />").attr("id",f).attr("name",f).val(h).css("float","left").appendTo(k).click(function(a){$(".tooltip").removeClass("in");var b=$(this).siblings(".tooltip").addClass("in");b.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-$(b).height()/2+$(this).height()/2}).show(),b.click(function(a){a.stopPropagation()}),$(document).bind("click.color-picker",function(){b.hide(),$(document).unbind("click.color-picker")}),a.stopPropagation()}),m=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(k).attr("title","Set new random color").tooltip(),n=$("<div class='tooltip right' style='position: absolute;' />").appendTo(k).hide(),o=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(n),p=($("<div class='tooltip-arrow'></div>").appendTo(n),$.farbtastic(o,{width:100,height:100,callback:l,color:h}));k.append($("<div/>").css("clear","both")),function(a){m.click(function(){a.setColor(b.get_random_color())})}(p)}else i.append($("<input />").attr("id",f).attr("name",f).val(h));d.help&&i.append($("<div class='help'/>").text(d.help))}}),this},render_in_modal:function(a){var b=this,c=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc")},d=function(){Galaxy.modal.hide(),$(window).unbind("keypress.check_enter_esc"),b.update_from_form()},e=function(a){27===(a.keyCode||a.which)?c():13===(a.keyCode||a.which)&&d()};$(window).bind("keypress.check_enter_esc",e),0===this.$el.children().length&&this.render(),Galaxy.modal.show({title:a||"Configure",body:this.$el,buttons:{Cancel:c,OK:d}})},update_from_form:function(){var a=this;this.collection.each(function(b,c){if(!b.get("hidden")){var d="param_"+c,e=a.$el.find("#"+d).val();"bool"===b.get("type")&&(e=a.$el.find("#"+d).is(":checked")),b.set_value(e)}})}});return{ConfigSetting:c,ConfigSettingCollection:d,ConfigSettingCollectionView:e}});
//# sourceMappingURL=../../maps/utils/config.js.map
define(["libs/underscore","viz/trackster/util","utils/config"],function(e,t,l){var o=Backbone.Model.extend({initialize:function(l){var i=this.get("key");this.set("id",i);var a=e.find(o.known_settings_defaults,function(e){return e.key===i});a&&this.set(e.extend({},a,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)}},{known_settings_defaults:[{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:"mode",type:"string",default_value:this.mode,hidden:!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},{key:"mode",type:"string",default_value:this.mode,hidden:!0}]}),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"),s=o.get("value"),r=$("<div class='form-row' />").appendTo(l);if(r.append($("<label />").attr("for",a).text(o.get("label")+":")),"bool"===n)r.append($('<input type="checkbox" />').attr("id",a).attr("name",a).attr("checked",s));else if("text"===n)r.append($('<input type="text"/>').attr("id",a).val(s).click(function(){$(this).select()}));else if("select"===n){var d=$("<select />").attr("id",a);e.each(o.get("options"),function(e){$("<option/>").text(e.label).attr("value",e.value).appendTo(d)}),d.val(s),r.append(d)}else if("color"===n){var c=$("<div/>").appendTo(r),u=$("<input />").attr("id",a).attr("name",a).val(s).css("float","left").appendTo(c).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(c).attr("title","Set new random color").tooltip(),f=$("<div class='tooltip right' style='position: absolute;' />").appendTo(c).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:u,color:s}));c.append($("<div/>").css("clear","both")),function(e){p.click(function(){e.setColor(t.get_random_color())})}(v)}else r.append($("<input />").attr("id",a).attr("name",a).val(s));o.help&&r.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()},i=function(e){27===(e.keyCode||e.which)?l():13===(e.keyCode||e.which)&&o()};$(window).bind("keypress.check_enter_esc",i),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}});
//# sourceMappingURL=../../maps/utils/config.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(){this.active={},this.last=null},execute:function(b){var c=this,d=a.uid(),e=b.length>0;this.active[d]=!0;var f=$.Deferred();f.promise().always(function(){delete c.active[d],e&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+d)}),$.when(this.last).always(function(){c.active[d]?(e&&Galaxy.emit.debug("deferred::execute()","Running "+d),b(f),!e&&f.resolve()):f.reject()}),this.last=f.promise()},reset:function(){Galaxy.emit.debug("deferred::execute()","Reset");for(var a in this.active)this.active[a]=!1},ready:function(){return $.isEmptyObject(this.active)}})});
//# sourceMappingURL=../../maps/utils/deferred.js.map
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(),s=t.length>0;this.active[a]=!0;var n=$.Deferred();n.promise().always(function(){delete i.active[a],s&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+a)}),$.when(this.last).always(function(){i.active[a]?(s&&Galaxy.emit.debug("deferred::execute()","Running "+a),t(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
+2 -2
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a,b){if(0===a.length)return b.length;if(0===b.length)return a.length;var c,d=[];for(c=0;c<=b.length;c++)d[c]=[c];var e;for(e=0;e<=a.length;e++)d[0][e]=e;for(c=1;c<=b.length;c++)for(e=1;e<=a.length;e++)d[c][e]=b.charAt(c-1)===a.charAt(e-1)?d[c-1][e-1]:Math.min(d[c-1][e-1]+1,Math.min(d[c][e-1]+1,d[c-1][e]+1));return d[b.length][a.length]}return a});
//# sourceMappingURL=../../maps/utils/levenshtein.js.map
define([],function(){function n(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]}return n});
//# sourceMappingURL=../../maps/utils/levenshtein.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define(["i18n!nls/locale"],function(a){if(a.hasOwnProperty("__root")){var b="undefined"==typeof navigator?"__root":(navigator.language||navigator.userLanguage||"__root").toLowerCase();a=a["__"+b]||a["__"+b.split("-")[0]]||a.__root}var c=function(b){return a[b]||b};return c.cacheNonLocalized=!1,c});
//# sourceMappingURL=../../maps/utils/localization.js.map
define(["i18n!nls/locale"],function(o){if(o.hasOwnProperty("__root")){var n="undefined"==typeof navigator?"__root":(navigator.language||navigator.userLanguage||"__root").toLowerCase();o=o["__"+n]||o["__"+n.split("-")[0]]||o.__root}var a=function(n){return o[n]||n};return a.cacheNonLocalized=!1,a});
//# sourceMappingURL=../../maps/utils/localization.js.map
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a,b){var c=/(-?[0-9\.]+)/g,d=a.toString().toLowerCase()||"",e=b.toString().toLowerCase()||"",f=String.fromCharCode(0),g=d.replace(c,f+"$1"+f).split(f),h=e.replace(c,f+"$1"+f).split(f),i=new Date(d).getTime(),j=i?new Date(e).getTime():null;if(j){if(j>i)return-1;if(i>j)return 1}for(var k,l,m=0,n=Math.max(g.length,h.length);n>m;m++){if(k=parseFloat(g[m])||g[m],l=parseFloat(h[m])||h[m],l>k)return-1;if(k>l)return 1}return 0}return a});
//# sourceMappingURL=../../maps/utils/natural-sort.js.map
define([],function(){function e(e,r){var t=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",a=r.toString().toLowerCase()||"",i=String.fromCharCode(0),o=n.replace(t,i+"$1"+i).split(i),f=a.replace(t,i+"$1"+i).split(i),l=new Date(n).getTime(),u=l?new Date(a).getTime():null;if(u){if(l<u)return-1;if(l>u)return 1}for(var g,p,s=0,c=Math.max(o.length,f.length);s<c;s++){if(g=parseFloat(o[s])||o[s],p=parseFloat(f[s])||f[s],g<p)return-1;if(g>p)return 1}return 0}return e});
//# sourceMappingURL=../../maps/utils/natural-sort.js.map
+2 -2
View File
@@ -1,2 +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}function b(a){if(!a)return{};var b={},c=a.split("&");return c.forEach(function(a){var c=a.split("=");b[c[0]]=decodeURI(c[1])}),b}return{get:a,parse:b}});
//# sourceMappingURL=../../maps/utils/query-string-parsing.js.map
define([],function(){function n(n,e){e=e||window.location.search.substr(1);var t=new RegExp(n+"=([^&#$]+)"),r=e.match(t);if(r&&r.length)return r=r.splice(1),1===r.length?r[0]:r}function e(n){if(!n)return{};var e={};return n.split("&").forEach(function(n){var t=n.split("=");e[t[0]]=decodeURI(t[1])}),e}return{get:n,parse:e}});
//# sourceMappingURL=../../maps/utils/query-string-parsing.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
!function(a){jQuery.event.props.push("dataTransfer"),a.uploadpost=function(b){var c=a.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},b),d=c.data;if(d.error_message)return void c.error(d.error_message);var e=new FormData;for(var f in d.payload)e.append(f,d.payload[f]);var g=0;for(var f in d.files){var h=d.files[f];e.append(h.name,h.file,h.file.name),g+=h.file.size}return g>1048576*c.maxfilesize?void c.error(c.error_filesize):(xhr=new XMLHttpRequest,xhr.open("POST",c.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 a=null;if(xhr.responseText)try{a=jQuery.parseJSON(xhr.responseText)}catch(b){a=xhr.responseText}if(xhr.status<200||xhr.status>299){var d=xhr.statusText;403==xhr.status?d=c.error_login:0==xhr.status?d=c.error_server:d||(d=c.error_default),c.error(d+" ("+xhr.status+")")}else c.success(a)}},xhr.upload.addEventListener("progress",function(a){a.lengthComputable&&c.progress(Math.round(100*a.loaded/a.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",c),void xhr.send(e))},a.fn.uploadinput=function(b){var c=this,d=a.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},b),e=a('<input type="file" style="display: none" '+(d.multiple&&"multiple"||"")+"/>");return c.append(e.change(function(b){d.onchange(b.target.files),a(this).val("")})),c.on("drop",function(a){d.ondragleave(a),a.dataTransfer&&(d.onchange(a.dataTransfer.files),a.preventDefault())}),c.on("dragover",function(a){a.preventDefault(),d.ondragover(a)}),c.on("dragleave",function(a){a.stopPropagation(),d.ondragleave(a)}),{dialog:function(){e.trigger("click")}}},a.fn.uploadbox=function(b){function c(a){if(a&&a.length&&!p){var b=n;return _.each(a,function(a){"new"!==a.mode&&_.filter(m,function(b){return b.name===a.name&&b.size===a.size}).length&&(a.duplicate=!0)}),_.each(a,function(a){if(!a.duplicate){var b=String(n++);m[b]=a,l.announce(b,m[b]),o++}}),b}}function d(a){m[a]&&(delete m[a],o--)}function e(){if(0==o||q)return q=!1,p=!1,void l.complete();p=!0;var b=-1;for(var c in m){b=c;break}m[b];d(b),a.uploadpost({url:l.url,data:l.initialize(b),success:function(a){l.success(b,a),e()},error:function(a){l.error(b,a),e()},progress:function(a){l.progress(b,a)}})}function f(){r.dialog()}function g(a){for(a in m)d(a)}function h(){p||(p=!0,e())}function i(){q=!0}function j(b){return l=a.extend({},l,b)}function k(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var l=a.extend({},{dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(a,b){alert(b)},complete:function(){}},b),m={},n=0,o=0,p=!1,q=!1,r=a(this).uploadinput({multiple:!0,onchange:function(a){c(a)},ondragover:b.ondragover,ondragleave:b.ondragleave});return{select:f,add:c,remove:d,start:h,stop:i,reset:g,configure:j,compatible:k}}}(jQuery);
//# sourceMappingURL=../../maps/utils/uploadbox.js.map
!function(e){jQuery.event.props.push("dataTransfer"),e.uploadpost=function(r){var n=e.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},r),t=n.data;if(t.error_message)return void n.error(t.error_message);var o=new FormData;for(var a in t.payload)o.append(a,t.payload[a]);var i=0;for(var a in t.files){var u=t.files[a];o.append(u.name,u.file,u.file.name),i+=u.file.size}if(i>1048576*n.maxfilesize)return 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=jQuery.parseJSON(xhr.responseText)}catch(r){e=xhr.responseText}if(xhr.status<200||xhr.status>299){var r=xhr.statusText;403==xhr.status?r=n.error_login:0==xhr.status?r=n.error_server:r||(r=n.error_default),n.error(r+" ("+xhr.status+")")}else n.success(e)}},xhr.upload.addEventListener("progress",function(e){e.lengthComputable&&n.progress(Math.round(100*e.loaded/e.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),xhr.send(o)},e.fn.uploadinput=function(r){var n=this,t=e.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},r),o=e('<input type="file" style="display: none" '+(t.multiple&&"multiple"||"")+"/>");return n.append(o.change(function(r){t.onchange(r.target.files),e(this).val("")})),n.on("drop",function(e){t.ondragleave(e),e.dataTransfer&&(t.onchange(e.dataTransfer.files),e.preventDefault())}),n.on("dragover",function(e){e.preventDefault(),t.ondragover(e)}),n.on("dragleave",function(e){e.stopPropagation(),t.ondragleave(e)}),{dialog:function(){o.trigger("click")}}},e.fn.uploadbox=function(r){function n(e){if(e&&e.length&&!h){var r=p;return _.each(e,function(e,r){"new"!==e.mode&&_.filter(d,function(r){return r.name===e.name&&r.size===e.size}).length&&(e.duplicate=!0)}),_.each(e,function(e){if(!e.duplicate){var r=String(p++);d[r]=e,f.announce(r,d[r]),g++}}),r}}function t(e){d[e]&&(delete d[e],g--)}function o(){if(0==g||v)return v=!1,h=!1,void f.complete();h=!0;var r=-1;for(var n in d){r=n;break}d[r];t(r),e.uploadpost({url:f.url,data:f.initialize(r),success:function(e){f.success(r,e),o()},error:function(e){f.error(r,e),o()},progress:function(e){f.progress(r,e)}})}function a(){x.dialog()}function i(e){for(e in d)t(e)}function u(){h||(h=!0,o())}function s(){v=!0}function l(r){return f=e.extend({},f,r)}function c(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var f=e.extend({},{dragover:function(){},dragleave:function(){},announce:function(e){},initialize:function(e){},progress:function(e,r){},success:function(e,r){},error:function(e,r){alert(r)},complete:function(){}},r),d={},p=0,g=0,h=!1,v=!1,x=e(this).uploadinput({multiple:!0,onchange:function(e){n(e)},ondragover:r.ondragover,ondragleave:r.ondragleave});return{select:a,add:n,remove:t,start:u,stop:s,reset:i,configure:l,compatible:c}}}(jQuery);
//# sourceMappingURL=../../maps/utils/uploadbox.js.map
+2 -2
View File
@@ -1,2 +1,2 @@
define([],function(){function a(a){return'<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>'}function b(a,c){for(var d in a){var e=a[d];if(_.isObject(e)){var f=c(e);f&&(a[d]=f),b(e,c)}}}function c(a){var b,c,d,e;return c=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,b=a.replace(c,'<a href="$1" target="_blank">$1</a>'),d=/(^|[^\/])(www\.[\S]+(\b|$))/gim,b=b.replace(d,'$1<a href="http://$2" target="_blank">$2</a>'),e=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim,b=b.replace(e,'<a href="mailto:$1">$1</a>')}function d(a){return JSON.parse(JSON.stringify(a)||null)}function e(a){return/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function f(a){return $("<div/>").text(a).html()}function g(a){if(a instanceof Array||(a=[a]),0===a.length)return!0;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!0;return!1}function h(a){if($.isArray(a)){var a=a.toString().replace(/,/g,", "),b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+2)),a}return""}function i(a){top.__utils__get__=top.__utils__get__||{};var b=JSON.stringify(a);a.cache&&top.__utils__get__[b]?(a.success&&a.success(top.__utils__get__[b]),window.console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):j({url:a.url,data:a.data,success:function(c){top.__utils__get__[b]=c,a.success&&a.success(c)},error:function(b,c){a.error&&a.error(b,c)}})}function j(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?($.isEmptyObject(b.data)||(b.url+=-1==b.url.indexOf("?")?"?":"&",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.status)}).always(function(){a.complete&&a.complete()})}function k(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function l(a){$('link[href^="'+a+'"]').length||$('<link href="'+Galaxy.root+a+'" rel="stylesheet">').appendTo("head")}function m(a,b){return a?_.defaults(a,b):b}function n(a,b){for(var c=1,d=0;b>d;d++)c*=10;return Math.round(a*c)/c}function o(a,b,c){c=void 0!==c?c:1;var d="";if(a>=u)a/=u,d="TB";else if(a>=t)a/=t,d="GB";else if(a>=s)a/=s,d="MB";else if(a>=r)a/=r,d="KB";else{if(!(a>0))return b?"0 b":"<strong>-</strong>";d="b"}var e="b"==d?a:n(a,c);return b?e+" "+d:"<strong>"+e+"</strong> "+d}function p(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function q(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes();return datetime=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c}var r=1024,s=r*r,t=s*r,u=t*r;return{cssLoadFile:l,cssGetAttribute:k,get:i,merge:m,iframe:a,bytesToString:o,uid:p,time:q,request:j,sanitize:f,textify:h,isEmpty:g,deepeach:b,isJSON:e,clone:d,linkify:c}});
//# sourceMappingURL=../../maps/utils/utils.js.map
define([],function(){function t(t){return'<iframe src="'+t+'" frameborder="0" style="width: 100%; height: 100%;"/>'}function e(t,r){for(var n in t){var i=t[n];if(_.isObject(i)){var a=r(i);a&&(t[n]=a),e(i,r)}}}function r(t){var e,r,n,i;return r=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,e=t.replace(r,'<a href="$1" target="_blank">$1</a>'),n=/(^|[^\/])(www\.[\S]+(\b|$))/gim,e=e.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,e=e.replace(i,'<a href="mailto:$1">$1</a>')}function n(t){return JSON.parse(JSON.stringify(t)||null)}function i(t){return/^[\],:{}\s]*$/.test(t.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))}function a(t){return $("<div/>").text(t).html()}function u(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}function s(t){if($.isArray(t)){var t=t.toString().replace(/,/g,", "),e=t.lastIndexOf(", ");return-1!=e&&(t=t.substr(0,e)+" or "+t.substr(e+2)),t}return""}function o(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+"].")):l({url:t.url,data:t.data,success:function(r){top.__utils__get__[e]=r,t.success&&t.success(r)},error:function(e,r){t.error&&t.error(e,r)}})}function l(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 r=null;try{r=jQuery.parseJSON(e.responseText)}catch(t){r=e.responseText}t.error&&t.error(r,e.status)}).always(function(){t.complete&&t.complete()})}function c(t,e){var r=$('<div class="'+t+'"></div>');r.appendTo(":eq(0)");var n=r.css(e);return r.remove(),n}function f(t){$('link[href^="'+t+'"]').length||$('<link href="'+Galaxy.root+t+'" rel="stylesheet">').appendTo("head")}function d(t,e){return t?_.defaults(t,e):e}function p(t,e){for(var r=1,n=0;n<e;n++)r*=10;return Math.round(t*r)/r}function g(t,e,r){r=void 0!==r?r:1;var n="";if(t>=O)t/=O,n="TB";else if(t>=b)t/=b,n="GB";else if(t>=m)t/=m,n="MB";else if(t>=v)t/=v,n="KB";else{if(!(t>0))return e?"0 b":"<strong>-</strong>";n="b"}var i="b"==n?t:p(t,r);return e?i+" "+n:"<strong>"+i+"</strong> "+n}function y(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function h(){var t=new Date,e=(t.getHours()<10?"0":"")+t.getHours(),r=(t.getMinutes()<10?"0":"")+t.getMinutes();return datetime=t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear()+", "+e+":"+r}var v=1024,m=v*v,b=m*v,O=b*v;return{cssLoadFile:f,cssGetAttribute:c,get:o,merge:d,iframe:t,bytesToString:g,uid:y,time:h,request:l,sanitize:a,textify:s,isEmpty:u,deepeach:e,isJSON:i,clone:n,linkify:r}});
//# sourceMappingURL=../../maps/utils/utils.js.map