So if we look at the top of the files used to do the searches
(search/story.html, media.html, etc) we see
my $advanced_search = $state->{advanced_search};
$advanced_search = get_pref('Default Search')
unless defined $advanced_search;
my $initial_search_type = 'simple';
$initial_search_type = 'advanced' if $advanced_search;
So whether or not we use advanced search depends entirely on what the
state data says about advanced search, and then if that is not defined
we go to defaults.
This wouldn't be a problem except if we look at what happens in the
onclick of "Show more options", the state data never gets updated, and
if the default search is simple, the fact that we used advanced search
never gets stored on an empty advanced search.
My question is, how do I update the state data within the onclick of
that link? Here is the current onclick code (from search/story.html,
but I believe it is uniform throughout all the search files):
<a href="#" class="small" style="margin-left: 10px;"
onclick="$('search_title').value = $('search_simple').value;
$('search-button').name = 'advanced_search';
$('search-button').onclick = $('search-type').value = 'advanced';
$('basic-search', 'advanced-search', 'clear-button').invoke('toggle');
$('button-wrap').setStyle({margin: '0 0 0 0'}); return false">Show
more options »</a>
Thanks,
Sarah Mercier
(search/story.html, media.html, etc) we see
my $advanced_search = $state->{advanced_search};
$advanced_search = get_pref('Default Search')
unless defined $advanced_search;
my $initial_search_type = 'simple';
$initial_search_type = 'advanced' if $advanced_search;
So whether or not we use advanced search depends entirely on what the
state data says about advanced search, and then if that is not defined
we go to defaults.
This wouldn't be a problem except if we look at what happens in the
onclick of "Show more options", the state data never gets updated, and
if the default search is simple, the fact that we used advanced search
never gets stored on an empty advanced search.
My question is, how do I update the state data within the onclick of
that link? Here is the current onclick code (from search/story.html,
but I believe it is uniform throughout all the search files):
<a href="#" class="small" style="margin-left: 10px;"
onclick="$('search_title').value = $('search_simple').value;
$('search-button').name = 'advanced_search';
$('search-button').onclick = $('search-type').value = 'advanced';
$('basic-search', 'advanced-search', 'clear-button').invoke('toggle');
$('button-wrap').setStyle({margin: '0 0 0 0'}); return false">Show
more options »</a>
Thanks,
Sarah Mercier