From 3692155bcddc13886bbbc0fd89bb4a4e3a24c88d Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sun, 14 Apr 2013 06:38:03 +0700 Subject: HTML/CSS optimization --- src/java/com/juick/http/www/Login.java | 11 ----------- src/java/com/juick/http/www/PageTemplates.java | 24 ++++++++++++------------ src/java/com/juick/http/www/UserThread.java | 6 +++--- 3 files changed, 15 insertions(+), 26 deletions(-) (limited to 'src/java/com/juick') diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java index 7ad921e0..f693b97c 100644 --- a/src/java/com/juick/http/www/Login.java +++ b/src/java/com/juick/http/www/Login.java @@ -91,12 +91,6 @@ public class Login { Cookie c = new Cookie("hash", hash); c.setMaxAge(365 * 24 * 60 * 60); response.addCookie(c); - - Cookie c2 = new Cookie("hash", "-"); - c2.setDomain(".juick.com"); - c2.setMaxAge(0); - response.addCookie(c2); - response.sendRedirect("/"); } else { response.sendError(403); @@ -118,11 +112,6 @@ public class Login { c.setMaxAge(365 * 24 * 60 * 60); response.addCookie(c); - Cookie c2 = new Cookie("hash", "-"); - c2.setDomain(".juick.com"); - c2.setMaxAge(0); - response.addCookie(c2); - String referer = request.getHeader("Referer"); if (referer != null && referer.startsWith("http://juick.com/") && !referer.equals("http://juick.com/login")) { response.sendRedirect(referer); diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index 16e7818c..b5b187a0 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -49,20 +49,20 @@ public class PageTemplates { public static void pageHead(PrintWriter out, String title, String headers) { out.println(""); - out.println(""); - out.println(""); - out.println(" " + title + ""); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); + out.print(""); + out.print(""); + out.print(""); + out.print(""); + out.print(""); + out.print(""); if (headers != null) { - out.println(headers); + out.print(headers); } - out.println(" "); + out.print("" + title + ""); + out.print(""); + out.print(""); out.println(""); - out.println(); + out.flush(); out.println(""); } @@ -428,7 +428,7 @@ public class PageTemplates { out.println("
  • "); out.println("
    \""
    "); out.println("
    @" + msg.User.UName + ":" + tags + "
    "); - out.println("
    " + formatDate(msg.TimeAgo, msg.TimestampString, locale) + "\"\"/
    "); + out.println("
    " + formatDate(msg.TimeAgo, msg.TimestampString, locale) + "
    "); if (msg.Place != null) { out.println("
    " + msg.Place.name + "
    "); } diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index aba97a85..22914e54 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -126,7 +126,7 @@ public class UserThread { out.println("
  • "); out.println("
    \""
    "); out.println("
    @" + msg.User.UName + ":" + tags + "
    "); - out.println("
    " + PageTemplates.formatJSLocalTime(msg.TimestampString) + "\"\"/
    "); + out.println("
    " + PageTemplates.formatJSLocalTime(msg.TimestampString) + "
    "); if (msg.Place != null) { out.println("
    " + msg.Place.name + "
    "); } @@ -303,7 +303,7 @@ public class UserThread { } out.println("
    \""
    "); out.println("
    @" + msg.User.UName + ":
    "); - out.println("
    " + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "\"\"/
    "); + out.println("
    " + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "
    "); out.println("
    " + PageTemplates.formatMessage(msg.Text) + "
    "); if (msg.VisitorCanComment) { out.println("
    " + rb.getString("Comment") + "
    "); @@ -342,7 +342,7 @@ public class UserThread { } out.println("
    "); out.println("
    @" + msg.User.UName + ":
    "); - out.println("
    " + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "\"\"/
    "); + out.println("
    " + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "
    "); out.println("
    " + PageTemplates.formatMessage(msg.Text) + "
    "); out.print("
    /" + msg.RID); if (msg.ReplyTo > 0) { -- cgit v1.2.3