From 80dc112383a88def23eb95e34e3d7f739994bd3b Mon Sep 17 00:00:00 2001
From: Ugnich Anton
Date: Fri, 31 Jan 2014 01:01:48 +0700
Subject: New header design
---
src/java/com/juick/http/www/Discover.java | 14 +--
src/java/com/juick/http/www/Help.java | 18 ++--
src/java/com/juick/http/www/Home.java | 15 +--
src/java/com/juick/http/www/NewMessage.java | 8 +-
src/java/com/juick/http/www/PM.java | 33 +++----
src/java/com/juick/http/www/PageTemplates.java | 122 ++++++++-----------------
src/java/com/juick/http/www/SignUp.java | 9 +-
src/java/com/juick/http/www/User.java | 65 +++++--------
src/java/com/juick/http/www/UserThread.java | 11 +--
9 files changed, 98 insertions(+), 197 deletions(-)
(limited to 'src/java/com/juick/http')
diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java
index 98f46656..ca6415ff 100644
--- a/src/java/com/juick/http/www/Discover.java
+++ b/src/java/com/juick/http/www/Discover.java
@@ -74,9 +74,9 @@ public class Discover {
PageTemplates.pageHead(out, title, null);
PageTemplates.pageNavigation(out, locale, visitor, null);
- out.println("
");
- out.println("
");
- out.println("
");
+ PageTemplates.pageHomeColumn(out, sql, visitor, locale);
+
+ out.println("");
if (paramShow == null && paramBefore == 0) {
out.println("");
@@ -136,14 +136,9 @@ public class Home {
out.println("");
}
- PageTemplates.pageFooter(request, out, locale, visitor, true);
- out.println("
");
- out.println("
"); // wrapper
-
- PageTemplates.pageHomeColumn(out, sql, visitor, locale);
-
- out.println("
"); // topwrapper
+ out.println("");
+ PageTemplates.pageFooter(request, out, locale, visitor, true);
PageTemplates.pageDialogTemplate(out, locale);
PageTemplates.pageEnd(out);
} finally {
diff --git a/src/java/com/juick/http/www/NewMessage.java b/src/java/com/juick/http/www/NewMessage.java
index 20e1102c..7ab93e1d 100644
--- a/src/java/com/juick/http/www/NewMessage.java
+++ b/src/java/com/juick/http/www/NewMessage.java
@@ -50,7 +50,7 @@ public class NewMessage {
+ "");
PageTemplates.pageNavigation(out, locale, visitor, null);
- out.println("");
- out.println("
");
- out.println("
");
+ PageTemplates.pageHomeColumn(out, sql, visitor, locale);
+
+ out.println("
"); // wrapper
-
- PageTemplates.pageHomeColumn(out, sql, visitor, locale);
-
- out.println("
"); // topwrapper
+ out.println("");
+ PageTemplates.pageFooter(request, out, locale, visitor, true);
PageTemplates.pageDialogTemplate(out, locale);
PageTemplates.pageEnd(out);
} finally {
@@ -199,6 +189,9 @@ public class PM {
public void doPostPM(Connection sql, HttpServletRequest request, HttpServletResponse response, Stream xmpp, com.juick.User visitor) throws ServletException, IOException {
String uname = request.getParameter("uname");
+ if (uname.startsWith("@")) {
+ uname = uname.substring(1);
+ }
int uid = 0;
if (UserQueries.checkUserNameValid(uname)) {
uid = UserQueries.getUIDbyName(sql, uname);
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java
index 16a00d24..462fdf31 100644
--- a/src/java/com/juick/http/www/PageTemplates.java
+++ b/src/java/com/juick/http/www/PageTemplates.java
@@ -55,9 +55,9 @@ public class PageTemplates {
out.println("");
out.print("");
out.print("");
- out.print("
");
+ out.print("
");
out.print("");
- out.print("");
+ out.print("");
if (headers != null) {
out.print(headers);
}
@@ -69,75 +69,43 @@ public class PageTemplates {
out.println("");
}
- 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("
");
- }
- /*
- public static void pageUserTitle(PrintWriter out, Connection sql, Locale loc, com.juick.User user, com.juick.User visitor) {
- ResourceBundle rb = ResourceBundle.getBundle("User", loc);
-
- // Full name and description
- String fullname = null;
- String description = null;
- PreparedStatement stmt = null;
- ResultSet rs = null;
- try {
- stmt = sql.prepareStatement("SELECT fullname,descr FROM usersinfo WHERE user_id=?");
- stmt.setInt(1, user.UID);
- rs = stmt.executeQuery();
- if (rs.first()) {
- fullname = rs.getString(1) + " (" + user.UName + ")";
- description = rs.getString(2);
+ out.println(" ");
+ out.println("");
}
- } catch (SQLException e) {
- System.err.println(e);
- } finally {
- Utils.finishSQL(rs, stmt);
- }
- if (fullname == null) {
- fullname = user.UName;
- }
- if (description == null) {
- description = "";
- }
-
- out.println("
");
- out.println("
");
- out.println("
");
- out.println("
" + fullname + "
" + description + "
");
- out.println("
");
- out.println();
- }
- */
public static void pageYandexAd(PrintWriter out, int stat_id) {
out.println("
");
@@ -171,26 +139,13 @@ public class PageTemplates {
}
public static void pageHomeColumn(PrintWriter out, Connection sql, com.juick.User visitor, Locale locale) {
- ResourceBundle rb = ResourceBundle.getBundle("Blogs", locale);
-
if (tagsHTML == null) {
tagsHTML = PageTemplates.getPopularTags(sql, 60);
}
- out.println("
");
- out.println("
");
- out.println("
");
+ out.println("
");
+ out.println("");
}
public static String getPopularTags(Connection sql, int cnt) {
@@ -260,14 +215,13 @@ public class PageTemplates {
}
public static void pageFooter(HttpServletRequest request, PrintWriter out, Locale loc, com.juick.User visitor, boolean sapeon) {
- ResourceBundle rb = ResourceBundle.getBundle("Global", loc);
out.println("