Add placeholder text in search form (in html5 mode only).

master
Joey Hess 2010-05-02 13:49:56 -04:00
parent 970373548f
commit b21df5029b
7 changed files with 9 additions and 5 deletions

View File

@ -42,6 +42,7 @@ sub pagetemplate (@) {
if (! defined $form) { if (! defined $form) {
my $searchform = template("googleform.tmpl", blind_cache => 1); my $searchform = template("googleform.tmpl", blind_cache => 1);
$searchform->param(url => $config{url}); $searchform->param(url => $config{url});
$searchform->param(html5 => $config{html5});
$form=$searchform->output; $form=$searchform->output;
} }

View File

@ -58,6 +58,7 @@ sub pagetemplate (@) {
if (! defined $form) { if (! defined $form) {
my $searchform = template("searchform.tmpl", blind_cache => 1); my $searchform = template("searchform.tmpl", blind_cache => 1);
$searchform->param(searchaction => $config{cgiurl}); $searchform->param(searchaction => $config{cgiurl});
$searchform->param(html5 => $config{html5});
$form=$searchform->output; $form=$searchform->output;
} }

1
debian/changelog vendored
View File

@ -2,6 +2,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low
* Add parameter to displaytime to specify that it is a pubdate, * Add parameter to displaytime to specify that it is a pubdate,
and in html5 mode, use time tag. and in html5 mode, use time tag.
* Add placeholder text in search form (in html5 mode only).
-- Joey Hess <joeyh@debian.org> Sun, 02 May 2010 13:22:50 -0400 -- Joey Hess <joeyh@debian.org> Sun, 02 May 2010 13:22:50 -0400

View File

@ -64,11 +64,8 @@ HTML5](http://www.w3.org/TR/html5-diff/).
> >
> Other ideas: > Other ideas:
> >
> * Add pubdate attribute to time elements as appropriate.
> * Use aside for the sidebar? Or for the [[templates/note]] template? > * Use aside for the sidebar? Or for the [[templates/note]] template?
> * Use nav for the actionbar > * Use nav for the actionbar
> * Use placeholder in the search box. Allows closing
> [[this_todo|Add_label_to_search_form_input_field]]
> * Use details tag instead of the javascript in the toggle plugin. > * Use details tag instead of the javascript in the toggle plugin.
> (Need to wait on browser support probably.) > (Need to wait on browser support probably.)
> >

View File

@ -51,4 +51,6 @@ The patch below adds a label for the field to improve usability:
> element. already works in eg, chromium. However, ikiwiki does not use > element. already works in eg, chromium. However, ikiwiki does not use
> html5 yet. --[[Joey]] > html5 yet. --[[Joey]]
>> [[Done]], placeholder added, in html5 mode only.
[[!tag wishlist bugs/html5_support]] [[!tag wishlist bugs/html5_support]]

View File

@ -1,6 +1,7 @@
<form method="get" action="http://www.google.com/search" id="searchform"> <form method="get" action="http://www.google.com/search" id="searchform">
<div> <div>
<input name="sitesearch" value="<TMPL_VAR URL>" type="hidden" /> <input name="sitesearch" value="<TMPL_VAR URL>" type="hidden" />
<input name="q" value="" id="searchbox" size="16" maxlength="255" type="text" /> <input name="q" value="" id="searchbox" size="16" maxlength="255" type="text"
<TMPL_IF HTML5>placeholder="search"</TMPL_IF> />
</div> </div>
</form> </form>

View File

@ -1,5 +1,6 @@
<form method="get" action="<TMPL_VAR SEARCHACTION>" id="searchform"> <form method="get" action="<TMPL_VAR SEARCHACTION>" id="searchform">
<div> <div>
<input type="text" id="searchbox" name="P" value="" size="16" /> <input type="text" id="searchbox" name="P" value="" size="16"
<TMPL_IF HTML5>placeholder="search"</TMPL_IF> />
</div> </div>
</form> </form>