Add placeholder text in search form (in html5 mode only).
authorJoey Hess <joey@kitenet.net>
Sun, 2 May 2010 17:49:56 +0000 (13:49 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 2 May 2010 17:49:56 +0000 (13:49 -0400)
IkiWiki/Plugin/google.pm
IkiWiki/Plugin/search.pm
debian/changelog
doc/bugs/html5_support.mdwn
doc/todo/Add_label_to_search_form_input_field.mdwn
templates/googleform.tmpl
templates/searchform.tmpl

index 85467fa0b8b24271cc76ec86ad3380758c9637d6..68cde261c66748c5d32475657986ce9d465fbbbf 100644 (file)
@@ -42,6 +42,7 @@ sub pagetemplate (@) {
                if (! defined $form) {
                        my $searchform = template("googleform.tmpl", blind_cache => 1);
                        $searchform->param(url => $config{url});
+                       $searchform->param(html5 => $config{html5});
                        $form=$searchform->output;
                }
 
index be39fdf1e4046a7b4e404800ca68cc1890b76860..9e875c79cc6008e4a5bca4d294a659e2fac21acd 100644 (file)
@@ -58,6 +58,7 @@ sub pagetemplate (@) {
                if (! defined $form) {
                        my $searchform = template("searchform.tmpl", blind_cache => 1);
                        $searchform->param(searchaction => $config{cgiurl});
+                       $searchform->param(html5 => $config{html5});
                        $form=$searchform->output;
                }
 
index 8158429a0411e43c40625c4da22a815d64d6cc47..c9fc2e65790dd047f6b8307405666813d00faa19 100644 (file)
@@ -2,6 +2,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low
 
   * Add parameter to displaytime to specify that it is a pubdate,
     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
 
index 386a3094aa1a299ae15b1f3b34491cd06c9c51dc..5530b29db13ebfac1e376a606c2370b846696a5a 100644 (file)
@@ -64,11 +64,8 @@ HTML5](http://www.w3.org/TR/html5-diff/).
 > 
 > Other ideas:
 > 
-> * Add pubdate attribute to time elements as appropriate.
 > * Use aside for the sidebar? Or for the [[templates/note]] template?
 > * 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. 
 >   (Need to wait on browser support probably.)
 > 
index 281ab48e26167ff316b19a8696230d896c5e0bd8..514108fbad772fd5779e4b3d0d2b166b344a939c 100644 (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
 > html5 yet. --[[Joey]] 
 
+>> [[Done]], placeholder added, in html5 mode only.
+
 [[!tag wishlist bugs/html5_support]]
index bcf1004a46cf8bd908f1c548c7fcfc8f67448531..f39b465404d67e8d6cb6dba7e0b5f8f11b0a87e7 100644 (file)
@@ -1,6 +1,7 @@
 <form method="get" action="http://www.google.com/search" id="searchform">
  <div>
   <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>
 </form>
index afae2ebf5d711b60fb87dbb9020cdcd98de4f98c..cb65d124ca9d543b762bbfb5e40100e09c5e1436 100644 (file)
@@ -1,5 +1,6 @@
 <form method="get" action="<TMPL_VAR SEARCHACTION>" id="searchform">
 <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>
 </form>