diff options
author | Ugnich Anton | 2012-10-23 01:44:58 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-10-23 01:44:58 +0700 |
commit | 9b94011a09685dec1b1b38fef8294c6ffa578079 (patch) | |
tree | ab6808f9f10a29628d9bb93905b1fcd3c2887b43 /src/java/com/juick/http/www/UserThread.java | |
parent | adfc38138808eede6bcc29a706c9191e7d2d84fe (diff) |
JS/CSS optimization
Diffstat (limited to 'src/java/com/juick/http/www/UserThread.java')
-rw-r--r-- | src/java/com/juick/http/www/UserThread.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 320c62ba..c335fcb9 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -83,11 +83,6 @@ public class UserThread { out.println("</div>"); out.println("</div>"); // topwrapper - out.println("<script type=\"text/javascript\">"); - out.println("$(document).ready(unfoldReply);"); - out.println("$(window).bind('hashchange',unfoldReply);"); - out.println("</script>"); - PageTemplates.pageFooter(request, out, locale, visitor); } finally { out.close(); @@ -150,16 +145,13 @@ public class UserThread { if (rs.getString(11).equals("jpg")) { 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\">"); - out.println(" inlinevideo(" + mid + ");"); - out.println(" </script>"); + out.println(" <div class=\"msg-media\"><div id=\"video-" + mid + "\"><a href=\"http://i.juick.com/video/" + mid + ".mp4\" onclick=\"inlinevideo(" + mid + "); return false\"><img src=\"http://i.juick.com/thumbs/" + mid + ".jpg\" alt=\"\"/></a></div></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=\""+rb.getString("Add a comment")+"\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>"); + out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"" + rb.getString("Add a comment") + "\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>"); out.println(" </form>"); } @@ -238,10 +230,10 @@ public class UserThread { if (listview) { out.print("<a href=\"?view=tree\">" + rbuser.getString("View as tree") + "</a>"); } else { - out.print("<a href=\"#\" onclick=\"$('#replies>li').show(); $('#replies .msg-comments').hide(); return false\">" + rbuser.getString("Expand all") + "</a> · <a href=\"?view=list\">" + rbuser.getString("View as list") + "</a>"); + out.print("<span id=\"unfoldall\"><a href=\"#\" onclick=\"$('#replies>li').show(); $('#replies .msg-comments').hide(); $('#unfoldall').hide(); return false\">" + rbuser.getString("Expand all") + "</a> · </span><a href=\"?view=list\">" + rbuser.getString("View as list") + "</a>"); } out.print("</div>"); - out.println(" <h2>"+rbuser.getString("Replies")+" (" + replies.size() + ")</h2>"); + out.println(" <h2>" + rbuser.getString("Replies") + " (" + replies.size() + ")</h2>"); out.println("</div>"); out.println("<ul id=\"replies\">"); @@ -282,10 +274,7 @@ public class UserThread { if (msg.AttachmentType.equals("jpg")) { out.println(" <div class=\"msg-media\"><img src=\"http://i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></div>"); } else { - out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><b>Attachment: <a href=\"http://i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\">Video</a></b></div></div>"); - out.println(" <script type=\"text/javascript\">"); - out.println(" inlinevideo('" + msg.MID + "-" + msg.RID + "');"); - out.println(" </script>"); + out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><a href=\"http://i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\" onclick=\"inlinevideo(" + msg.MID + "-" + msg.RID + "); return false\"><img src=\"http://i.juick.com/thumbs/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div></div>"); } } 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>"); @@ -318,10 +307,7 @@ public class UserThread { if (msg.AttachmentType.equals("jpg")) { out.println(" <div class=\"msg-media\"><img src=\"http://i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></div>"); } else { - out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><b>Attachment: <a href=\"http://i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\">Video</a></b></div></div>"); - out.println(" <script type=\"text/javascript\">"); - out.println(" inlinevideo('" + msg.MID + "-" + msg.RID + "');"); - out.println(" </script>"); + out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><a href=\"http://i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\" onclick=\"inlinevideo(" + msg.MID + "-" + msg.RID + "); return false\"><img src=\"http://i.juick.com/thumbs/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div></div>"); } } out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"http://i.juick.com/a/" + msg.User.UID + ".png\"></a></div>"); |