diff options
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/juick/http/www/Login.java | 11 | ||||
-rw-r--r-- | src/java/com/juick/http/www/PageTemplates.java | 24 | ||||
-rw-r--r-- | src/java/com/juick/http/www/UserThread.java | 6 |
3 files changed, 15 insertions, 26 deletions
diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java index 7ad921e02..f693b97c3 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 16e7818c6..b5b187a0b 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("<!DOCTYPE html>"); - out.println("<html>"); - out.println("<head>"); - out.println(" <title>" + title + "</title>"); - out.println(" <link rel=\"stylesheet\" href=\"//static.juick.com/style3.2013032901.css\"/>"); - out.println(" <link rel=\"icon\" type=\"image/png\" href=\"//static.juick.com/favicon.png\"/>"); - out.println(" <script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\" defer=\"defer\"></script>"); - out.println(" <script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js\" defer=\"defer\" async=\"async\"></script>"); - out.println(" <script type=\"text/javascript\" src=\"//static.juick.com/scripts3.2013032900.js\" defer=\"defer\"></script>"); + out.print("<html>"); + out.print("<head>"); + out.print("<link rel=\"stylesheet\" href=\"/style.2013041001.css\"/>"); + out.print("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\" defer=\"defer\"></script>"); + out.print("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js\" defer=\"defer\" async=\"async\"></script>"); + out.print("<script type=\"text/javascript\" src=\"/scripts.2013032900.js\" defer=\"defer\"></script>"); if (headers != null) { - out.println(headers); + out.print(headers); } - out.println(" <meta name=\"viewport\" content=\"width=device-width,initial-scale=1,user-scalable=no\"/>"); + out.print("<title>" + title + "</title>"); + out.print("<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,user-scalable=no\"/>"); + out.print("<link rel=\"icon\" href=\"//i.juick.com/favicon.png\"/>"); out.println("</head>"); - out.println(); + out.flush(); out.println("<body>"); } @@ -428,7 +428,7 @@ public class PageTemplates { out.println(" <li id=\"msg-" + msg.MID + "\" class=\"msg\">"); out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:" + tags + "</div>"); - out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.User.UName + "/" + msg.MID + "\" title=\"" + msg.TimestampString + " GMT\">" + formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "); return false\" class=\"msg-menu\"><img src=\"http://static.juick.com/message-menu-icon.png\" alt=\"\"/></a></div>"); + out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.User.UName + "/" + msg.MID + "\" title=\"" + msg.TimestampString + " GMT\">" + formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "); return false\" class=\"msg-menu\"></a></div>"); if (msg.Place != null) { out.println(" <div class=\"msg-place\"><a href=\"/places/" + msg.Place.pid + "\">" + msg.Place.name + "</a></div>"); } diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index aba97a853..22914e549 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(" <li id=\"msg-" + mid + "\" class=\"msg msgthread\">"); out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:" + tags + "</div>"); - out.println(" <div class=\"msg-ts\">" + PageTemplates.formatJSLocalTime(msg.TimestampString) + "<a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "); return false\" class=\"msg-menu\"><img src=\"http://static.juick.com/message-menu-icon.png\" alt=\"\"/></a></div>"); + out.println(" <div class=\"msg-ts\">" + PageTemplates.formatJSLocalTime(msg.TimestampString) + "<a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "); return false\" class=\"msg-menu\"></a></div>"); if (msg.Place != null) { out.println(" <div class=\"msg-place\"><a href=\"/places/" + msg.Place.pid + "\">" + msg.Place.name + "</a></div>"); } @@ -303,7 +303,7 @@ public class UserThread { } out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>"); - out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + " GMT\">" + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "," + msg.RID + "); return false\" class=\"msg-menu\"><img src=\"http://static.juick.com/message-menu-icon.png\" alt=\"\"/></a></div>"); + out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + " GMT\">" + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "," + msg.RID + "); return false\" class=\"msg-menu\"></a></div>"); out.println(" <div class=\"msg-txt\">" + PageTemplates.formatMessage(msg.Text) + "</div>"); if (msg.VisitorCanComment) { out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentForm(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>"); @@ -342,7 +342,7 @@ public class UserThread { } out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\"></a></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>"); - out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + " GMT\">" + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "," + msg.RID + "); return false\" class=\"msg-menu\"><img src=\"http://static.juick.com/message-menu-icon.png\" alt=\"\"/></a></div>"); + out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + " GMT\">" + PageTemplates.formatDate(msg.TimeAgo, msg.TimestampString, locale) + "</a><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "," + msg.RID + "); return false\" class=\"msg-menu\"></a></div>"); out.println(" <div class=\"msg-txt\">" + PageTemplates.formatMessage(msg.Text) + "</div>"); out.print(" <div class=\"msg-links\">/" + msg.RID); if (msg.ReplyTo > 0) { |