commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2891d0f88eff/ Changeset: 2891d0f88eff User: jgoecks Date: 2013-09-13 19:43:59 Summary: Use select2 rather than custom combobox for Trackster dbkey select. Affected #: 1 file diff -r 91352b6afa44a1cf29aa3963b6b30642e351e336 -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 static/scripts/viz/trackster.js --- a/static/scripts/viz/trackster.js +++ b/static/scripts/viz/trackster.js @@ -13,7 +13,7 @@ 'libs/jquery/jquery.event.hover', 'libs/jquery/jquery.mousewheel', 'libs/jquery/jquery-ui', - 'libs/jquery/jquery-ui-combobox', + 'libs/jquery/select2', 'libs/farbtastic', 'libs/jquery/jquery.form', 'libs/jquery/jquery.rating', @@ -127,11 +127,7 @@ // change focus $("#new-title").focus(); - $("select[name='dbkey']").combobox( - { - appendTo: $("#overlay"), - size: 40 - }); + $("select[name='dbkey']").select2(); // to support the large number of options for dbkey, enable scrolling in overlay. $("#overlay").css("overflow", "auto"); https://bitbucket.org/galaxy/galaxy-central/commits/a598d4d47dce/ Changeset: a598d4d47dce User: jgoecks Date: 2013-09-13 19:49:39 Summary: Remove custom combobox (search + select) code because it has been replaced with select2. Pack scripts. Affected #: 5 files diff -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 -r a598d4d47dce07864f5211f9c8f7847ab39bce75 static/scripts/libs/jquery/jquery-ui-combobox.js --- a/static/scripts/libs/jquery/jquery-ui-combobox.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * A generic search + select combobox based on jQueryUI button and autocomplete. - * Code is derived from http://jqueryui.com/autocomplete/ - * - * Options: - * appendTo - element to attach autocomplete options to; default is <body> - * size - text input's size; default is 20 - */ - -(function( $ ) { - $.widget( "ui.combobox", { - _create: function() { - var input, - that = this, - select = this.element.hide(), - selected = select.children( ":selected" ), - value = selected.val() ? selected.text() : "", - wrapper = this.wrapper = $( "<span>" ) - .addClass( "ui-combobox" ) - .insertAfter( select ); - - function removeIfInvalid(element) { - var value = $( element ).val(), - matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( value ) + "$", "i" ), - valid = false; - select.children( "option" ).each(function() { - if ( $( this ).text().match( matcher ) ) { - this.selected = valid = true; - return false; - } - }); - if ( !valid ) { - // remove invalid value, as it didn't match anything - $( element ) - .val( "" ) - .attr( "title", value + " didn't match any item" ) - .tooltip( "open" ); - select.val( "" ); - setTimeout(function() { - input.tooltip( "close" ).attr( "title", "" ); - }, 2500 ); - input.data( "autocomplete" ).term = ""; - return false; - } - } - - var size = ( this.options.size ? this.options.size : 20 ); - input = $( "<input>" ) - .appendTo( wrapper ) - .val( value ) - .click( function() { - this.select(); - }) - .attr( "title", "" ) - .attr( "size", size ) - .addClass( "ui-state-default ui-combobox-input" ) - .autocomplete({ - appendTo: this.options.appendTo, - delay: 0, - minLength: 0, - source: function( request, response ) { - var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); - response( select.children( "option" ).map(function() { - var text = $( this ).text(); - if ( this.value && ( !request.term || matcher.test(text) ) ) - return { - label: text.replace( - new RegExp( - "(?![^&;]+;)(?!<[^<>]*)(" + - $.ui.autocomplete.escapeRegex(request.term) + - ")(?![^<>]*>)(?![^&;]+;)", "gi" - ), "<strong>$1</strong>" ), - value: text, - option: this - }; - }) ); - }, - select: function( event, ui ) { - ui.item.option.selected = true; - that._trigger( "selected", event, { - item: ui.item.option - }); - }, - change: function( event, ui ) { - if ( !ui.item ) - return removeIfInvalid( this ); - } - }) - .addClass( "ui-widget ui-widget-content ui-corner-left" ); - - input.data( "autocomplete" )._renderItem = function( ul, item ) { - return $( "<li>" ) - .data( "item.autocomplete", item ) - .append( "<a>" + item.label + "</a>" ) - .appendTo( ul ); - }; - - $( "<a>" ) - .attr( "tabIndex", -1 ) - .attr( "title", "Show All Items" ) - .tooltip() - .appendTo( wrapper ) - .button({ - icons: { - primary: "ui-icon-triangle-1-s" - }, - text: false - }) - .removeClass( "ui-corner-all" ) - .addClass( "ui-corner-right ui-combobox-toggle" ) - .click(function() { - // close if already visible - if ( input.autocomplete( "widget" ).is( ":visible" ) ) { - input.autocomplete( "close" ); - removeIfInvalid( input ); - return; - } - - // work around a bug (likely same cause as #5265) - $( this ).blur(); - - // pass empty string as value to search for, displaying all results - input.autocomplete( "search", "" ); - input.focus(); - }); - - input - .tooltip({ - position: { - of: this.button - }, - tooltipClass: "ui-state-highlight" - }); - }, - - destroy: function() { - this.wrapper.remove(); - this.element.show(); - $.Widget.prototype.destroy.call( this ); - } - }); -})( jQuery ); \ No newline at end of file diff -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 -r a598d4d47dce07864f5211f9c8f7847ab39bce75 static/scripts/packed/galaxy.frame.js --- a/static/scripts/packed/galaxy.frame.js +++ b/static/scripts/packed/galaxy.frame.js @@ -1,1 +1,1 @@ -define(["utils/galaxy.css","galaxy.master","libs/backbone/backbone-relational"],function(b,c){var a=Backbone.View.extend({el_main:"#everything",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(e){var d=this;this.button_active=new c.GalaxyMasterIcon({icon:"fa-icon-th",tooltip:"Enable/Disable Scratchbook",on_click:function(g){d.event_panel_active(g)}});Galaxy.master.append(this.button_active);this.button_load=new c.GalaxyMasterIcon({icon:"fa-icon-eye-open",tooltip:"Show/Hide Scratchbook",on_click:function(g){d.event_panel_load(g)},with_number:true});Galaxy.master.append(this.button_load);b.load_file("static/style/galaxy.frame.css");if(e){this.options=_.defaults(e,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_main).append($(this.el));var f="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(f.substring(1)));this.galaxy_frame_shadow={id:f,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[f]=this.galaxy_frame_shadow;this.panel_refresh();var d=this;$(window).resize(function(){if(d.visible){d.panel_refresh()}});window.onbeforeunload=function(){if(d.frame_counter>0){return"You opened "+d.frame_counter+" frame(s) which will be lost."}}},event:{type:null,target:null,xy:null},events:{mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame":"event_frame_mouse_down","mousedown .galaxy-frame-background":"event_panel_load","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"},event_frame_mouse_down:function(d){if(this.event.type!==null){return}if($(d.target).hasClass("f-header")||$(d.target).hasClass("f-title")){this.event.type="drag"}if($(d.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}d.preventDefault();this.event.target=this.event_get_frame(d.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:d.originalEvent.pageX,y:d.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(j){if(this.event.type!="drag"&&this.event.type!="resize"){return}var h={x:j.originalEvent.pageX,y:j.originalEvent.pageY};var f={x:h.x-this.event.xy.x,y:h.y-this.event.xy.y};this.event.xy=h;var i=this.frame_screen(this.event.target);if(this.event.type=="resize"){i.width+=f.x;i.height+=f.y;var g=this.options.cell-this.options.margin-1;i.width=Math.max(i.width,g);i.height=Math.max(i.height,g);this.frame_resize(this.event.target,i);i.width=this.to_grid_coord("width",i.width)+1;i.height=this.to_grid_coord("height",i.height)+1;i.width=this.to_pixel_coord("width",i.width);i.height=this.to_pixel_coord("height",i.height);this.frame_resize(this.galaxy_frame_shadow,i);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",i.top),left:this.to_grid_coord("left",i.left)})}if(this.event.type=="drag"){i.left+=f.x;i.top+=f.y;this.frame_offset(this.event.target,i);var d={top:this.to_grid_coord("top",i.top),left:this.to_grid_coord("left",i.left)};if(d.left!==0){d.left++}this.frame_insert(this.galaxy_frame_shadow,d)}},event_frame_mouse_up:function(d){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(f){if(this.event.type!==null){return}f.preventDefault();var g=this.event_get_frame(f.target);var d=this;$(g.id).fadeOut("fast",function(){$(g.id).remove();delete d.frame_list[g.id];d.frame_counter--;d.panel_refresh(true);d.panel_animation_complete();if(d.visible&&d.frame_counter==0){d.panel_show_hide()}})},event_frame_lock:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);if(f.grid_lock){f.grid_lock=false;$(f.id).find(".f-pin").removeClass("galaxy-toggle");$(f.id).find(".f-header").removeClass("f-not-allowed");$(f.id).find(".f-title").removeClass("f-not-allowed");$(f.id).find(".f-resize").show();$(f.id).find(".f-close").show()}else{f.grid_lock=true;$(f.id).find(".f-pin").addClass("galaxy-toggle");$(f.id).find(".f-header").addClass("f-not-allowed");$(f.id).find(".f-title").addClass("f-not-allowed");$(f.id).find(".f-resize").hide();$(f.id).find(".f-close").hide()}},event_panel_load:function(d){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(d){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(d){if(this.event.type!==null||!this.visible){return}d.preventDefault();var f=d.originalEvent.detail?d.originalEvent.detail:d.originalEvent.wheelDelta/-3;this.panel_scroll(f)},event_panel_scroll_up:function(d){if(this.event.type!==null){return}d.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(d){if(this.event.type!==null){return}d.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(d){return this.frame_list["#"+$(d).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(e){this.frame_focus(e,true);var d=this.frame_screen(e);this.frame_resize(this.galaxy_frame_shadow,d);this.frame_grid(this.galaxy_frame_shadow,e.grid_location);e.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(e){this.frame_focus(e,false);var d=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(e,d);this.frame_grid(e,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(f,e){var d=(f=="width"||f=="height")?1:-1;if(f=="top"){e-=this.top}return parseInt((e+d*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(f,h){var d=(f=="width"||f=="height")?1:-1;var e=(h*this.options.cell)-d*this.options.margin;if(f=="top"){e+=this.top}return e},to_grid:function(d){return{top:this.to_grid_coord("top",d.top),left:this.to_grid_coord("left",d.left),width:this.to_grid_coord("width",d.width),height:this.to_grid_coord("height",d.height)}},to_pixel:function(d){return{top:this.to_pixel_coord("top",d.top),left:this.to_pixel_coord("left",d.left),width:this.to_pixel_coord("width",d.width),height:this.to_pixel_coord("height",d.height)}},is_collision:function(f){function d(i,g){return !(i.left>g.left+g.width-1||i.left+i.width-1<g.left||i.top>g.top+g.height-1||i.top+i.height-1<g.top)}for(var e in this.frame_list){var h=this.frame_list[e];if(h.grid_location===null){continue}if(d(f,h.grid_location)){return true}}return false},location_rank:function(d){return(d.top*this.cols)+d.left},menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var d=this;$(".galaxy-frame").promise().done(function(){d.panel_scroll(0,true)})},panel_refresh:function(d){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,d)},panel_scroll:function(j,d){var f=this.top-this.options.scroll*j;f=Math.max(f,this.top_max);f=Math.min(f,this.options.top_min);if(this.top!=f){for(var e in this.frame_list){var h=this.frame_list[e];if(h.grid_location!==null){var g={top:h.screen_location.top-(this.top-f),left:h.screen_location.left};this.frame_offset(h,g,d)}}this.top=f}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;$(".galaxy-frame").fadeOut("fast");this.button_load.icon("fa-icon-eye-close");this.button_load.untoggle();$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;$(".galaxy-frame").fadeIn("fast");this.button_load.icon("fa-icon-eye-open");this.button_load.toggle();$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.panel_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this.panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},frame_new:function(e){if(!this.active){if(e.location=="center"){var d=$(window.parent.document).find("iframe#galaxy_main");d.attr("src",e.content)}else{window.location=e.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var f="#galaxy-frame-"+(this.frame_counter_id++);if($(f).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this.frame_template(f.substring(1),e.title,e.type,e.content));var g={id:f,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};e.width=this.to_pixel_coord("width",this.options.frame.cols);e.height=this.to_pixel_coord("height",this.options.frame.rows);this.frame_list[f]=g;this.frame_counter++;this.frame_resize(g,{width:e.width,height:e.height});this.frame_insert(g,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}},frame_insert:function(k,d,g){var e=[];if(k){k.grid_location=null;e.push([k,this.location_rank(d)])}var h=null;for(h in this.frame_list){var j=this.frame_list[h];if(j.grid_location!==null&&!j.grid_lock){j.grid_location=null;e.push([j,j.grid_rank])}}e.sort(function(l,f){var n=l[1];var m=f[1];return n<m?-1:(n>m?1:0)});for(h=0;h<e.length;h++){this.frame_place(e[h][0],g)}this.top_max=0;for(var h in this.frame_list){var k=this.frame_list[h];if(k.grid_location!==null){this.top_max=Math.max(this.top_max,k.grid_location.top+k.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(l,e){l.grid_location=null;var k=this.to_grid(this.frame_screen(l));var d=false;for(var h=0;h<this.options.rows;h++){for(var f=0;f<Math.max(1,this.cols-k.width);f++){k.top=h;k.left=f;if(!this.is_collision(k)){d=true;break}}if(d){break}}if(d){this.frame_grid(l,k,e)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(f,d){var e=parseInt(b.get_attribute("galaxy-frame","z-index"))+(d?1:0);$(f.id).css("z-index",e)},frame_offset:function(g,f,e){g.screen_location.left=f.left;g.screen_location.top=f.top;if(e){this.frame_focus(g,true);var d=this;$(g.id).animate({top:f.top,left:f.left},"fast",function(){d.frame_focus(g,false)})}else{$(g.id).css({top:f.top,left:f.left})}},frame_resize:function(e,d){$(e.id).css({width:d.width,height:d.height});e.screen_location.width=d.width;e.screen_location.height=d.height},frame_grid:function(f,d,e){f.grid_location=d;this.frame_offset(f,this.to_pixel(d),e);f.grid_rank=this.location_rank(d)},frame_screen:function(e){var d=e.screen_location;return{top:d.top,left:d.left,width:d.width,height:d.height}},frame_template:function(g,f,d,e){if(!f){f=""}if(d=="url"){e='<iframe scrolling="auto" class="f-iframe" src="'+e+'"></iframe>'}return'<div id="'+g+'" class="galaxy-frame galaxy-corner"><div class="f-header galaxy-corner"><span class="f-title">'+f+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content galaxy-corner">'+e+'<div class="f-cover"></div></div><span class="f-resize f-icon galaxy-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(d){return'<div id="'+d+'" class="galaxy-frame-shadow galaxy-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_header:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}}); \ No newline at end of file +define(["galaxy.master","libs/backbone/backbone-relational"],function(b){var a=Backbone.View.extend({el_main:"#everything",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:false,active:false,button_active:null,button_load:null,initialize:function(d){var c=this;this.button_active=new b.GalaxyMasterIcon({icon:"fa-icon-th",tooltip:"Enable/Disable Scratchbook",on_click:function(f){c.event_panel_active(f)}});Galaxy.master.append(this.button_active);this.button_load=new b.GalaxyMasterIcon({icon:"fa-icon-eye-open",tooltip:"Show/Hide Scratchbook",on_click:function(f){c.event_panel_load(f)},with_number:true});Galaxy.master.append(this.button_load);if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;this.setElement(this.template());$(this.el).append(this.template_background());$(this.el).append(this.template_menu());$(this.el_main).append($(this.el));var e="#frame-shadow";$(this.el).append(this.template_shadow(e.substring(1)));this.frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[e]=this.frame_shadow;this.panel_refresh();var c=this;$(window).resize(function(){if(c.visible){c.panel_refresh()}});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},event:{type:null,target:null,xy:null},events:{mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .frame":"event_frame_mouse_down","mousedown .frame-background":"event_panel_load","mousedown .frame-scroll-up":"event_panel_scroll_up","mousedown .frame-scroll-down":"event_panel_scroll_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock"},event_frame_mouse_down:function(c){if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}c.preventDefault();this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.frame_shadow,h);this.frame_insert(this.frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}d.preventDefault();var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(c){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(c){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(c){if(this.event.type!==null||!this.visible){return}c.preventDefault();var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(c){if(this.event.type!==null){return}c.preventDefault();this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.frame_shadow,c);this.frame_grid(this.frame_shadow,d.grid_location);d.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){this.button_load.number(this.frame_counter);if(this.frame_counter==0){this.button_load.hide()}else{this.button_load.show()}if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;$(".frame").fadeOut("fast");this.button_load.icon("fa-icon-eye-close");this.button_load.untoggle();$(".frame-background").hide();$(".frame-menu").hide()}else{this.visible=true;$(".frame").fadeIn("fast");this.button_load.icon("fa-icon-eye-open");this.button_load.toggle();$(this.frame_shadow.id).hide();$(".frame-background").show();this.panel_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;this.button_active.untoggle();if(this.visible){this.panel_show_hide()}}else{this.active=true;this.button_active.toggle()}},frame_new:function(d){if(!this.active){if(d.location=="center"){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var e="#frame-"+(this.frame_counter_id++);if($(e).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;$(this.el).append(this.template_frame(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(f.id).css("z-index"));this.frame_list[e]=f;this.frame_counter++;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=this.frame_z+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},template:function(){return'<div class="galaxy-frame"></div>'},template_frame:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon corner fa-icon-resize-full"></span></div>'},template_shadow:function(c){return'<div id="'+c+'" class="frame-shadow corner"></div>'},template_background:function(){return'<div class="frame-background"></div>'},template_menu:function(){return'<div class="frame-scroll-up frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="frame-scroll-down frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}}); \ No newline at end of file diff -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 -r a598d4d47dce07864f5211f9c8f7847ab39bce75 static/scripts/packed/libs/jquery/jquery-ui-combobox.js --- a/static/scripts/packed/libs/jquery/jquery-ui-combobox.js +++ /dev/null @@ -1,1 +0,0 @@ -(function(a){a.widget("ui.combobox",{_create:function(){var c,g=this,b=this.element.hide(),f=b.children(":selected"),h=f.val()?f.text():"",i=this.wrapper=a("<span>").addClass("ui-combobox").insertAfter(b);function e(j){var l=a(j).val(),m=new RegExp("^"+a.ui.autocomplete.escapeRegex(l)+"$","i"),k=false;b.children("option").each(function(){if(a(this).text().match(m)){this.selected=k=true;return false}});if(!k){a(j).val("").attr("title",l+" didn't match any item").tooltip("open");b.val("");setTimeout(function(){c.tooltip("close").attr("title","")},2500);c.data("autocomplete").term="";return false}}var d=(this.options.size?this.options.size:20);c=a("<input>").appendTo(i).val(h).click(function(){this.select()}).attr("title","").attr("size",d).addClass("ui-state-default ui-combobox-input").autocomplete({appendTo:this.options.appendTo,delay:0,minLength:0,source:function(k,j){var l=new RegExp(a.ui.autocomplete.escapeRegex(k.term),"i");j(b.children("option").map(function(){var m=a(this).text();if(this.value&&(!k.term||l.test(m))){return{label:m.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+a.ui.autocomplete.escapeRegex(k.term)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:m,option:this}}}))},select:function(j,k){k.item.option.selected=true;g._trigger("selected",j,{item:k.item.option})},change:function(j,k){if(!k.item){return e(this)}}}).addClass("ui-widget ui-widget-content ui-corner-left");c.data("autocomplete")._renderItem=function(j,k){return a("<li>").data("item.autocomplete",k).append("<a>"+k.label+"</a>").appendTo(j)};a("<a>").attr("tabIndex",-1).attr("title","Show All Items").tooltip().appendTo(i).button({icons:{primary:"ui-icon-triangle-1-s"},text:false}).removeClass("ui-corner-all").addClass("ui-corner-right ui-combobox-toggle").click(function(){if(c.autocomplete("widget").is(":visible")){c.autocomplete("close");e(c);return}a(this).blur();c.autocomplete("search","");c.focus()});c.tooltip({position:{of:this.button},tooltipClass:"ui-state-highlight"})},destroy:function(){this.wrapper.remove();this.element.show();a.Widget.prototype.destroy.call(this)}})})(jQuery); \ No newline at end of file diff -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 -r a598d4d47dce07864f5211f9c8f7847ab39bce75 static/scripts/packed/viz/trackster.js --- a/static/scripts/packed/viz/trackster.js +++ b/static/scripts/packed/viz/trackster.js @@ -1,1 +1,1 @@ -var ui=null;var view=null;var browser_router=null;require(["utils/galaxy.css","libs/jquery/jstorage","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/jquery-ui-combobox","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating","mvc/ui"],function(a){a.load_file("static/style/jquery.rating.css");a.load_file("static/style/autocomplete_tagging.css");a.load_file("static/style/jquery-ui/smoothness/jquery-ui.css");a.load_file("static/style/library.css");a.load_file("static/style/trackster.css")});define(["libs/backbone/backbone-relational","viz/visualization","viz/trackster_ui"],function(c,a,b){var d=Backbone.View.extend({initialize:function(){ui=new b.TracksterUI(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},set_up_router:function(e){browser_router=new a.TrackBrowserRouter(e);Backbone.history.start()},view_existing:function(){var e=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:e.title,vis_id:e.vis_id,dbkey:e.dbkey},e.viewport,e.tracks,e.bookmarks,true);this.init_editor()},view_new:function(){var e=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(f){show_modal("New Visualization",e.template_view_new(f),{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){e.create_browser($("#new-title").val(),$("#new-dbkey").val())}});if(galaxy_config.app.default_dbkey){$("#new-dbkey option[value='"+galaxy_config.app.default_dbkey+"']").attr("selected",true)}$("#new-title").focus();$("select[name='dbkey']").combobox({appendTo:$("#overlay"),size:40});$("#overlay").css("overflow","auto")}})},template_view_new:function(e){var g='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var f in e){g+='<option value="'+e[f][1]+'">'+e[f][0]+"</option>"}g+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return g},create_browser:function(f,e){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:f,dbkey:e},galaxy_config.app.gene_region);this.init_editor();view.editor=true;hide_modal()},init_editor:function(){$("#center .unified-panel-title").text(view.name+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(e){view.add_drawable(b.object_from_template(e,view,view))}})}$("#add-bookmark-button").click(function(){var f=view.chrom+":"+view.low+"-"+view.high,e="Bookmark description";return ui.add_bookmark(f,e,true)});ui.init_keyboard_nav(view);this.set_up_router({view:view})}});return{GalaxyApp:d}}); \ No newline at end of file +var ui=null;var view=null;var browser_router=null;require(["utils/galaxy.css","libs/jquery/jstorage","libs/jquery/jquery.event.drag","libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel","libs/jquery/jquery-ui","libs/jquery/select2","libs/farbtastic","libs/jquery/jquery.form","libs/jquery/jquery.rating","mvc/ui"],function(a){a.load_file("static/style/jquery.rating.css");a.load_file("static/style/autocomplete_tagging.css");a.load_file("static/style/jquery-ui/smoothness/jquery-ui.css");a.load_file("static/style/library.css");a.load_file("static/style/trackster.css")});define(["libs/backbone/backbone-relational","viz/visualization","viz/trackster_ui"],function(c,a,b){var d=Backbone.View.extend({initialize:function(){ui=new b.TracksterUI(galaxy_config.root);ui.createButtonMenu();ui.buttonMenu.$el.attr("style","float: right");$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);$("#right .unified-panel-title").append("Bookmarks");$("#right .unified-panel-icons").append("<a id='add-bookmark-button' class='icon-button menu-button plus-button' href='javascript:void(0);' title='Add bookmark'></a>");$("#right-border").click(function(){view.resize_window()});force_right_panel("hide");if(galaxy_config.app.id){this.view_existing()}else{this.view_new()}},set_up_router:function(e){browser_router=new a.TrackBrowserRouter(e);Backbone.history.start()},view_existing:function(){var e=galaxy_config.app.viz_config;view=ui.create_visualization({container:$("#center .unified-panel-body"),name:e.title,vis_id:e.vis_id,dbkey:e.dbkey},e.viewport,e.tracks,e.bookmarks,true);this.init_editor()},view_new:function(){var e=this;$.ajax({url:galaxy_config.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(f){show_modal("New Visualization",e.template_view_new(f),{Cancel:function(){window.location=galaxy_config.root+"visualization/list"},Create:function(){e.create_browser($("#new-title").val(),$("#new-dbkey").val())}});if(galaxy_config.app.default_dbkey){$("#new-dbkey option[value='"+galaxy_config.app.default_dbkey+"']").attr("selected",true)}$("#new-title").focus();$("select[name='dbkey']").select2();$("#overlay").css("overflow","auto")}})},template_view_new:function(e){var g='<form id="new-browser-form" action="javascript:void(0);" method="post" onsubmit="return false;"><div class="form-row"><label for="new-title">Browser name:</label><div class="form-row-input"><input type="text" name="title" id="new-title" value="Unnamed"></input></div><div style="clear: both;"></div></div><div class="form-row"><label for="new-dbkey">Reference genome build (dbkey): </label><div class="form-row-input"><select name="dbkey" id="new-dbkey">';for(var f in e){g+='<option value="'+e[f][1]+'">'+e[f][0]+"</option>"}g+='</select></div><div style="clear: both;"></div></div><div class="form-row">Is the build not listed here? <a href="'+galaxy_config.root+'user/dbkeys?use_panels=True">Add a Custom Build</a></div></form>';return g},create_browser:function(f,e){$(document).trigger("convert_to_values");view=ui.create_visualization({container:$("#center .unified-panel-body"),name:f,dbkey:e},galaxy_config.app.gene_region);this.init_editor();view.editor=true;hide_modal()},init_editor:function(){$("#center .unified-panel-title").text(view.name+" ("+view.dbkey+")");if(galaxy_config.app.add_dataset){$.ajax({url:galaxy_config.root+"api/datasets/"+galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(e){view.add_drawable(b.object_from_template(e,view,view))}})}$("#add-bookmark-button").click(function(){var f=view.chrom+":"+view.low+"-"+view.high,e="Bookmark description";return ui.add_bookmark(f,e,true)});ui.init_keyboard_nav(view);this.set_up_router({view:view})}});return{GalaxyApp:d}}); \ No newline at end of file diff -r 2891d0f88eff34d6dabcbcfbfb056c60a5471007 -r a598d4d47dce07864f5211f9c8f7847ab39bce75 templates/display_base.mako --- a/templates/display_base.mako +++ b/templates/display_base.mako @@ -35,8 +35,7 @@ ${h.js( "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating", "galaxy.autocom_tagging" )} - ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui", "libs/jquery/jquery-ui-combobox", - "libs/require", "libs/farbtastic" )} + ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui", "libs/require", "libs/farbtastic" )} <script type="text/javascript"> 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