From d95df2184dbb9931db3a5eea0f4ea41a59ca4214 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Mon, 31 Dec 2012 16:59:26 +0700 Subject: search input box improvement --- src/java/com/juick/http/www/Blogs.java | 6 +++++- src/java/com/juick/http/www/Help.java | 2 +- src/java/com/juick/http/www/Login.java | 2 +- src/java/com/juick/http/www/NewMessage.java | 2 +- src/java/com/juick/http/www/PageTemplates.java | 8 ++++++-- src/java/com/juick/http/www/User.java | 8 ++++---- src/java/com/juick/http/www/UserThread.java | 2 +- src/java/com/juick/http/www/Utils.java | 2 ++ 8 files changed, 21 insertions(+), 11 deletions(-) (limited to 'src/java/com/juick/http/www') diff --git a/src/java/com/juick/http/www/Blogs.java b/src/java/com/juick/http/www/Blogs.java index 756088e2..548231ae 100644 --- a/src/java/com/juick/http/www/Blogs.java +++ b/src/java/com/juick/http/www/Blogs.java @@ -74,6 +74,7 @@ public class Blogs { return; } } else if (requesturi.startsWith("/places/")) { + //TODO перенести сюда блок, который страницей ниже } int paramBefore = 0; @@ -164,7 +165,7 @@ public class Blogs { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, title, null); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, paramSearch); out.println("
"); out.println("
"); @@ -185,6 +186,9 @@ public class Blogs { if (paramShow != null) { nextpage += "&show=" + paramShow; } + if (paramSearch != null) { + nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); + } out.println("

Older →

"); } diff --git a/src/java/com/juick/http/www/Help.java b/src/java/com/juick/http/www/Help.java index a67b3929..e780e196 100644 --- a/src/java/com/juick/http/www/Help.java +++ b/src/java/com/juick/http/www/Help.java @@ -75,7 +75,7 @@ public class Help { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, rb.getString("Help"), ""); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); out.println("
"); out.println("
"); diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java index 3cf4a318..326206da 100644 --- a/src/java/com/juick/http/www/Login.java +++ b/src/java/com/juick/http/www/Login.java @@ -44,7 +44,7 @@ public class Login { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, rb.getString("Login"), ""); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); out.println("
"); out.println("
"); diff --git a/src/java/com/juick/http/www/NewMessage.java b/src/java/com/juick/http/www/NewMessage.java index 9ca7e7ed..b66b87d1 100644 --- a/src/java/com/juick/http/www/NewMessage.java +++ b/src/java/com/juick/http/www/NewMessage.java @@ -48,7 +48,7 @@ public class NewMessage { + "" + "" + ""); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); out.println("
"); out.println("
"); 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(""); } - 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("
"); out.println("
    "); out.println("
  • "); - out.println("
  • "); + out.print("
  • "); if (user != null) { out.println("
  • "); out.println("
  • "); diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java index 03d50059..0236a352 100644 --- a/src/java/com/juick/http/www/User.java +++ b/src/java/com/juick/http/www/User.java @@ -107,7 +107,7 @@ public class User { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, title, ""); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); out.println("
    "); @@ -154,7 +154,7 @@ public class User { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, "@" + user.UName + ": " + rb.getString("(Menu) Tags"), null); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); out.println("
    "); @@ -182,7 +182,7 @@ public class User { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, "@" + user.UName + ": " + rb.getString("(Stats) I read"), null); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); out.println("
    "); @@ -233,7 +233,7 @@ public class User { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, "@" + user.UName + ": " + rb.getString("(Stats) I read"), null); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); out.println("
    "); diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 38c08ef8..0cb0243c 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -65,7 +65,7 @@ public class UserThread { PrintWriter out = response.getWriter(); try { PageTemplates.pageHead(out, title, ""); - PageTemplates.pageNavigation(out, locale, visitor); + PageTemplates.pageNavigation(out, locale, visitor, null); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); out.println("
    "); diff --git a/src/java/com/juick/http/www/Utils.java b/src/java/com/juick/http/www/Utils.java index 15782bf0..38550691 100644 --- a/src/java/com/juick/http/www/Utils.java +++ b/src/java/com/juick/http/www/Utils.java @@ -104,10 +104,12 @@ public class Utils { public static String encodeHTML(String str) { String ret = str; + ret = ret.replaceAll("&", "&"); ret = ret.replaceAll("<", "<"); ret = ret.replaceAll(">", ">"); ret = ret.replaceAll("'", "'"); ret = ret.replaceAll("\"", """); + ret = ret.replaceAll("\n", " "); return str; } -- cgit v1.2.3