diff options
author | Ugnich Anton | 2013-09-08 16:59:47 +0700 |
---|---|---|
committer | Ugnich Anton | 2013-09-08 16:59:47 +0700 |
commit | f284025bba8c1812d9093e266428dc670258d673 (patch) | |
tree | 166fe4d39d162a4405ab8ced4cc63768fcc35120 | |
parent | 02fa30624211b46c8f2adcd0c459ffeb1c35a743 (diff) |
dev
-rw-r--r-- | src/java/com/juick/http/www/Dev.java | 25 | ||||
-rw-r--r-- | web/scripts4.js | 17 | ||||
-rw-r--r-- | web/style4.css | 7 |
3 files changed, 23 insertions, 26 deletions
diff --git a/src/java/com/juick/http/www/Dev.java b/src/java/com/juick/http/www/Dev.java index 480491e0..cfd54aea 100644 --- a/src/java/com/juick/http/www/Dev.java +++ b/src/java/com/juick/http/www/Dev.java @@ -17,11 +17,12 @@ */ package com.juick.http.www; +import com.juick.json.Users; +import com.juick.server.PMQueries; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; -import java.util.Locale; -import java.util.ResourceBundle; +import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -51,13 +52,33 @@ public class Dev { out.println("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>"); out.println("<script type=\"text/javascript\" src=\"//static.juick.com/scripts4.js\"></script>"); out.println("<title>Juick</title>"); + out.println("<link id=\"favicon\" rel=\"icon\" href=\"//i.juick.com/favicon.png\"/>"); out.println("</head>"); out.flush(); out.println("<body>"); + out.println("<div id=\"toppanel\"></div>"); + out.println("<div id=\"content\"></div>"); + out.println("<div id=\"bottompanel\"></div>"); + out.println("<div id=\"sidepanel\">"); + out.println(" <ul id=\"groupslist\">"); + out.println(" <li><a href=\"#\" onclick=\"return showMessages('')\">All messages</a></li>"); + out.println(" </ul>"); + out.println(" <hr/>"); + out.println(" <ul id=\"pmulist\"></ul>"); + out.println("</div>"); + + ArrayList<com.juick.User> lastconv = PMQueries.getPMLastConversationsUsers(sql, visitor.UID, 10); + String lastConvJSON = Users.arrayToString(lastconv); + out.println("<script type=\"text/javascript\">"); out.println("var hash='" + Utils.getCookie(request, "hash") + "';"); out.println("var user_id=" + visitor.UID + ";"); + out.println("var lastConversations=" + lastConvJSON + ";"); + out.println("$(document).ready(function() {"); + out.println(" initPMUList(lastConversations);"); + out.println(" initWS();"); + out.println("});"); out.println("</script>"); out.println("</body></html>"); diff --git a/web/scripts4.js b/web/scripts4.js deleted file mode 100644 index f417dfc4..00000000 --- a/web/scripts4.js +++ /dev/null @@ -1,17 +0,0 @@ -function blogsLoadPM(uname) { - $.getJSON('http://api.juick.com/pm?hash='+hash+'&uname='+uname+'&callback=?').done(function(data) { - var ul=$('#content>ul'); - ul.empty(); - $("p.page").hide(); - $.each(data,function(i,item) { - var li=$("<li/>"); - if(item.user) { - li.attr("class","pm-in"); - } else { - li.attr("class","pm-out"); - } - li.text(item.body); - li.appendTo(ul); - }); - }); -} diff --git a/web/style4.css b/web/style4.css deleted file mode 100644 index 91a219d0..00000000 --- a/web/style4.css +++ /dev/null @@ -1,7 +0,0 @@ -.pm-in,.pm-out { background: #FFF; border: 1px solid #E0E0E0; margin: 10px 0; padding: 10px; } -.pm-in { width: 85%; } -.pm-out { margin-left: 15%; } - -#pmulist li { overflow: hidden; } -#pmulist img { width: 32px; height: 32px; margin-right: 5px; vertical-align: middle; } -#pmulist .unreadcnt { float: right; margin-top: 4px; background: #CCC; padding: 1px 3px; } |