8

2

Right now, I have to send users to Fog Creek's documentation to study search axes. This is basically like asking them to use a command line tool. Can the search axes be more discoverable?

flag

1 Answer

3

This is untested in anything but Chrome, and offered without warranty. (It's also ugly.) If you find a bug, let me know via email at customer-service@fogcreek.com.

var search_axes = new Array('< refine search by axis >',
'AlsoEditedBy',
'Area',
'AssignedTo',
'Attachment',
'Category',
'Closed',
'ClosedBy',
'CommunityUser',
'Correspondent',
'CreatedBy',
'Due',
'Edited',
'EditedBy',
'ElapsedTime',
'EstimateCurrent',
'EstimateOriginal',
'From',
'LastEdited',
'LastEditedBy',
'LastViewed',
'Milestone',
'Occurrences',
'Opened',
'OpenedBy',
'Outline',
'Parent',
'Priority',
'Project',
'RelatedTo',
'ReleaseNotes',
'RemainingTime',
'Resolved',
'ResolvedBy',
'Show',
'StarredBy',
'Status',
'Tag',
'Title',
'To',
'ViewedBy'
);

var search_axis_explanations = new Array ('select a property',
'e.g., Sally Jones, Bob',
'',
'e.g., Sally Jones, Bob',
'e.g., picture.jpg',
'e.g., Bug, Feature',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'e.g., Sally Jones, Bob',
'e.g., Sally Jones, Bob',
'e.g.,bob@example.com',
'e.g., Sally Jones, Bob',
'e.g., today, yesterday, now..+4h, -1h..',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'e.g., Sally Jones, Bob',
'e.g., 3.5 hours, 40.., 1..3',
'e.g., 3.5 hours, 40.., 1..3',
'e.g., 3.5 hours, 40.., 1..3',
'e.g.,bob@example.com',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'e.g., Sally Jones, Bob',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'',
'e.g., 3, 1..4',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'e.g., Sally Jones, Bob',
'e.g., 24356 (a case number)',
'e.g., 24356 (a case number)',
'e.g., 3, 1..4',
'',
'e.g., 24356 (a case number)',
'',
'e.g., 3.5 hours, 40.., 1..3',
'e.g., yesterday, last week, -14d..-1d, -4h..now',
'e.g., Sally Jones, Bob',
'e.g., unread, read, subscribed, spam',
'e.g., me',
'e.g., open, closed, active, by design',
'',
'',
'e.g., bob@example.com',
'e.g., me');


$("#idFilterSearchAnchor").each(function(){

  $("<select id=idSearchHelp>").insertAfter($("#idFilterLinkPopTerm"))
  .css({ "margin-left": 6 ,"visibility" : "visible"})
  .bind('change',function(){
     $("#idSearchAxisExplanation").text(search_axis_explanations[this.selectedIndex]);
     $('#idAxisValue').focus();
   });


for ( var i=0, len=search_axes.length; i<len; ++i ){
  this_axis = search_axes[i];
  $('<option value=\'' + this_axis + '\'>').appendTo($('#idSearchHelp'))
  .text(this_axis);
}

  $('<input type=text id=idAxisValue>').insertAfter($('#idSearchHelp'))
  .css({'height':'12px'})
  .bind('keypress',function(event){ 
    if (event.keyCode == '13') {

      window.location = window.location.href + "+" + escape($('#idSearchHelp').val() + ":\"" + this.value + "\"");
    }
  });

  $("<span id=idSearchAxisExplanation>").insertAfter($('#idAxisValue'))
  .css ({'visibility' : 'visible', 'color':'gray','font-size':'11px'});


});
link|flag
2 
This is neat, but we should still have an official case to provide better built-in support. Auto-completion of search axes would be nice. – Samuel Neff Oct 2 2010 at 12:35
Yes. The point of this is to make clear the value of such an enhancement, not to serve as such. :) – Rich Armstrong Oct 4 2010 at 13:32
I realize this was offered without support. That said... correct me if I'm wrong, but it seems like this drop down only appears on the search results page which appears after a search has already been attempted. Is it possible to make this usable from the global search box which appears on every page? There's all that empty space next to it... – Jared Oct 14 2010 at 16:10
It's definitely possible. Give it a shot! – Rich Armstrong Oct 14 2010 at 16:53

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.