diff options
author | 2012-12-31 16:59:26 +0700 | |
---|---|---|
committer | 2012-12-31 16:59:26 +0700 | |
commit | d95df2184dbb9931db3a5eea0f4ea41a59ca4214 (patch) | |
tree | 528ec263b745c808a0608be9ebf6a494286a7e5e /src/java/com/juick/http/www/PageTemplates.java | |
parent | ed2f70f338bbed7b608fcc5b07f751d5b99d4f53 (diff) |
search input box improvement
Diffstat (limited to 'src/java/com/juick/http/www/PageTemplates.java')
-rw-r--r-- | src/java/com/juick/http/www/PageTemplates.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index a22f198e..628c9be9 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -69,12 +69,16 @@ public class PageTemplates { out.println("<body>"); } - public static void pageNavigation(PrintWriter out, Locale loc, com.juick.User user) { + public static void pageNavigation(PrintWriter out, Locale loc, com.juick.User user, String search) { ResourceBundle rb = ResourceBundle.getBundle("Global", loc); out.println("<div id=\"hwrapper\">"); out.println("<ul id=\"header\">"); out.println(" <li id=\"logo\"><a href=\"" + (user != null ? "/?show=my" : "/") + "\"><div class=\"head-ico\" id=\"hi-logo\"></div></a></li>"); - out.println(" <li id=\"search\"><form action=\"/\"><input type=\"text\" name=\"search\" class=\"text\" placeholder=\"" + rb.getString("Search") + "\"/></form></li>"); + out.print(" <li id=\"search\"><form action=\"/\"><input type=\"text\" name=\"search\" class=\"text\" placeholder=\"" + rb.getString("Search") + "\""); + if (search != null) { + out.print(" value=\"" + Utils.encodeHTML(search) + "\""); + } + out.println("/></form></li>"); if (user != null) { out.println(" <li class=\"right\"><a href=\"/logout\"><div class=\"head-ico\" id=\"hi-logout\"></div></a></li>"); out.println(" <li class=\"right\"><a href=\"/settings\"><div class=\"head-ico\" id=\"hi-settings\"></div></a></li>"); |