3 new changesets in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/3504e971d8b8/ changeset: r5384:3504e971d8b8 user: Martijn Vermaat date: 2011-04-14 12:14:30 summary: Adds filtering to input selection on run workflow page. affected #: 2 files (2.3 KB) --- a/static/june_2007_style/blue/base.css Thu Apr 14 01:13:10 2011 +0200 +++ b/static/june_2007_style/blue/base.css Thu Apr 14 12:14:30 2011 +0200 @@ -172,4 +172,4 @@ .text-and-autocomplete-select{background:url(fugue.png) no-repeat right -364px;} .icon-button.multiinput{background:url(../images/documents-stack.png) no-repeat;cursor:pointer;float:none;display:inline-block;margin-left:10px;} .icon-button.multiinput.disabled{background:url(../images/documents-stack-faded.png) no-repeat;cursor:auto;} -.workflow-invocation-complete{border:solid 1px #6A6;border-left-width:5px;margin:10px 0;} +.workflow-invocation-complete{border:solid 1px #6A6;border-left-width:5px;margin:10px 0;padding-left:5px;} --- a/templates/workflow/run.mako Thu Apr 14 01:13:10 2011 +0200 +++ b/templates/workflow/run.mako Thu Apr 14 12:14:30 2011 +0200 @@ -21,6 +21,7 @@ } } function toggle_multiinput(select) { + var placeholder; if (select.attr('multiple')) { $('.multiinput').removeClass('disabled'); if (select.val()) { @@ -28,12 +29,16 @@ } else { select.val($('option:last', select).val()); } - select.removeAttr('multiple'); + select.removeAttr('multiple').removeAttr('size'); + placeholder = 'type to filter'; } else { $('.multiinput').addClass('disabled'); $('.multiinput', select.parent().prev()).removeClass('disabled'); - select.attr('multiple', 'multiple'); + select.attr('multiple', 'multiple').attr('size', 8); + placeholder = 'type to filter, [enter] to select all'; } + $('input.multiinput-filter', select.parent()).attr( + 'placeholder', placeholder); } $( "select[refresh_on_change='true']").change( function() { $( "#tool_form" ).submit(); @@ -58,6 +63,7 @@ }); $('select[name*="|input"]').removeAttr('multiple').each(function(i, s) { var select = $(s); + var new_width = select.width() + 20; select.parent().prev().append( $('<span class="icon-button multiinput"></span>').click(function() { if ($(this).hasClass('disabled')) return; @@ -68,6 +74,44 @@ 'files. Each selected file will have an ' + 'instance of the workflow.').tipsy({gravity:'s'}) ); + var filter = $('<input type="text" class="multiinput-filter" ' + + 'placeholder="type to filter">'); + var filter_timeout = false; + var original_rows = select.find('option'); + var previous_filter = ''; + // Todo: might have to choose keypress, depending on browser + filter.keydown(function(e) { + var filter_select = function() { + var f = $.trim(filter.val()); + var filtered_rows = original_rows; + if (f.length >= 1) { + filtered_rows = original_rows.filter(function() { + return new RegExp(f, 'ig').test($(this).text()); + }); + } + select.html(''); + select.html(filtered_rows); + }; + if (e.which == 13) { // 13 = enter key + e.preventDefault(); + multi = select.attr('multiple'); + if (typeof multi !== 'undefined' && multi !== false) { + if (!select.find('option:not(:selected)').length) { + select.find('option').removeAttr('selected'); + } else { + select.find('option').attr('selected', 'selected'); + } + } + return; + } + if (filter.val() != previous_filter) { + if (filter_timeout) clearTimeout(filter_timeout); + timeout = setTimeout(filter_select, 300); + previous_filter = filter.val(); + } + }).width(new_width).css('display', 'block'); + select.after(filter); + select.width(new_width); }); }); </script> http://bitbucket.org/galaxy/galaxy-central/changeset/d6fda5e30200/ changeset: r5385:d6fda5e30200 user: Martijn Vermaat date: 2011-04-14 14:23:28 summary: Give input selection and filtering a minimum width (run tool form). affected #: 1 file (15 bytes) --- a/templates/workflow/run.mako Thu Apr 14 12:14:30 2011 +0200 +++ b/templates/workflow/run.mako Thu Apr 14 14:23:28 2011 +0200 @@ -63,7 +63,7 @@ }); $('select[name*="|input"]').removeAttr('multiple').each(function(i, s) { var select = $(s); - var new_width = select.width() + 20; + var new_width = Math.max(200, select.width()) + 20; select.parent().prev().append( $('<span class="icon-button multiinput"></span>').click(function() { if ($(this).hasClass('disabled')) return; http://bitbucket.org/galaxy/galaxy-central/changeset/67a19816034b/ changeset: r5386:67a19816034b user: dannon date: 2011-04-14 15:02:20 summary: Merge! affected #: 2 files (2.3 KB) --- a/static/june_2007_style/blue/base.css Thu Apr 14 08:09:48 2011 -0400 +++ b/static/june_2007_style/blue/base.css Thu Apr 14 09:02:20 2011 -0400 @@ -172,4 +172,4 @@ .text-and-autocomplete-select{background:url(fugue.png) no-repeat right -364px;} .icon-button.multiinput{background:url(../images/documents-stack.png) no-repeat;cursor:pointer;float:none;display:inline-block;margin-left:10px;} .icon-button.multiinput.disabled{background:url(../images/documents-stack-faded.png) no-repeat;cursor:auto;} -.workflow-invocation-complete{border:solid 1px #6A6;border-left-width:5px;margin:10px 0;} +.workflow-invocation-complete{border:solid 1px #6A6;border-left-width:5px;margin:10px 0;padding-left:5px;} --- a/templates/workflow/run.mako Thu Apr 14 08:09:48 2011 -0400 +++ b/templates/workflow/run.mako Thu Apr 14 09:02:20 2011 -0400 @@ -21,6 +21,7 @@ } } function toggle_multiinput(select) { + var placeholder; if (select.attr('multiple')) { $('.multiinput').removeClass('disabled'); if (select.val()) { @@ -28,12 +29,16 @@ } else { select.val($('option:last', select).val()); } - select.removeAttr('multiple'); + select.removeAttr('multiple').removeAttr('size'); + placeholder = 'type to filter'; } else { $('.multiinput').addClass('disabled'); $('.multiinput', select.parent().prev()).removeClass('disabled'); - select.attr('multiple', 'multiple'); + select.attr('multiple', 'multiple').attr('size', 8); + placeholder = 'type to filter, [enter] to select all'; } + $('input.multiinput-filter', select.parent()).attr( + 'placeholder', placeholder); } $( "select[refresh_on_change='true']").change( function() { $( "#tool_form" ).submit(); @@ -58,6 +63,7 @@ }); $('select[name*="|input"]').removeAttr('multiple').each(function(i, s) { var select = $(s); + var new_width = Math.max(200, select.width()) + 20; select.parent().prev().append( $('<span class="icon-button multiinput"></span>').click(function() { if ($(this).hasClass('disabled')) return; @@ -68,6 +74,44 @@ 'files. Each selected file will have an ' + 'instance of the workflow.').tipsy({gravity:'s'}) ); + var filter = $('<input type="text" class="multiinput-filter" ' + + 'placeholder="type to filter">'); + var filter_timeout = false; + var original_rows = select.find('option'); + var previous_filter = ''; + // Todo: might have to choose keypress, depending on browser + filter.keydown(function(e) { + var filter_select = function() { + var f = $.trim(filter.val()); + var filtered_rows = original_rows; + if (f.length >= 1) { + filtered_rows = original_rows.filter(function() { + return new RegExp(f, 'ig').test($(this).text()); + }); + } + select.html(''); + select.html(filtered_rows); + }; + if (e.which == 13) { // 13 = enter key + e.preventDefault(); + multi = select.attr('multiple'); + if (typeof multi !== 'undefined' && multi !== false) { + if (!select.find('option:not(:selected)').length) { + select.find('option').removeAttr('selected'); + } else { + select.find('option').attr('selected', 'selected'); + } + } + return; + } + if (filter.val() != previous_filter) { + if (filter_timeout) clearTimeout(filter_timeout); + timeout = setTimeout(filter_select, 300); + previous_filter = filter.val(); + } + }).width(new_width).css('display', 'block'); + select.after(filter); + select.width(new_width); }); }); </script> 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.