Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Minor l10n and default values fixes + form submission handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Craciunoiu committed Mar 12, 2010
1 parent 89b1b1a commit 2845165
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions apps/search/templates/form.html
Expand Up @@ -47,7 +47,7 @@

<input type="hidden" value="1" name="w" />
<div class="submit-search">
<input type="submit" value="{{ _("Search") }} »" />
<input type="submit" value="{{ _("Search »") }}" />
</div>
</form><!-- kb -->
<form method="get" id="forum">
Expand Down Expand Up @@ -89,7 +89,7 @@

<input type="hidden" value="2" name="w" />
<div class="submit-search">
<input type="submit" value="{{ _("Search") }} »" />
<input type="submit" value="{{ _("Search »") }}" />
</div>
</form><!-- forum -->
</div><!-- tab-wrapper-->
Expand All @@ -101,8 +101,8 @@
{{ _("Enter your terms in the form below and click <strong>Search</strong>")|safe }}
<form role="search" method="get" action="search">
<input type="hidden" value="{{ locale }}" name="locale">
<input type="text" class="search-query search-empty-query" value="{{ search_form.q.data }}" name="q">
<input type="submit" class="search-empty-submit btn-large" value="{{ _("Search") }}">
<input type="text" class="search-query search-empty-query" value="{{ search_form.q.data or '' }}" name="q">
<input type="submit" class="search-empty-submit btn-large" value="{{ _("Search »") }}">
</form>
</div>
<a href="/{{ locale }}/search?a=1">{{ _("Use advanced search")|safe }}</a>
Expand Down
16 changes: 8 additions & 8 deletions media/js/search.js
Expand Up @@ -26,19 +26,19 @@ $(document).ready(function() {
$(this).val(text).css('color', '#9b9b9b');
});
}
autoFillHelpText($('input[name="author"]'), DEFAULT_AUTHOR);
autoFillHelpText($('input[name="q"]'), DEFAULT_QUERY);
autoFillHelpText($('input[name="tag"]'), DEFAULT_TAGS);
autoFillHelpText($('#search-tabs input[name="author"]'), DEFAULT_AUTHOR);
autoFillHelpText($('#search-tabs input[name="q"]'), DEFAULT_QUERY);
autoFillHelpText($('#search-tabs input[name="tag"]'), DEFAULT_TAGS);

$("#tab-wrapper form").submit(function() {
if ($('input[name="author"]').val() == DEFAULT_AUTHOR) {
if ($('#search-tabs input[name="author"]').val() == DEFAULT_AUTHOR) {
$('input[name="author"]').val('');
}
if ($('input[name="q"]').val() == DEFAULT_QUERY) {
$('input[name="q"]').val('');
if ($('#search-tabs input[name="q"]').val() == DEFAULT_QUERY) {
$('#search-tabs input[name="q"]').val('');
}
if ($('input[name="tags"]').val() == DEFAULT_TAGS) {
$('input[name="tags"]').val('');
if ($('#search-tabs input[name="tag"]').val() == DEFAULT_TAGS) {
$('#search-tabs input[name="tag"]').val('');
}
});

Expand Down

0 comments on commit 2845165

Please sign in to comment.