commit/galaxy-central: carlfeberhard: Style: add proper alert macro for warning, add errormessagesmall; pack scripts
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/4ef6df129520/ Changeset: 4ef6df129520 User: carlfeberhard Date: 2013-09-23 21:23:38 Summary: Style: add proper alert macro for warning, add errormessagesmall; pack scripts Affected #: 10 files diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/mvc/dataset/hda-base.js --- a/static/scripts/mvc/dataset/hda-base.js +++ b/static/scripts/mvc/dataset/hda-base.js @@ -82,6 +82,10 @@ this.$el.attr( 'id', 'historyItemContainer-' + id ); + //HACK: hover exit doesn't seem to be called on prev. tooltips when RE-rendering - so: no tooltip hide + // handle that here by removing previous view's tooltips + this.$el.find("[title]").tooltip( "destroy" ); + /** web controller urls for functions relating to this hda. * These are rendered from urlTemplates using the model data. */ this.urls = this._renderUrls( this.urlTemplates, this.model.toJSON() ); diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/mvc/dataset/hda-edit.js --- a/static/scripts/mvc/dataset/hda-edit.js +++ b/static/scripts/mvc/dataset/hda-edit.js @@ -166,6 +166,7 @@ success: function() { // FIXME: setting model attribute causes re-rendering, which is unnecessary. //self.$el.remove(); + self.model.set({ deleted: true }); } }); diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/galaxy.base.js --- a/static/scripts/packed/galaxy.base.js +++ b/static/scripts/packed/galaxy.base.js @@ -1,1 +1,1 @@ -(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){g.append($("<li></li>").append($("<a href='#'></a>").html(j).click(i)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]=function(){if(!e||confirm(e)){var k;if(h==="_parent"){window.parent.location=f}else{if(h==="_top"){window.top.location=f}else{if(h==="demo"){if(k===undefined||k.closed){k=window.open(f,h);k.creator=self}}else{var j=["galaxy_main"];if((h&&(h in window)&&(j.indexOf(h)!==-1))){window[h].location=f}else{window.location=f}}}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=a.text(),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip({placement:"top"})}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})}); \ No newline at end of file +(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){var j;if(h==="demo"){if(j===undefined||j.closed){j=window.open(f,h);j.creator=self}}else{g.trigger("click")}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=a.text(),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip({placement:"top"})}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})}); \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/galaxy.modal.js --- a/static/scripts/packed/galaxy.modal.js +++ b/static/scripts/packed/galaxy.modal.js @@ -1,1 +1,1 @@ -define(["libs/backbone/backbone-relational"],function(){var a=Backbone.View.extend({el_main:"#everything",options:{title:"galaxy-modal",body:"No content available."},initialize:function(b){if(b){this.create(b);$(this.el).hide()}},show:function(b){if(b){this.create(b)}this.$el.fadeIn("fast")},hide:function(){this.$el.fadeOut("fast")},create:function(c){this.$el.remove();if(!c){c=this.options}else{c=_.defaults(c,this.options)}this.setElement(this.template(c.title,c.body));$(this.el_main).append($(this.el));var d=(this.$el).find(".buttons");var b=this;if(c.buttons){$.each(c.buttons,function(e,f){d.append($("<button></button>").text(e).click(f)).append(" ")})}else{d.append($("<button></button>").text("Close").click(function(){b.hide()})).append(" ")}},template:function(c,b){return'<div class="modal in"><div class="modal-backdrop in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><span><h3 class="title">'+c+'</h3></span></div><div class="modal-body style="min-width: 540px; max-height: 445px;">'+b+'</div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{GalaxyModal:a}}); \ No newline at end of file +define(["libs/backbone/backbone-relational"],function(){var a=Backbone.View.extend({el_main:"#everything",options:{title:"galaxy-modal",body:"No content available."},initialize:function(b){if(b){this.create(b);$(this.el).hide()}},show:function(b){if(b){this.create(b)}this.$el.fadeIn("fast")},hide:function(){this.$el.fadeOut("fast")},create:function(c){this.$el.remove();if(!c){c=this.options}else{c=_.defaults(c,this.options)}this.setElement(this.template(c.title,c.body));$(this.el_main).append($(this.el));var d=(this.$el).find(".buttons");var b=this;if(c.buttons){$.each(c.buttons,function(e,f){d.append($('<button id="'+String(e).toLowerCase()+'"></button>').text(e).click(f)).append(" ")})}else{d.append($("<button></button>").text("Close").click(function(){b.hide()})).append(" ")}},enable:function(b){$(this.el).find("#"+String(b).toLowerCase()).prop("disabled",false)},disable:function(b){$(this.el).find("#"+String(b).toLowerCase()).prop("disabled",true)},template:function(c,b){return'<div class="modal in"><div class="modal-backdrop in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><span><h3 class="title">'+c+'</h3></span></div><div class="modal-body style="min-width: 540px; max-height: 445px;">'+b+'</div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{GalaxyModal:a}}); \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/galaxy.panels.js --- a/static/scripts/packed/galaxy.panels.js +++ b/static/scripts/packed/galaxy.panels.js @@ -1,1 +1,1 @@ -!function(c,d){var e=function(){if(d("#DD-helper").length==0){d("<div id='DD-helper'/>").appendTo("body").hide()}};var b=150,h=800;var k=function(n){this.$panel=n.panel;this.$center=n.center;this.$drag=n.drag;this.$toggle=n.toggle;this.left=!n.right;this.hidden=false;this.hidden_by_tool=false;this.saved_size=null;this.init()};d.extend(k.prototype,{resize:function(n){this.$panel.css("width",n);if(this.left){this.$center.css("left",n)}else{this.$center.css("right",n)}if(document.recalc){document.recalc()}},do_toggle:function(){var n=this;if(this.hidden){this.$toggle.removeClass("hidden");if(this.left){this.$panel.css("left",-this.saved_size).show().animate({left:0},"fast",function(){n.resize(n.saved_size)})}else{this.$panel.css("right",-this.saved_size).show().animate({right:0},"fast",function(){n.resize(n.saved_size)})}n.hidden=false}else{n.saved_size=this.$panel.width();if(document.recalc){document.recalc()}if(this.left){this.$panel.animate({left:-this.saved_size},"fast")}else{this.$panel.animate({right:-this.saved_size},"fast")}if(this.left){this.$center.css("left",0)}else{this.$center.css("right",0)}n.hidden=true;n.$toggle.addClass("hidden")}this.hidden_by_tool=false},handle_minwidth_hint:function(n){var o=this.$center.width()-(this.hidden?this.saved_size:0);if(o<n){if(!this.hidden){this.do_toggle();this.hidden_by_tool=true}}else{if(this.hidden_by_tool){this.do_toggle();this.hidden_by_tool=false}}},force_panel:function(n){if((this.hidden&&n=="show")||(!this.hidden&&n=="hide")){this.do_toggle()}},init:function(){var n=this;this.$toggle.remove().appendTo("body");this.$drag.on("dragstart",function(o,p){d("#DD-helper").show();p.width=n.$panel.width()}).on("dragend",function(){d("#DD-helper").hide()}).on("drag",function(p,q){var o;if(n.left){o=q.width+q.deltaX}else{o=q.width-q.deltaX}o=Math.min(h,Math.max(b,o));n.resize(o)});n.$toggle.on("click",function(){n.do_toggle()})}});var f=function(n){this.$overlay=n.overlay;this.$dialog=n.dialog;this.$header=this.$dialog.find(".modal-header");this.$body=this.$dialog.find(".modal-body");this.$footer=this.$dialog.find(".modal-footer");this.$backdrop=n.backdrop};d.extend(f.prototype,{setContent:function(p){if(p.title){this.$header.find(".title").html(p.title);this.$header.show()}else{this.$header.hide()}this.$footer.hide();var o=this.$footer.find(".buttons").html("");if(p.buttons){d.each(p.buttons,function(r,s){o.append(d("<button></button> ").text(r).click(s)).append(" ")});this.$footer.show()}var q=this.$footer.find(".extra_buttons").html("");if(p.extra_buttons){d.each(p.extra_buttons,function(r,s){q.append(d("<button></button>").text(r).click(s)).append(" ")});this.$footer.show()}var n=p.body;if(n=="progress"){n=d("<div class='progress progress-striped active'><div class='bar' style='width: 100%'></div></div>")}this.$body.html(n)},show:function(n,o){if(!this.$dialog.is(":visible")){if(n.backdrop){this.$backdrop.addClass("in")}else{this.$backdrop.removeClass("in")}this.$overlay.show();this.$dialog.show();this.$overlay.addClass("in");this.$body.css("min-width",this.$body.width());this.$body.css("max-height",d(window).height()-2*this.$dialog.offset().top-this.$footer.outerHeight()-this.$header.outerHeight())}if(o){o()}},hide:function(){var n=this;n.$dialog.fadeOut(function(){n.$overlay.hide();n.$backdrop.removeClass("in");n.$body.children().remove();n.$body.css("min-width",undefined)})}});var m;d(function(){m=new f({overlay:d("#top-modal"),dialog:d("#top-modal-dialog"),backdrop:d("#top-modal-backdrop")})});function a(){m.hide()}function l(r,n,p,o,q){m.setContent({title:r,body:n,buttons:p,extra_buttons:o});m.show({backdrop:true},q)}function g(r,n,p,o,q){m.setContent({title:r,body:n,buttons:p,extra_buttons:o});m.show({backdrop:false},q)}function j(p){var q=p.width||"600";var o=p.height||"400";var n=p.scroll||"auto";d("#overlay-background").bind("click.overlay",function(){a();d("#overlay-background").unbind("click.overlay")});l(null,d("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;src='"+galaxy_config.root+"static/images/closebox.png'><iframe style='margin: 0; padding: 0;' src='"+p.url+"' width='"+q+"' height='"+o+"' scrolling='"+n+"' frameborder='0'></iframe></div>"));d("#close_button").bind("click",function(){a()})}function i(n,o){if(n){d(".loggedin-only").show();d(".loggedout-only").hide();d("#user-email").text(n);if(o){d(".admin-only").show()}}else{d(".loggedin-only").hide();d(".loggedout-only").show();d(".admin-only").hide()}}d(function(){var n=d("#masthead ul.nav > li.dropdown > .dropdown-menu");d("body").on("click.nav_popups",function(p){n.hide();d("#DD-helper").hide();if(d(p.target).closest("#masthead ul.nav > li.dropdown > .dropdown-menu").length){return}var o=d(p.target).closest("#masthead ul.nav > li.dropdown");if(o.length){d("#DD-helper").show();o.children(".dropdown-menu").show();p.preventDefault()}})});c.ensure_dd_helper=e;c.Panel=k;c.Modal=f;c.hide_modal=a;c.show_modal=l;c.show_message=g;c.show_in_overlay=j;c.user_changed=i}(window,window.jQuery); \ No newline at end of file +!function(c,d){var e=function(){if(d("#DD-helper").length==0){d("<div id='DD-helper'/>").appendTo("body").hide()}};var b=150,h=800;var k=function(n){this.$panel=n.panel;this.$center=n.center;this.$drag=n.drag;this.$toggle=n.toggle;this.left=!n.right;this.hidden=false;this.hidden_by_tool=false;this.saved_size=null;this.init()};d.extend(k.prototype,{resize:function(n){this.$panel.css("width",n);if(this.left){this.$center.css("left",n)}else{this.$center.css("right",n)}if(document.recalc){document.recalc()}},do_toggle:function(){var n=this;if(this.hidden){this.$toggle.removeClass("hidden");if(this.left){this.$panel.css("left",-this.saved_size).show().animate({left:0},"fast",function(){n.resize(n.saved_size)})}else{this.$panel.css("right",-this.saved_size).show().animate({right:0},"fast",function(){n.resize(n.saved_size)})}n.hidden=false}else{n.saved_size=this.$panel.width();if(document.recalc){document.recalc()}if(this.left){this.$panel.animate({left:-this.saved_size},"fast")}else{this.$panel.animate({right:-this.saved_size},"fast")}if(this.left){this.$center.css("left",0)}else{this.$center.css("right",0)}n.hidden=true;n.$toggle.addClass("hidden")}this.hidden_by_tool=false},handle_minwidth_hint:function(n){var o=this.$center.width()-(this.hidden?this.saved_size:0);if(o<n){if(!this.hidden){this.do_toggle();this.hidden_by_tool=true}}else{if(this.hidden_by_tool){this.do_toggle();this.hidden_by_tool=false}}},force_panel:function(n){if((this.hidden&&n=="show")||(!this.hidden&&n=="hide")){this.do_toggle()}},init:function(){var n=this;this.$toggle.remove().appendTo("body");this.$drag.on("dragstart",function(o,p){d("#DD-helper").show();p.width=n.$panel.width()}).on("dragend",function(){d("#DD-helper").hide()}).on("drag",function(p,q){var o;if(n.left){o=q.width+q.deltaX}else{o=q.width-q.deltaX}o=Math.min(h,Math.max(b,o));n.resize(o)});n.$toggle.on("click",function(){n.do_toggle()})}});var f=function(n){this.$overlay=n.overlay;this.$dialog=n.dialog;this.$header=this.$dialog.find(".modal-header");this.$body=this.$dialog.find(".modal-body");this.$footer=this.$dialog.find(".modal-footer");this.$backdrop=n.backdrop};d.extend(f.prototype,{setContent:function(p){if(p.title){this.$header.find(".title").html(p.title);this.$header.show()}else{this.$header.hide()}this.$footer.hide();var o=this.$footer.find(".buttons").html("");if(p.buttons){d.each(p.buttons,function(r,s){o.append(d("<button></button> ").text(r).click(s)).append(" ")});this.$footer.show()}var q=this.$footer.find(".extra_buttons").html("");if(p.extra_buttons){d.each(p.extra_buttons,function(r,s){q.append(d("<button></button>").text(r).click(s)).append(" ")});this.$footer.show()}var n=p.body;if(n=="progress"){n=d("<div class='progress progress-striped active'><div class='bar' style='width: 100%'></div></div>")}this.$body.html(n)},show:function(n,o){if(!this.$dialog.is(":visible")){if(n.backdrop){this.$backdrop.addClass("in")}else{this.$backdrop.removeClass("in")}this.$overlay.show();this.$dialog.show();this.$overlay.addClass("in");this.$body.css("min-width",this.$body.width());this.$body.css("max-height",d(window).height()-this.$footer.outerHeight()-this.$header.outerHeight()-parseInt(this.$dialog.css("padding-top"),10)-parseInt(this.$dialog.css("padding-bottom"),10))}if(o){o()}},hide:function(){var n=this;n.$dialog.fadeOut(function(){n.$overlay.hide();n.$backdrop.removeClass("in");n.$body.children().remove();n.$body.css("min-width",undefined)})}});var m;d(function(){m=new f({overlay:d("#top-modal"),dialog:d("#top-modal-dialog"),backdrop:d("#top-modal-backdrop")})});function a(){m.hide()}function l(r,n,p,o,q){m.setContent({title:r,body:n,buttons:p,extra_buttons:o});m.show({backdrop:true},q)}function g(r,n,p,o,q){m.setContent({title:r,body:n,buttons:p,extra_buttons:o});m.show({backdrop:false},q)}function j(p){var q=p.width||"600";var o=p.height||"400";var n=p.scroll||"auto";d("#overlay-background").bind("click.overlay",function(){a();d("#overlay-background").unbind("click.overlay")});l(null,d("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;src='"+galaxy_config.root+"static/images/closebox.png'><iframe style='margin: 0; padding: 0;' src='"+p.url+"' width='"+q+"' height='"+o+"' scrolling='"+n+"' frameborder='0'></iframe></div>"));d("#close_button").bind("click",function(){a()})}function i(n,o){if(n){d(".loggedin-only").show();d(".loggedout-only").hide();d("#user-email").text(n);if(o){d(".admin-only").show()}}else{d(".loggedin-only").hide();d(".loggedout-only").show();d(".admin-only").hide()}}d(function(){var n=d("#masthead ul.nav > li.dropdown > .dropdown-menu");d("body").on("click.nav_popups",function(p){n.hide();d("#DD-helper").hide();if(d(p.target).closest("#masthead ul.nav > li.dropdown > .dropdown-menu").length){return}var o=d(p.target).closest("#masthead ul.nav > li.dropdown");if(o.length){d("#DD-helper").show();o.children(".dropdown-menu").show();p.preventDefault()}})});c.ensure_dd_helper=e;c.Panel=k;c.Modal=f;c.hide_modal=a;c.show_modal=l;c.show_message=g;c.show_in_overlay=j;c.user_changed=i}(window,window.jQuery); \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/galaxy.upload.js --- a/static/scripts/packed/galaxy.upload.js +++ b/static/scripts/packed/galaxy.upload.js @@ -1,1 +1,1 @@ -define(["galaxy.modal","galaxy.master","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,c){var a=Backbone.View.extend({modal:null,button_show:null,file_counter:0,initialize:function(){var d=this;this.button_show=new c.GalaxyMasterIcon({icon:"fa-icon-upload",tooltip:"Upload Files",on_click:function(f){d.event_show(f)},with_number:true});Galaxy.master.prepend(this.button_show)},events:{mouseover:"event_mouseover",mouseleave:"event_mouseleave"},event_mouseover:function(d){$("#galaxy-upload-box").addClass("highlight")},event_mouseleave:function(d){$("#galaxy-upload-box").removeClass("highlight")},event_start:function(d,e,f){var g="#galaxy-upload-file-"+d;$("#galaxy-upload-box").append(this.template_file(g));$("#galaxy-upload-file-"+d).find(".title").html(e.name);this.event_progress(d,e,0);this.file_counter++;this.refresh()},event_progress:function(e,f,h){var g=$("#galaxy-upload-file-"+e);var d=parseInt(h);g.find(".progress").css({width:d+"%"});g.find(".info").html(d+"% of "+this.size_to_string(f.size))},event_success:function(d,e,f){Galaxy.currHistoryPanel.refresh();this.file_counter--;this.refresh()},event_error:function(d,e,g){var f=$("#galaxy-upload-file-"+d);f.find(".progress-frame").addClass("failed");f.find(".error").html("<strong>Failed:</strong> "+g);this.event_progress(d,e,0);this.file_counter--;this.refresh()},event_show:function(g){g.preventDefault();if(!Galaxy.currHistoryPanel){var f=this;window.setTimeout(function(){f.event_show(g)},200);return}if(!this.modal){var f=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template(),buttons:{Close:function(){f.modal.hide()}}});var d=Galaxy.currHistoryPanel.model.get("id");var f=this;$("#galaxy-upload-box").uploadbox({url:galaxy_config.root+"api/histories/"+d+"/contents",dragover:f.event_mouseover,dragleave:f.event_mouseleave,start:function(e,h,i){f.event_start(e,h,i)},success:function(e,h,i){f.event_success(e,h,i)},progress:function(e,h,i){f.event_progress(e,h,i)},error:function(e,h,i){f.event_error(e,h,i)},data:{source:"upload"}});this.setElement("#galaxy-upload-box")}this.modal.show()},refresh:function(){if(this.file_counter>0){this.button_show.number(this.file_counter)}else{this.button_show.number("")}},size_to_string:function(d){var e="";if(d>=100000000000){d=d/100000000000;e="TB"}else{if(d>=100000000){d=d/100000000;e="GB"}else{if(d>=100000){d=d/100000;e="MB"}else{if(d>=100){d=d/100;e="KB"}else{d=d*10;e="b"}}}}return"<strong>"+(Math.round(d)/10)+"</strong> "+e},template:function(){return'<form id="galaxy-upload-box" class="galaxy-upload-box"></form>'},template_file:function(d){return'<div id="'+d.substr(1)+'" class="file corner-soft shadow"><div class="title"></div><div class="error"></div><div class="progress-frame corner-soft"><div class="progress"></div></div><div class="info"></div></div>'}});return{GalaxyUpload:a}}); \ No newline at end of file +define(["galaxy.modal","galaxy.master","utils/galaxy.uploadbox","libs/backbone/backbone-relational"],function(b,c){var a=Backbone.View.extend({modal:null,button_show:null,uploadbox:null,initialize:function(){if(!Galaxy.currHistoryPanel){var d=this;window.setTimeout(function(){d.initialize()},500);return}var d=this;this.button_show=new c.GalaxyMasterIcon({icon:"fa-icon-upload",tooltip:"Upload Files",on_click:function(f){d.event_show(f)},with_number:true});Galaxy.master.prepend(this.button_show)},events:{mouseover:"event_mouseover",mouseleave:"event_mouseleave"},event_mouseover:function(d){},event_mouseleave:function(d){},event_announce:function(e,f,h){this.uploadbox.info().hide();var i="#upload-"+e;$(this.el).append(this.template_file(i));$(this.el).scrollTop($(this.el).prop("scrollHeight"));var g=this.get_upload_item(e);g.fadeIn();g.find(".title").html(f.name);g.find("#extension").select2({placeholder:"Auto-detect",width:"copy",ajax:{url:"http://www.weighttraining.com/sm/search",dataType:"jsonp",quietMillis:100,data:function(j,k){return{types:["exercise"],limit:-1,term:j}},results:function(k,j){return{results:k.results.exercise}}},formatResult:function(j){return"<div class='select2-user-result'>"+j.term+"</div>"},formatSelection:function(j){return j.term},initSelection:function(j,l){var k=$(j).attr("data-init-text");l({term:k})}});var d=this;g.find(".remove").on("click",function(){d.event_remove(e)});this.event_progress(e,f,0);this.modal.enable("Upload");this.modal.enable("Reset")},event_initialize:function(d,e,g){this.button_show.number(g);var f=this.get_upload_item(d);var h={source:"upload",space_to_tabs:f.find("#space_to_tabs").is(":checked"),extension:f.find("#extension").val()};return h},event_progress:function(e,f,h){var g=this.get_upload_item(e);var d=parseInt(h);g.find(".progress-bar").css({width:d+"%"});g.find(".info").html(d+"% of "+this.size_to_string(f.size))},event_success:function(d,e,g){var f=this.get_upload_item(d);f.addClass("panel-success");f.removeClass("panel-default");Galaxy.currHistoryPanel.refresh();this.event_progress(d,e,100);this.button_show.number("")},event_error:function(d,e,g){var f=this.get_upload_item(d);f.addClass("panel-danger");f.removeClass("panel-default");f.find(".progress").remove();f.find(".error").html("<strong>Failed:</strong> "+g);this.event_progress(d,e,0);this.button_show.number("")},event_upload:function(){$(this.el).find(".panel-body").hide();$(this.el).find(".remove").each(function(){$(this).removeClass("fa-icon-trash");$(this).addClass("fa-icon-caret-down")});this.modal.disable("Upload");var d=Galaxy.currHistoryPanel.model.get("id");this.uploadbox.configure({url:galaxy_config.root+"api/histories/"+d+"/contents"});this.uploadbox.upload()},event_reset:function(){var e=$(this.el).find(".panel");var d=this;e.fadeOut({complete:function(){e.remove();d.uploadbox.info().fadeIn()}});this.modal.disable("Upload");this.modal.disable("Reset");this.uploadbox.reset()},event_remove:function(e){var d=this;var f=this.get_upload_item(e);f.fadeOut({complete:function(){f.remove();d.uploadbox.remove(e);if($(d.el).find(".panel").length>0){d.modal.enable("Reset")}else{d.modal.disable("Reset");d.uploadbox.info().fadeIn()}if(d.uploadbox.length()>0){d.modal.enable("Upload")}else{d.modal.disable("Upload")}}})},event_show:function(f){f.preventDefault();if(!this.modal){var d=this;this.modal=new b.GalaxyModal({title:"Upload files from your local drive",body:this.template("upload-box"),buttons:{Select:function(){d.uploadbox.select()},Upload:function(){d.event_upload()},Reset:function(){d.event_reset()},Close:function(){d.modal.hide()}}});this.setElement("#upload-box");var d=this;this.uploadbox=this.$el.uploadbox({dragover:d.event_mouseover,dragleave:d.event_mouseleave,announce:function(e,g,h){d.event_announce(e,g,h)},initialize:function(e,g,h){return d.event_initialize(e,g,h)},success:function(e,g,h){d.event_success(e,g,h)},progress:function(e,g,h){d.event_progress(e,g,h)},error:function(e,g,h){d.event_error(e,g,h)},});this.modal.disable("Upload");this.modal.disable("Reset")}this.modal.show()},get_upload_item:function(d){return $(this.el).find("#upload-"+d)},size_to_string:function(d){var e="";if(d>=100000000000){d=d/100000000000;e="TB"}else{if(d>=100000000){d=d/100000000;e="GB"}else{if(d>=100000){d=d/100000;e="MB"}else{if(d>=100){d=d/100;e="KB"}else{d=d*10;e="b"}}}}return"<strong>"+(Math.round(d)/10)+"</strong> "+e},template:function(d){return'<div id="'+d+'" class="upload-box"></div>'},template_file:function(d){return'<div id="'+d.substr(1)+'" class="panel panel-default"><div class="panel-heading"><h5 class="title"></h5><h5 class="info"></h5><div class="remove fa-icon-trash"></div></div><div class="panel-body"><div class="menu"><span><input id="space_to_tabs" type="checkbox">Convert spaces to tabs</input></span></div></div><div class="panel-footer"><div class="progress"><div class="progress-bar progress-bar-success"></div></div><h6 class="error"></h6></div></div>'}});return{GalaxyUpload:a}}); \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/mvc/dataset/hda-base.js --- a/static/scripts/packed/mvc/dataset/hda-base.js +++ b/static/scripts/packed/mvc/dataset/hda-base.js @@ -1,1 +1,1 @@ -var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(d,c){var b=_.omit(this.model.changedAttributes(),"display_apps","display_types");if(_.keys(b).length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find("[title]").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var b={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){b.enabled=false;b.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD){b.enabled=false;b.title=_l("This dataset must finish uploading before it can be viewed")}else{b.title=_l("View data");b.href=this.urls.display;var a=this;b.on_click=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer",type:"url",location:"center",content:a.urls.display})}}}this.displayButton=new IconButtonView({model:new IconButton(b)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]}; \ No newline at end of file +var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(d,c){var b=_.omit(this.model.changedAttributes(),"display_apps","display_types");if(_.keys(b).length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.$el.find("[title]").tooltip("destroy");this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find("[title]").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var b={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){b.enabled=false;b.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD){b.enabled=false;b.title=_l("This dataset must finish uploading before it can be viewed")}else{b.title=_l("View data");b.href=this.urls.display;var a=this;b.on_click=function(){Galaxy.frame_manager.frame_new({title:"Data Viewer",type:"url",location:"center",content:a.urls.display})}}}this.displayButton=new IconButtonView({model:new IconButton(b)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]}; \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/scripts/packed/utils/galaxy.uploadbox.js --- a/static/scripts/packed/utils/galaxy.uploadbox.js +++ b/static/scripts/packed/utils/galaxy.uploadbox.js @@ -1,1 +1,1 @@ -(function(d){jQuery.event.props.push("dataTransfer");var c={url:"",paramname:"content",maxfilesize:2048,data:{},dragover:function(){},dragleave:function(){},initialize:function(){},start:function(){},progress:function(){},success:function(){},error:function(f,g,h){alert(h)},error_browser:"Your browser does not support drag-and-drop file uploads.",error_filesize:"This file is too large. Please use an FTP client to upload it.",error_default:"The upload failed. Please make sure the file is available and accessible.",text_default:"Drag&drop files here or click to browse your local drive.",text_degrade:"Click here to browse your local drive. <br><br>Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."};var a=[];var b=-1;var e=false;d.fn.uploadbox=function(n){var f=d.extend({},c,n);var l=window.File&&window.FileReader&&window.FormData&&window.XMLHttpRequest;this.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');this.append('<div id="uploadbox_info"></div>');if(l){this.find("#uploadbox_info").html(f.text_default)}else{this.find("#uploadbox_info").html(f.text_degrade)}this.on("drop",i);this.on("dragover",j);this.on("dragleave",m);this.on("click",function(p){p.stopPropagation();d("#uploadbox_input").trigger(p)});d("#uploadbox_input").change(function(q){var p=q.target.files;o(p)});function i(q){if(!q.dataTransfer){return}var p=q.dataTransfer.files;o(p);q.preventDefault();return false}function j(p){p.preventDefault();f.dragover.call(this,p)}function m(p){p.stopPropagation();f.dragleave.call(this,p)}function g(p){if(p.lengthComputable){f.progress(this.index,this.file,Math.round((p.loaded*100)/p.total))}}function o(r){var q=a.length;for(var p=0;p<r.length;p++){a.push(r[p])}for(var p=q;p<a.length;p++){f.start(p,a[p],"")}if(!e){h()}}function h(){if(b+1==a.length){e=false;return}e=true;var s=++b;try{var q=new FileReader();var t=a[s];var r=t.size;var p=1048576*f.maxfilesize;q.index=s;if(r<p){q.onloadend=function(v){k(s,t)};q.onerror=function(v){f.error(s,t,f.error_default);e=false};q.readAsDataURL(t)}else{f.error(s,t,f.error_filesize);h()}}catch(u){f.error(s,t,u)}}function k(p,r){var s=new FormData();for(var q in f.data){s.append(q,f.data[q])}s.append(f.paramname,r,r.name);var t=new XMLHttpRequest();t.upload.index=p;t.upload.file=r;t.upload.addEventListener("progress",g,false);t.open("POST",f.url,true);t.setRequestHeader("Accept","application/json");t.setRequestHeader("Cache-Control","no-cache");t.setRequestHeader("X-Requested-With","XMLHttpRequest");t.send(s);t.onloadend=function(){var u=null;if(t.responseText){try{u=jQuery.parseJSON(t.responseText)}catch(v){u=t.responseText}}if(t.status<200||t.status>299){f.error(p,r,t.statusText+" (Server Code "+t.status+")");e=false}else{f.success(p,r,u);h()}}}return this}})(jQuery); \ No newline at end of file +(function(g){jQuery.event.props.push("dataTransfer");var c={url:"",paramname:"content",maxfilesize:250,dragover:function(){},dragleave:function(){},announce:function(){},initialize:function(){},progress:function(){},success:function(){},error:function(i,j,k){alert(k)},error_browser:"Your browser does not support drag-and-drop file uploads.",error_filesize:"This file is too large (>250MB). Please use an FTP client to upload it.",error_default:"Please make sure the file is available.",text_default:"Drag&drop files into this box or click 'Select' to select files!",text_degrade:"Unfortunately, your browser does not support multiple file uploads or drag&drop.<br>Please upgrade to i.e. Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+."};var f={};var a={};var b=0;var d=0;var h=false;var e=null;g.fn.uploadbox=function(i){f=g.extend({},c,i);var o=window.File&&window.FileReader&&window.FormData&&window.XMLHttpRequest;e=this;e.append('<input id="uploadbox_input" type="file" style="display: none" multiple>');e.append('<div id="uploadbox_info"></div>');if(o){e.find("#uploadbox_info").html(f.text_default)}else{e.find("#uploadbox_info").html(f.text_degrade)}e.on("drop",n);e.on("dragover",u);e.on("dragleave",t);g("#uploadbox_input").change(function(A){p(A.target.files)});function n(A){if(!A.dataTransfer){return}p(A.dataTransfer.files);A.preventDefault();return false}function u(A){A.preventDefault();f.dragover.call(A)}function t(A){A.stopPropagation();f.dragleave.call(A)}function k(A){if(A.lengthComputable){f.progress(this.index,this.file,Math.round((A.loaded*100)/A.total))}}function p(C){for(var B=0;B<C.length;B++){var A=String(++b);a[A]=C[B];d++;f.announce(A,a[A],"")}}function z(A){if(a[A]){delete a[A];d--}}function q(){var D=-1;for(var F in a){D=F;break}if(d==0){return}var E=a[D];z(D);var H=f.initialize(D,E,j);try{var B=new FileReader();var C=E.size;var A=1048576*f.maxfilesize;B.index=D;if(C<A){B.onload=function(I){l(D,E,H)};B.onerror=function(I){s(D,E,f.error_default)};B.readAsDataURL(E)}else{s(D,E,f.error_filesize)}}catch(G){s(D,E,G)}}function l(A,C,D){var E=new FormData();for(var B in D){E.append(B,D[B])}E.append(f.paramname,C,C.name);var F=new XMLHttpRequest();F.upload.index=A;F.upload.file=C;F.upload.addEventListener("progress",k,false);F.open("POST",f.url,true);F.setRequestHeader("Accept","application/json");F.setRequestHeader("Cache-Control","no-cache");F.setRequestHeader("X-Requested-With","XMLHttpRequest");F.send(E);F.onloadend=function(){var G=null;if(F.responseText){try{G=jQuery.parseJSON(F.responseText)}catch(H){G=F.responseText}}if(F.status<200||F.status>299){var I=F.statusText;if(!F.statusText){I=f.error_default}s(A,C,I+" (Server Code "+F.status+")")}else{m(A,C,G)}}}function m(A,B,C){f.success(A,B,C);q()}function s(A,B,C){f.error(A,B,C);q()}function r(){g("#uploadbox_input").trigger("click")}function x(A){for(A in a){z(A)}}function w(){if(!h){q()}}function j(){return d}function y(A){f=g.extend({},f,A);return f}function v(){return e.find("#uploadbox_info")}return{select:r,remove:z,upload:w,reset:x,length:j,configure:y,info:v}}})(jQuery); \ No newline at end of file diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1245,9 +1245,10 @@ .errormessage .alert-link,.warningmessage .alert-link,.donemessage .alert-link,.infomessage .alert-link,.errormessagesmall .alert-link,.warningmessagesmall .alert-link,.donemessagesmall .alert-link,.infomessagesmall .alert-link{font-weight:bold} .errormessage>p,.warningmessage>p,.donemessage>p,.infomessage>p,.errormessagesmall>p,.warningmessagesmall>p,.donemessagesmall>p,.infomessagesmall>p,.errormessage>ul,.warningmessage>ul,.donemessage>ul,.infomessage>ul,.errormessagesmall>ul,.warningmessagesmall>ul,.donemessagesmall>ul,.infomessagesmall>ul{margin-bottom:0} .errormessage>p+p,.warningmessage>p+p,.donemessage>p+p,.infomessage>p+p,.errormessagesmall>p+p,.warningmessagesmall>p+p,.donemessagesmall>p+p,.infomessagesmall>p+p{margin-top:5px} -.errormessage{background-color:#f9c7c5;border-color:#dd1c15;color:#7e2a27}.errormessage hr{border-top-color:#c61913} -.errormessage .alert-link{color:#571d1b} -.warningmessage,.warningmessagesmall{background-image:url(warn_small.png)} +.errormessage,.errormessagesmall{background-color:#f9c7c5;border-color:#dd1c15;color:#7e2a27}.errormessage hr,.errormessagesmall hr{border-top-color:#c61913} +.errormessage .alert-link,.errormessagesmall .alert-link{color:#571d1b} +.warningmessage,.warningmessagesmall{background-color:#fce1ba;border-color:#e28709;color:#80571e;background-image:url(warn_small.png)}.warningmessage hr,.warningmessagesmall hr{border-top-color:#c97908} +.warningmessage .alert-link,.warningmessagesmall .alert-link{color:#573b14} .donemessage,.donemessagesmall{background-color:#aff1af;border-color:#20b420;color:#295f29;background-image:url(ok_small.png)}.donemessage hr,.donemessagesmall hr{border-top-color:#1c9e1c} .donemessage .alert-link,.donemessagesmall .alert-link{color:#193b19} .infomessage,.infomessagesmall{background-color:#a6e4f7;border-color:#1197c0;color:#1f5566;background-image:url(info_small.png)}.infomessage hr,.infomessagesmall hr{border-top-color:#0f85a8} diff -r e70289bdc4144bd4f20ac5d76042570e1dff41cb -r 4ef6df129520040017cfd4a287cb01558c6af35f static/style/src/less/base.less --- a/static/style/src/less/base.less +++ b/static/style/src/less/base.less @@ -759,28 +759,23 @@ background-position: 5px 5px; } -.errormessage { +.errormessage, .errormessagesmall { .alert-danger(); } .warningmessage, .warningmessagesmall { + .alert-warning(); background-image: url(warn_small.png); - //border-color: @warn_message_border; - //background-color: @warn_message_bg; } .donemessage, .donemessagesmall { .alert-success(); background-image: url(ok_small.png); - // border-color: @done_message_border; - // background-color: @done_message_bg; } .infomessage, .infomessagesmall { .alert-info(); background-image: url(info_small.png); - //border-color: @info_message_border; - //background-color: @info_message_bg; } .errormark, .warningmark, .donemark, .infomark, .ok_bgr, .err_bgr { Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org