aboutsummaryrefslogtreecommitdiff
path: root/src/java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2012-10-14 11:32:58 +0700
committerGravatar Ugnich Anton2012-10-14 11:32:58 +0700
commit98f036ae01fe90ad9d5853918602b705fdd41f02 (patch)
tree4926b28a09a11376ce29fe0def9c432aab9ae7c2 /src/java
parent4441c908f773f1b7c2b203fc6f47349408ae82c0 (diff)
A lot of changes.
Diffstat (limited to 'src/java')
-rw-r--r--src/java/Blogs.properties2
-rw-r--r--src/java/Blogs_ru.properties2
-rw-r--r--src/java/Global.properties1
-rw-r--r--src/java/Global_ru.properties1
-rw-r--r--src/java/User.properties1
-rw-r--r--src/java/User_ru.properties1
-rw-r--r--src/java/com/juick/http/www/Blogs.java41
-rw-r--r--src/java/com/juick/http/www/Chats.java77
-rw-r--r--src/java/com/juick/http/www/Login.java1
-rw-r--r--src/java/com/juick/http/www/Main.java13
-rw-r--r--src/java/com/juick/http/www/Map.java64
-rw-r--r--src/java/com/juick/http/www/NewMessage.java1
-rw-r--r--src/java/com/juick/http/www/PageTemplates.java134
-rw-r--r--src/java/com/juick/http/www/Photos.java100
-rw-r--r--src/java/com/juick/http/www/Tags.java87
-rw-r--r--src/java/com/juick/http/www/User.java38
-rw-r--r--src/java/com/juick/http/www/UserThread.java28
17 files changed, 258 insertions, 334 deletions
diff --git a/src/java/Blogs.properties b/src/java/Blogs.properties
index 3b596f77..d5c6fd26 100644
--- a/src/java/Blogs.properties
+++ b/src/java/Blogs.properties
@@ -7,7 +7,7 @@ Tags=Tags
Search=Search
My\ feed=My feed
Private=Private
-Incoming=Incoming
+Discussions=Discussions
Recommended=Recommended
All\ messages=All messages
Popular=Popular
diff --git a/src/java/Blogs_ru.properties b/src/java/Blogs_ru.properties
index f5fe415f..b42f32f5 100644
--- a/src/java/Blogs_ru.properties
+++ b/src/java/Blogs_ru.properties
@@ -7,7 +7,7 @@ Tags=\u0422\u0435\u0433\u0438
Search=\u041f\u043e\u0438\u0441\u043a
My\ feed=\u041c\u043e\u044f \u043b\u0435\u043d\u0442\u0430
Private=\u041f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435
-Incoming=\u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0435
+Discussions=\u041e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f
Recommended=\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0435
All\ messages=\u0412\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f
Popular=\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435
diff --git a/src/java/Global.properties b/src/java/Global.properties
index 9f618c91..b0e9525e 100644
--- a/src/java/Global.properties
+++ b/src/java/Global.properties
@@ -1,6 +1,7 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
+Search=Search
Blogs=Blogs
Chats=Chats
Photos=Photos
diff --git a/src/java/Global_ru.properties b/src/java/Global_ru.properties
index f87f4c75..8d315dbf 100644
--- a/src/java/Global_ru.properties
+++ b/src/java/Global_ru.properties
@@ -1,6 +1,7 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
+Search=\u041f\u043e\u0438\u0441\u043a
Blogs=\u0411\u043b\u043e\u0433\u0438
Chats=\u0427\u0430\u0442\u044b
Photos=\u0424\u043e\u0442\u043e
diff --git a/src/java/User.properties b/src/java/User.properties
index b91d4352..4d54c498 100644
--- a/src/java/User.properties
+++ b/src/java/User.properties
@@ -15,3 +15,4 @@ Expand\ all=Expand all
View\ as\ list=View as list
View\ as\ tree=View as tree
all=all
+Search=Search
diff --git a/src/java/User_ru.properties b/src/java/User_ru.properties
index 3bf82875..6a257a49 100644
--- a/src/java/User_ru.properties
+++ b/src/java/User_ru.properties
@@ -15,3 +15,4 @@ Expand\ all=\u0420\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435
View\ as\ list=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u043e\u043c
View\ as\ tree=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e\u043c
all=\u0432\u0441\u0435
+Search=\u041f\u043e\u0438\u0441\u043a
diff --git a/src/java/com/juick/http/www/Blogs.java b/src/java/com/juick/http/www/Blogs.java
index a1cfdeb0..ea728eab 100644
--- a/src/java/com/juick/http/www/Blogs.java
+++ b/src/java/com/juick/http/www/Blogs.java
@@ -98,10 +98,10 @@ public class Blogs {
response.sendError(404);
return;
}
- } else if (paramShow.equals("incoming")) {
+ } else if (paramShow.equals("discuss")) {
if (visitor != null) {
- title = rb.getString("Incoming");
- mids = MessagesQueries.getIncoming(sql, visitor.UID, paramBefore);
+ title = rb.getString("Discussions");
+ mids = MessagesQueries.getDiscussions(sql, visitor.UID, paramBefore);
} else {
response.sendError(404);
return;
@@ -130,18 +130,27 @@ public class Blogs {
try {
PageTemplates.pageHead(out, title, null);
PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, title);
+ out.println("<div id=\"topwrapper\">");
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\">");
- out.println("<ul>");
+
+ PageTemplates.pageFilters(out, locale, visitor);
if (mids.size() > 0) {
+ /*
+ if (paramShow != null && paramShow.equals("photos")) {
+ PageTemplates.printPhotos(out, sql, mids, locale);
+ } else {
+ */
+ out.println("<ul>");
PageTemplates.printMessages(out, sql, mids, locale);
+ out.println("</ul>");
+ /*
+ }
+ */
}
- out.println("</ul>");
-
if (mids.size() == 20) {
String nextpage = "?before=" + mids.get(mids.size() - 1);
if (paramShow != null) {
@@ -154,29 +163,33 @@ public class Blogs {
}
out.println("</div>");
+ out.println("</div>"); // wrapper
+
- out.println("<div id=\"column\">");
+ out.println("<div id=\"column\" class=\"stickya\">");
out.println("<h2>" + rb.getString("Lists") + "</h2>");
if (visitor != null) {
out.println("<ul>");
out.println(" <li><a href=\"?show=my\">" + rb.getString("My feed") + "</a></li>");
out.println(" <li><a href=\"?show=private\">" + rb.getString("Private") + "</a></li>");
- out.println(" <li><a href=\"?show=incoming\">" + rb.getString("Incoming") + "</a></li>");
+ out.println(" <li><a href=\"?show=discuss\">" + rb.getString("Discussions") + "</a></li>");
out.println(" <li><a href=\"?show=recommended\">" + rb.getString("Recommended") + "</a></li>");
out.println("</ul>");
+ out.println("<hr/>");
}
out.println("<ul>");
out.println(" <li><a href=\"?\">" + rb.getString("All messages") + "</a></li>");
out.println(" <li><a href=\"?show=top\">" + rb.getString("Popular") + "</a></li>");
out.println(" <li><a href=\"?show=photos\">" + rb.getString("With photos") + "</a></li>");
out.println("</ul>");
- out.println("<h2>" + rb.getString("Tags") + "</h2>");
- out.println("<p style=\"text-align: justify\">" + getTags(sql, 30) + "</p>");
- out.println("<h2>" + rb.getString("Search") + "</h2>");
- out.println("<form action=\"/\" id=\"search\"><p><input type=\"text\" name=\"search\" class=\"inp\"/></p></form>");
- out.println("</div>");
+ out.println("<hr/>");
+ out.println("<p>" + getTags(sql, 30) + "</p>");
out.println("</div>");
+ out.println("<div id=\"rcol\"></div>");
+
+ out.println("</div>"); // topwrapper
+
PageTemplates.pageFooter(request, out, locale, visitor);
} finally {
out.close();
diff --git a/src/java/com/juick/http/www/Chats.java b/src/java/com/juick/http/www/Chats.java
deleted file mode 100644
index d15bb271..00000000
--- a/src/java/com/juick/http/www/Chats.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Juick
- * Copyright (C) 2008-2011, Ugnich Anton
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.juick.http.www;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- *
- * @author Ugnich Anton
- */
-public class Chats {
-
- protected void doGet(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- com.juick.User visitor = Utils.getVisitorUser(sql, request);
- Locale locale = request.getLocale();
- ResourceBundle rb = ResourceBundle.getBundle("Chats", locale);
-
- response.setContentType("text/html; charset=UTF-8");
- PrintWriter out = response.getWriter();
- try {
- PageTemplates.pageHead(out, rb.getString("Active chats"), "");
- PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, rb.getString("Active chats"));
-
- out.println("<div id=\"wrapper\">");
- out.println("<div id=\"content\"><ul id=\"chats\">");
-
- PreparedStatement stmt = null;
- ResultSet rs = null;
- try {
- stmt = sql.prepareStatement("SELECT chats.chat_id,chats.subject,COUNT(chat_users.user_id) AS cnt FROM chats INNER JOIN chat_users USING(chat_id) GROUP BY chat_id ORDER BY cnt DESC");
- rs = stmt.executeQuery();
- rs.beforeFirst();
- while (rs.next()) {
- String chatid = Integer.toString(rs.getInt(1), Character.MAX_RADIX);
- out.println("<li><b>" + Utils.encodeHTML(rs.getString(2)) + "</b><br/><i>" + rb.getString("Users online") + ": " + rs.getInt(3) + "</i><br/><a href=\"xmpp:" + chatid + "@chat.juick.com?join\">" + chatid + "@chat.juick.com</a></li>");
- }
- } catch (SQLException e) {
- System.err.println(e);
- } finally {
- Utils.finishSQL(rs, stmt);
- }
-
- out.println("</ul></div>");
- out.println("</div>");
-
- PageTemplates.pageFooter(request, out, locale, visitor);
- } finally {
- out.close();
- }
- }
-}
diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java
index 0006f9d0..3cf4a318 100644
--- a/src/java/com/juick/http/www/Login.java
+++ b/src/java/com/juick/http/www/Login.java
@@ -45,7 +45,6 @@ public class Login {
try {
PageTemplates.pageHead(out, rb.getString("Login"), "");
PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, rb.getString("Login"));
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\">");
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java
index 256e70f9..055327dd 100644
--- a/src/java/com/juick/http/www/Main.java
+++ b/src/java/com/juick/http/www/Main.java
@@ -42,10 +42,8 @@ public class Main extends HttpServlet implements XmppListener {
Connection sqlSearch;
XmppConnection xmpp;
Blogs blogs = new Blogs();
- Chats chats = new Chats();
- Photos photos = new Photos();
+ Tags tags = new Tags();
RootRedirects rootRedirects = new RootRedirects();
- Map map = new Map();
Login login = new Login();
User pagesUser = new User();
UserThread pagesUserThread = new UserThread();
@@ -124,12 +122,9 @@ public class Main extends HttpServlet implements XmppListener {
String uri = request.getRequestURI();
if (uri.equals("/")) {
blogs.doGet(sql, sqlSearch, request, response);
- } else if (uri.equals("/chats")) {
- chats.doGet(sql, request, response);
- } else if (uri.equals("/photos")) {
- photos.doGet(sql, request, response);
- } else if (uri.equals("/map")) {
- map.doGet(sql, request, response);
+ } else if (uri.equals("/tags")) {
+ com.juick.User visitor = Utils.getVisitorUser(sql, request);
+ tags.doGetTags(sql, request, response, visitor);
} else if (uri.equals("/post")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request);
if (visitor != null) {
diff --git a/src/java/com/juick/http/www/Map.java b/src/java/com/juick/http/www/Map.java
deleted file mode 100644
index 96524ac0..00000000
--- a/src/java/com/juick/http/www/Map.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Juick
- * Copyright (C) 2008-2011, Ugnich Anton
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.juick.http.www;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- *
- * @author Ugnich Anton
- */
-public class Map {
-
- protected void doGet(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- com.juick.User visitor = Utils.getVisitorUser(sql, request);
- Locale locale = request.getLocale();
- ResourceBundle rb = ResourceBundle.getBundle("Map", locale);
-
- response.setContentType("text/html; charset=UTF-8");
- PrintWriter out = response.getWriter();
- try {
- PageTemplates.pageHead(out, rb.getString("Messages on map"), "<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAVVtPtxkw4soCEHg44FsNChRB4OFYjAXt73He16Zkp6a_0tPs2RTU6i6UlcMs4QvPBYvIY8rWvcxqOg\" type=\"text/javascript\"></script>"
- + "<script src=\"http://static.juick.com/mc.js\" type=\"text/javascript\"></script>"
- + "<script src=\"http://static.juick.com/map.js?2010111500\" type=\"text/javascript\"></script>");
- PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, rb.getString("Messages on map"));
-
- out.println("<div id=\"wrapper\">");
- out.println("<div id=\"geomap\" style=\"height: 400px; margin: 1em 0.5em\"></div>");
- out.println("<div id=\"content\"><ul id=\"messages\"></ul></div>");
- out.println("<div id=\"column\"><h2>" + rb.getString("Popular places") + "</h2><ul id=\"places\"></ul></div>");
- out.println("</div>");
- out.println("<script type=\"text/javascript\">");
- out.println("$(document).ready(mapInit);");
- out.println("$(window).unload(GUnload);");
- out.println("</script>");
-
- PageTemplates.pageFooter(request, out, locale, visitor);
- } finally {
- out.close();
- }
- }
-}
diff --git a/src/java/com/juick/http/www/NewMessage.java b/src/java/com/juick/http/www/NewMessage.java
index 1efb753d..1e00a553 100644
--- a/src/java/com/juick/http/www/NewMessage.java
+++ b/src/java/com/juick/http/www/NewMessage.java
@@ -49,7 +49,6 @@ public class NewMessage {
+ "<script src=\"http://static.juick.com/map.js?2010111500\" type=\"text/javascript\"></script>"
+ "<script src=\"http://static.juick.com/post3.js\" type=\"text/javascript\"></script>");
PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, rbnm.getString("New message"));
out.println("<div id=\"wrapper\"><div id=\"content\" class=\"pagetext\">");
out.println("<form action=\"/post\" method=\"post\" id=\"postmsg\" enctype=\"multipart/form-data\">");
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java
index a76e0280..08e88342 100644
--- a/src/java/com/juick/http/www/PageTemplates.java
+++ b/src/java/com/juick/http/www/PageTemplates.java
@@ -24,7 +24,11 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
@@ -39,6 +43,9 @@ import ru.sape.Sape;
public class PageTemplates {
public static Sape sape = null;
+ private static SimpleDateFormat sdfSQL = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
+ private static SimpleDateFormat sdfSimple = new SimpleDateFormat("d MMM");
+ private static SimpleDateFormat sdfFull = new SimpleDateFormat("d MMM yyyy");
public static void pageHead(PrintWriter out, String title, String headers) {
out.println("<!DOCTYPE html>");
@@ -46,10 +53,10 @@ public class PageTemplates {
out.println("<head>");
out.println(" <meta charset=\"utf-8\"/>");
out.println(" <title>" + title + "</title>");
- out.println(" <link rel=\"stylesheet\" href=\"http://static.juick.com/style3.css?20120306\"/>");
+ out.println(" <link rel=\"stylesheet\" href=\"http://static.juick.com/style3.css?2012030601\"/>");
out.println(" <link rel=\"icon\" type=\"image/png\" href=\"http://static.juick.com/favicon.png\"/>");
- out.println(" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js\"></script>");
- out.println(" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js\"></script>");
+ out.println(" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>");
+ out.println(" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js\"></script>");
out.println(" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js\"></script>");
out.println(" <script type=\"text/javascript\" src=\"http://static.juick.com/scripts3.js?20120306\"></script>");
out.println(" <script type=\"text/javascript\" src=\"http://static.juick.com/js/jquery.autoresize.js\"></script>");
@@ -63,18 +70,16 @@ public class PageTemplates {
public static void pageNavigation(PrintWriter out, Locale loc, com.juick.User user) {
ResourceBundle rb = ResourceBundle.getBundle("Global", loc);
+ out.println("<div id=\"hwrapper\">");
out.println("<div id=\"header\">");
- out.println("<div id=\"logo\"><a href=\"" + (user != null ? "/?show=my" : "/") + "\"><img src=\"http://static.juick.com/logo3.png\" width=\"120\" height=\"40\" alt=\"Juick\"/></a></div>");
- out.println(" <ul id=\"nav\">");
- out.println(" <li><a href=\"/\">" + rb.getString("Blogs") + "</a></li>");
-// out.println(" <li><a href=\"/chats\">" + rb.getString("Chats") + "</a></li>");
- out.println(" <li><a href=\"/photos\">" + rb.getString("Photos") + "</a></li>");
- out.println(" <li><a href=\"/map\">" + rb.getString("Map") + "</a></li>");
- out.println(" </ul>");
+ out.println(" <div id=\"logo\"><a href=\"" + (user != null ? "/?show=my" : "/") + "\"><img src=\"http://static.juick.com/logo3.png\" width=\"120\" height=\"40\" alt=\"Juick\"/></a></div>");
+ out.println(" <form action=\"/\" id=\"search\">");
+ out.println(" <div id=\"search\"><input type=\"text\" name=\"search\" class=\"text\" placeholder=\"" + rb.getString("Search") + "\"/><input type=\"submit\" class=\"submit\" value=\">\"></div>");
+ out.println(" </form>");
out.println(" <ul id=\"nav-right\">");
if (user != null) {
out.println(" <li><a href=\"/post\">" + rb.getString("Post") + "</a></li>");
- out.println(" <li><a href=\"#\" onclick=\"$('#nav-menu').toggle('blind'); return false\"><img src=\"http://i.juick.com/as/" + user.UID + ".png\" alt=\"" + user.UName + "\"/>" + user.UName + "</a><ul id=\"nav-menu\">");
+ out.println(" <li><a href=\"#\" onclick=\"$('#nav-menu').toggle(); return false\"><img src=\"http://i.juick.com/as/" + user.UID + ".png\" alt=\"" + user.UName + "\"/>" + user.UName + "</a><ul id=\"nav-menu\">");
out.println(" <li><a href=\"/" + user.UName + "/\">" + rb.getString("Blog") + "</a></li>");
out.println(" <li><a href=\"/settings\">" + rb.getString("Settings") + "</a></li>");
out.println(" <li><a href=\"/logout\">" + rb.getString("Logout") + "</a></li>");
@@ -84,11 +89,21 @@ public class PageTemplates {
}
out.println(" </ul>");
out.println("</div>");
+ out.println("</div>");
}
- public static void pageTitle(PrintWriter out, String title) {
- out.println("<div id=\"title\">");
- out.println(" <h1>" + title + "</h1>");
+ public static void pageFilters(PrintWriter out, Locale loc, com.juick.User user) {
+ ResourceBundle rb = ResourceBundle.getBundle("Global", loc);
+
+ out.println("<div id=\"filters\">");
+ out.println("<ul>");
+ out.println(" <li><a href=\"#\">Messages</a></li>");
+ out.println(" <li><a href=\"#\">Photos</a></li>");
+ out.println(" <li><a href=\"#\">Recommendations</a></li>");
+ out.println(" <li><a href=\"#\">Private</a></li>");
+ out.println(" <li><a href=\"#\">Tags</a></li>");
+ out.println(" <li><a href=\"#\">Users</a></li>");
+ out.println("</ul>");
out.println("</div>");
}
@@ -236,7 +251,19 @@ public class PageTemplates {
int days = (minsago / 1440);
return days + " day" + ((days % 10 == 1) ? "" : "s") + " ago";
} else {
- return fulldate;
+ try {
+ Date pDate = sdfSQL.parse(fulldate);
+ Calendar c = Calendar.getInstance();
+ int curyear = c.get(Calendar.YEAR);
+ c.setTime(pDate);
+ if (c.get(Calendar.YEAR) == curyear) {
+ return sdfSimple.format(pDate);
+ } else {
+ return sdfFull.format(pDate);
+ }
+ } catch (ParseException e) {
+ return fulldate;
+ }
}
}
@@ -355,11 +382,11 @@ public class PageTemplates {
txt = formatMessage(txt);
- out.print(" <li id=\"msg-" + mid + "\" class=\"msg\"");
- if (mid == mids.get(0)) {
- out.print(" style=\"border: 0\"");
- }
- out.println(">");
+ out.println(" <li id=\"msg-" + mid + "\" class=\"msg\">");
+ out.println(" <div class=\"msg-avatar\"><a href=\"/" + uname + "/\"><img src=\"http://i.juick.com/a/" + uid + ".png\" alt=\"" + uname + "\"/></a></div>");
+ out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\" title=\"" + rs.getString(9) + "\">" + formatDate(rs.getInt(8), rs.getString(9), locale) + "</a></div>");
+ out.println(" <div class=\"msg-header\"><a href=\"/" + uname + "/\">@" + uname + "</a>:" + tags + "</div>");
+ out.println(" <div class=\"msg-txt\">" + txt + "</div>");
if (rs.getString(12) != null) {
if (rs.getString(12).equals("jpg")) {
@@ -372,15 +399,6 @@ public class PageTemplates {
}
}
- out.println(" <div class=\"msg-avatar\"><a href=\"/" + uname + "/\"><img src=\"http://i.juick.com/a/" + uid + ".png\" alt=\"" + uname + "\"/></a></div>");
- out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\">" + formatDate(rs.getInt(8), rs.getString(9), locale) + "</a><div class=\"msg-menu\"><a href=\"#\" onclick=\"$('#msg-menu-" + mid + "').toggle('blind'); return false\"><img src=\"http://static.juick.com/message-menu-icon.png\"></a><ul id=\"msg-menu-" + mid + "\">");
- out.println(" <li><a href=\"/post?body=%21%20%23" + mid + "\">" + rb.getString("Recommend message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=%40" + uname + "%20\">" + rb.getString("Send private message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=BL%20%40" + uname + "\">" + rb.getString("Block user") + "</a></li>");
- out.println(" </ul></div></div>");
- out.println(" <div class=\"msg-header\"><a href=\"/" + uname + "/\">@" + uname + "</a>:" + tags + "</div>");
- out.println(" <div class=\"msg-txt\">" + txt + "</div>");
-
if (rs.getInt(10) > 0) {
String repliesby = rs.getString(11);
if (repliesby == null) {
@@ -389,7 +407,7 @@ public class PageTemplates {
out.println(" <div class=\"msg-comments\"><a href=\"/" + uname + "/" + mid + "\">" + formatReplies(rs.getInt(10), locale) + "</a> " + rb.getString("(replies) by") + " " + repliesby + "</div>");
} else if (cancomment) {
out.println(" <form action=\"/post\" method=\"POST\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"mid\" value=\"" + mid + "\"/>");
- out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea><input type=\"submit\" value=\"OK\"/></div>");
+ out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>");
out.println(" </form>");
}
out.println(" </li>");
@@ -400,4 +418,60 @@ public class PageTemplates {
Utils.finishSQL(rs, stmt);
}
}
+ /*
+ public static void printPhotos(PrintWriter out, Connection sql, ArrayList<Integer> mids, Locale locale) {
+ ResourceBundle rb = ResourceBundle.getBundle("Global", locale);
+
+ out.println("<table class=\"photos\">");
+ out.println(" <tr>");
+
+ PreparedStatement stmt = null;
+ ResultSet rs = null;
+ try {
+ stmt = sql.prepareStatement("SELECT STRAIGHT_JOIN messages.message_id,messages.user_id,users.nick,messages_txt.tags,messages.readonly,messages.privacy,messages_txt.txt,TIMESTAMPDIFF(MINUTE,messages.ts,NOW()),messages.ts,messages.replies,messages_txt.repliesby,messages.attach,messages.place_id,places.name,messages.lat,messages.lon FROM ((messages INNER JOIN messages_txt ON messages.message_id=messages_txt.message_id) INNER JOIN users ON messages.user_id=users.id) LEFT JOIN places ON messages.place_id=places.place_id WHERE messages.message_id IN (" + Utils.convertArray2String(mids) + ") ORDER BY messages.message_id DESC");
+ rs = stmt.executeQuery();
+ rs.beforeFirst();
+ int cnt = 0;
+ while (rs.next()) {
+ int mid = rs.getInt(1);
+ int uid = rs.getInt(2);
+ String uname = rs.getString(3);
+ String tags = rs.getString(4);
+ String txt = rs.getString(7);
+
+ txt = formatMessage(txt);
+
+ if (cnt % 2 == 0 && cnt > 0) {
+ out.println(" </tr>");
+ out.println(" <tr>");
+ }
+
+ out.print(" <td id=\"photo-" + mid + "\" class=\"photo\"");
+ if (mid == mids.get(0)) {
+ out.print(" style=\"border: 0\"");
+ }
+ out.print(">");
+
+ out.println("<div class=\"photowrap\">");
+ out.println(" <a href=\"#\" onclick=\"return photoDetails(" + mid + ")\"><img src=\"http://i.juick.com/" + (rs.getString(12).equals("jpg") ? "photos-512" : "thumbs") + "/" + mid + ".jpg\" alt=\"\"/></a>");
+ out.println(" <div class=\"photo-ts\" title=\"" + rs.getString(9) + "\">" + formatDate(rs.getInt(8), rs.getString(9), locale) + "</div>");
+ out.println(" <div class=\"photo-uname\">@" + uname + "</div>");
+ if (rs.getInt(10) > 0) {
+ out.println(" <div class=\"photo-comments\">" + rs.getInt(10) + "</div>");
+ }
+ out.println(" <div class=\"photo-txt\">" + txt + "</div>");
+ out.println(" </td>");
+
+ cnt++;
+ }
+ } catch (SQLException e) {
+ System.err.println(e);
+ } finally {
+ Utils.finishSQL(rs, stmt);
+ }
+
+ out.println(" </tr>");
+ out.println("</table>");
+ }
+ */
}
diff --git a/src/java/com/juick/http/www/Photos.java b/src/java/com/juick/http/www/Photos.java
deleted file mode 100644
index a2665501..00000000
--- a/src/java/com/juick/http/www/Photos.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Juick
- * Copyright (C) 2008-2011, Ugnich Anton
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.juick.http.www;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- *
- * @author Ugnich Anton
- */
-public class Photos {
-
- protected void doGet(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- com.juick.User visitor = Utils.getVisitorUser(sql, request);
- Locale locale = request.getLocale();
- ResourceBundle rb = ResourceBundle.getBundle("Photos", locale);
-
- response.setContentType("text/html; charset=UTF-8");
- PrintWriter out = response.getWriter();
- try {
- PageTemplates.pageHead(out, rb.getString("Last photos and videos"), "<script type=\"text/javascript\" src=\"http://static.juick.com/js/jquery.onImagesLoad.min.js\"></script>"
- + "<script type=\"text/javascript\" src=\"http://static.juick.com/js/gallery.js\"></script>"
- + "<script type=\"text/javascript\" src=\"http://static.juick.com/js/jquery.fancybox-1.3.4.js\"></script>"
- + "<link rel=\"stylesheet\" href=\"http://static.juick.com/fancybox/jquery.fancybox-1.3.4.css\"/>");
- PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageTitle(out, rb.getString("Last photos and videos"));
-
- out.println("<div id=\"wrapper\">");
- out.println("<div id=\"spinner\" style=\"text-align: center\">Loading...</div>");
- out.println("<ul id=\"gallery\" style=\"display: none\">");
-
- PreparedStatement stmt = null;
- ResultSet rs = null;
- try {
- stmt = sql.prepareStatement("SELECT messages.message_id,messages.attach,users.nick FROM messages INNER JOIN users ON messages.user_id=users.id WHERE messages.attach IS NOT NULL ORDER BY message_id DESC LIMIT 20");
- rs = stmt.executeQuery();
- rs.beforeFirst();
- while (rs.next()) {
- if (rs.getString(2).equals("jpg")) {
- out.println("<li class=\"galleryitem\"><a href=\"/" + rs.getString(3) + "/" + rs.getInt(1) + "\" title=\"@" + rs.getString(3) + "\"><img src=\"http://i.juick.com/photos-512/" + rs.getInt(1) + ".jpg\" alt=\"\"></a></li>");
- } else {
- out.println("<li class=\"galleryitem\"><a href=\"/" + rs.getString(3) + "/" + rs.getInt(1) + "\" title=\"@" + rs.getString(3) + "\"><img src=\"http://i.juick.com/thumbs/" + rs.getInt(1) + ".jpg\" alt=\"\"></a></li>");
- }
- }
- } catch (SQLException e) {
- System.err.println(e);
- } finally {
- Utils.finishSQL(rs, stmt);
- }
-
- out.println("</ul>");
- out.println("</div>");
- out.println("<script type=\"text/javascript\">");
- out.println("$('#gallery').onImagesLoad({selectorCallback: galleryResize});");
- out.println("$('.galleryitem a').click(function() {");
- out.println(" $.fancybox({");
- out.println(" 'href': $(this).children('img').attr('src'),");
- out.println(" 'link': this.href,");
- out.println(" 'title': this.title,");
- out.println(" 'orig': this,");
- out.println(" 'transitionIn': 'elastic',");
- out.println(" 'transitionOut': 'none',");
- out.println(" 'easingIn': 'easeOutBack',");
- out.println(" 'easingOut': 'easeInBack'");
- out.println(" });");
- out.println(" return false;");
- out.println("});");
- out.println("</script>");
-
- PageTemplates.pageFooter(request, out, locale, visitor);
- } finally {
- out.close();
- }
- }
-}
diff --git a/src/java/com/juick/http/www/Tags.java b/src/java/com/juick/http/www/Tags.java
new file mode 100644
index 00000000..07cff582
--- /dev/null
+++ b/src/java/com/juick/http/www/Tags.java
@@ -0,0 +1,87 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.juick.http.www;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author ugnich
+ */
+public class Tags {
+
+ protected void doGetTags(Connection sql, HttpServletRequest request, HttpServletResponse response, com.juick.User visitor) throws ServletException, IOException {
+ Locale locale = request.getLocale();
+ ResourceBundle rbnm = ResourceBundle.getBundle("Blogs", locale);
+
+ response.setContentType("text/html; charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ PageTemplates.pageHead(out, rbnm.getString("Tags"), null);
+ PageTemplates.pageNavigation(out, locale, visitor);
+
+ int cnt = 30;
+ com.juick.Tag tags[] = new com.juick.Tag[cnt];
+ int maxUsageCnt = 0;
+ PreparedStatement stmt = null;
+ ResultSet rs = null;
+ try {
+ stmt = sql.prepareStatement("SELECT tags.name AS name,COUNT(DISTINCT messages.user_id) AS cnt FROM (messages INNER JOIN messages_tags ON (messages.ts>TIMESTAMPADD(DAY,-3,NOW()) AND messages.message_id=messages_tags.message_id)) INNER JOIN tags ON messages_tags.tag_id=tags.tag_id GROUP BY tags.tag_id ORDER BY cnt DESC LIMIT ?");
+ stmt.setInt(1, cnt);
+ rs = stmt.executeQuery();
+ rs.beforeFirst();
+ cnt = 0;
+ while (rs.next()) {
+ tags[cnt] = new com.juick.Tag();
+ tags[cnt].Name = rs.getString(1);
+ tags[cnt].UsageCnt = rs.getInt(2);
+ if (tags[cnt].UsageCnt > maxUsageCnt) {
+ maxUsageCnt = tags[cnt].UsageCnt;
+ }
+ cnt++;
+ }
+ } catch (SQLException e) {
+ System.err.println(e);
+ } finally {
+ Utils.finishSQL(rs, stmt);
+ }
+
+ Arrays.sort(tags, 0, cnt);
+
+ for (int i = 0; i < cnt; i++) {
+ String tag = Utils.encodeHTML(tags[i].Name);
+ try {
+ tag = "<a href=\"/?tag=" + URLEncoder.encode(tags[i].Name, "UTF-8") + "\">" + tag + "</a>";
+ } catch (UnsupportedEncodingException e) {
+ }
+
+ if (tags[i].UsageCnt > maxUsageCnt / 3 * 2) {
+ out.print("<big>" + tag + "</big> ");
+ } else if (tags[i].UsageCnt > maxUsageCnt / 3) {
+ out.print("<small>" + tag + "</small> ");
+ } else {
+ out.print(tag + " ");
+ }
+ }
+
+ PageTemplates.pageFooter(request, out, locale, visitor);
+ } finally {
+ out.close();
+ }
+ }
+}
diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java
index 73dd5827..0ddac42d 100644
--- a/src/java/com/juick/http/www/User.java
+++ b/src/java/com/juick/http/www/User.java
@@ -100,6 +100,7 @@ public class User {
PageTemplates.pageNavigation(out, locale, visitor);
PageTemplates.pageUserTitle(out, sql, locale, user, visitor);
+ out.println("<div id=\"topwrapper\">");
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\">");
out.println("<ul>");
@@ -122,6 +123,7 @@ public class User {
pageUserColumn(out, sql, user, visitor, locale);
out.println("</div>");
+ out.println("</div>"); // topwrapper
PageTemplates.pageFooter(request, out, locale, visitor);
} finally {
@@ -146,11 +148,7 @@ public class User {
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\">");
-
- out.print("<p>");
- pageUserTags(out, sql, user, visitor, 0);
- out.print("</p>");
-
+ out.println("<p>" + pageUserTags(sql, user, visitor, 0) + "</p>");
out.println("</div>");
pageUserColumn(out, sql, user, visitor, locale);
out.println("</div>");
@@ -219,7 +217,7 @@ public class User {
try {
PageTemplates.pageHead(out, "@" + user.UName + ": " + rb.getString("(Stats) I read"), null);
PageTemplates.pageNavigation(out, locale, visitor);
- PageTemplates.pageUserTitle(out, sql, locale, user, visitor);
+ //PageTemplates.pageUserTitle(out, sql, locale, user, visitor);
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\">");
@@ -260,21 +258,21 @@ public class User {
public static void pageUserColumn(PrintWriter out, Connection sql, com.juick.User user, com.juick.User visitor, Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle("User", locale);
- out.println("<div id=\"column\">");
- out.println("<h2>" + rb.getString("(Menu) Messages") + "</h2>");
+ out.println("<div id=\"column\" class=\"stickya\">");
out.println("<ul>");
- out.println(" <li><a href=\"?\">" + rb.getString("(Menu) Blog") + "</a></li>");
- out.println(" <li><a href=\"?show=recomm\">" + rb.getString("(Menu) Recommendations") + "</a></li>");
- out.println(" <li><a href=\"?show=photos\">" + rb.getString("(Menu) Photos") + "</a></li>");
+ out.println(" <li><a href=\"./\">" + rb.getString("(Menu) Blog") + "</a></li>");
+ out.println(" <li><a href=\"./?show=recomm\">" + rb.getString("(Menu) Recommendations") + "</a></li>");
+ out.println(" <li><a href=\"./?show=photos\">" + rb.getString("(Menu) Photos") + "</a></li>");
out.println("</ul>");
- out.println("<h2>" + rb.getString("(Menu) Tags") + " <a href=\"./tags\">" + rb.getString("all") + "</a></h2>");
- pageUserTags(out, sql, user, visitor, 15);
- out.println("<h2>" + rb.getString("(Menu) Search") + "</h2>");
- out.println("<form action=\"./\" id=\"search\"><p><input type=\"text\" name=\"search\" class=\"inp\"/></p></form>");
+ out.println("<hr/>");
+ out.println("<p>" + pageUserTags(sql, user, visitor, 15) + "</p>");
+ out.println("<form action=\"./\" id=\"searchuser\">");
+ out.println("<p><input type=\"text\" name=\"search\" class=\"inp\" placeholder=\"" + rb.getString("Search") + "\"/></p>");
+ out.println("</form>");
out.println("</div>");
}
- public static void pageUserTags(PrintWriter out, Connection sql, com.juick.User user, com.juick.User visitor, int cnt) {
+ public static String pageUserTags(Connection sql, com.juick.User user, com.juick.User visitor, int cnt) {
com.juick.Tag tags[] = null;
int maxUsageCnt = 0;
@@ -313,6 +311,7 @@ public class User {
Arrays.sort(tags, 0, cnt);
}
+ String ret = "";
for (int i = 0; i < cnt; i++) {
String tag = Utils.encodeHTML(tags[i].Name);
try {
@@ -321,12 +320,13 @@ public class User {
}
if (tags[i].UsageCnt > maxUsageCnt / 3 * 2) {
- out.print("<big>" + tag + "</big> ");
+ ret += "<big>" + tag + "</big> ";
} else if (tags[i].UsageCnt > maxUsageCnt / 3) {
- out.print("<small>" + tag + "</small> ");
+ ret += "<small>" + tag + "</small> ";
} else {
- out.print(tag + " ");
+ ret += tag + " ";
}
}
+ return ret;
}
}
diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java
index e64b4437..1680ca8e 100644
--- a/src/java/com/juick/http/www/UserThread.java
+++ b/src/java/com/juick/http/www/UserThread.java
@@ -71,7 +71,7 @@ public class UserThread {
PageTemplates.pageNavigation(out, locale, visitor);
PageTemplates.pageUserTitle(out, sql, locale, user, visitor);
-
+ out.println("<div id=\"topwrapper\">");
out.println("<div id=\"wrapper\">");
out.println("<div id=\"content\" style=\"margin-left: 0; width: 100%\">");
@@ -80,8 +80,8 @@ public class UserThread {
printReplies(out, sql, MID, locale, listview);
out.println("</div>");
-
out.println("</div>");
+ out.println("</div>"); // topwrapper
out.println("<script type=\"text/javascript\">");
out.println("$(document).ready(unfoldReply);");
@@ -143,7 +143,7 @@ public class UserThread {
if (rs.getString(11) != null) {
if (rs.getString(11).equals("jpg")) {
- out.println(" <div class=\"msg-media\"><a href=\"http://i.juick.com/photos-1024/" + mid + ".jpg\"><img src=\"http://i.juick.com/photos-512/" + mid + ".jpg\" alt=\"\"/></a></div>");
+ out.println(" <div class=\"msg-media\"><a href=\"http://i.juick.com/p/" + mid + ".jpg\"><img src=\"http://i.juick.com/photos-512/" + mid + ".jpg\" alt=\"\"/></a></div>");
} else {
out.println(" <div class=\"msg-media\"><div id=\"video-" + mid + "\"><b>Attachment: <a href=\"http://i.juick.com/video/" + mid + ".mp4\">Video</a></b></div></div>");
out.println(" <script type=\"text/javascript\">");
@@ -153,17 +153,13 @@ public class UserThread {
}
out.println(" <div class=\"msg-avatar\"><a href=\"/" + uname + "/\"><img src=\"http://i.juick.com/a/" + uid + ".png\" alt=\"" + uname + "\"/></a></div>");
- out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\">" + PageTemplates.formatDate(rs.getInt(8), rs.getString(9), locale) + "</a><div class=\"msg-menu\"><a href=\"#\" onclick=\"$('#msg-menu-" + mid + "').toggle('blind'); return false\"><img src=\"http://static.juick.com/message-menu-icon.png\"></a><ul id=\"msg-menu-" + mid + "\">");
- out.println(" <li><a href=\"/post?body=%21%20%23" + mid + "\">" + rb.getString("Recommend message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=%40" + uname + "%20\">" + rb.getString("Send private message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=BL%20%40" + uname + "\">" + rb.getString("Block user") + "</a></li>");
- out.println(" </ul></div></div>");
+ out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\" title=\"" + rs.getString(9) + "\">" + PageTemplates.formatDate(rs.getInt(8), rs.getString(9), locale) + "</a></div>");
out.println(" <div class=\"msg-header\"><a href=\"/" + uname + "/\">@" + uname + "</a>:" + tags + "</div>");
out.println(" <div class=\"msg-txt\">" + txt + "</div>");
if (cancomment) {
out.println(" <form action=\"/post\" method=\"POST\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"mid\" value=\"" + mid + "\"/>");
- out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea><input type=\"submit\" value=\"OK\"/></div>");
+ out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>");
out.println(" </form>");
}
@@ -255,6 +251,10 @@ public class UserThread {
public static void printTree(PrintWriter out, ArrayList<com.juick.Message> replies, int ReplyTo, int margin, Locale locale) {
ResourceBundle rb = ResourceBundle.getBundle("Global", locale);
+ if (margin > 420) {
+ margin = 420;
+ }
+
for (int i = 0; i < replies.size(); i++) {
com.juick.Message msg = replies.get(i);
if (msg.ReplyTo == ReplyTo) {
@@ -278,10 +278,7 @@ public class UserThread {
}
}
out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"http://i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>");
- out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\">" + PageTemplates.formatDate(msg.MinutesAgo, msg.TimestampString, locale) + "</a><div class=\"msg-menu\"><a href=\"#\" onclick=\"$('#msg-menu-" + msg.MID + "-" + msg.RID + "').toggle('blind'); return false\"><img src=\"http://static.juick.com/message-menu-icon.png\"/></a><ul id=\"msg-menu-" + msg.MID + "-" + msg.RID + "\">");
- out.println(" <li><a href=\"/post?body=%40" + msg.User.UName + "%20\">" + rb.getString("Send private message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=BL%20%40" + msg.User.UName + "\">" + rb.getString("Block user") + "</a></li>");
- out.println(" </ul></div></div>");
+ out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + "\">" + PageTemplates.formatDate(msg.MinutesAgo, msg.TimestampString, locale) + "</a></div>");
out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>");
out.println(" <div class=\"msg-txt\">" + msg.Text + "</div>");
out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentForm(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>");
@@ -317,10 +314,7 @@ public class UserThread {
}
}
out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"http://i.juick.com/a/" + msg.User.UID + ".png\"></a></div>");
- out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\">" + PageTemplates.formatDate(msg.MinutesAgo, msg.TimestampString, locale) + "</a><div class=\"msg-menu\"><a href=\"#\" onclick=\"$('#msg-menu-" + msg.MID + "-" + msg.RID + "').toggle('blind'); return false\"><img src=\"http://static.juick.com/message-menu-icon.png\"></a><ul id=\"msg-menu-" + msg.MID + "\">");
- out.println(" <li><a href=\"/post?body=%40" + msg.User.UName + "%20\">" + rb.getString("Send private message") + "</a></li>");
- out.println(" <li><a href=\"/post?body=BL%20%40" + msg.User.UName + "\">" + rb.getString("Block user") + "</a></li>");
- out.println(" </ul></div></div>");
+ out.println(" <div class=\"msg-ts\"><a href=\"/" + msg.MID + "#" + msg.RID + "\" title=\"" + msg.TimestampString + "\">" + PageTemplates.formatDate(msg.MinutesAgo, msg.TimestampString, locale) + "</a></div>");
out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>");
out.println(" <div class=\"msg-txt\">" + msg.Text + "</div>");
out.print(" <div class=\"msg-links\">/" + msg.RID);