aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-07-09 14:57:58 +0700
committerGravatar Ugnich Anton2014-07-09 14:57:58 +0700
commit7c9a7590f30873df16941057c59abdb4b8672836 (patch)
tree5e379532b670959ad3591015b741919ba60ee460
parent72b0f51fb006c8719219a58c3cab746cf766d2f7 (diff)
Change message privacy
-rw-r--r--src/java/com/juick/http/www/PageTemplates.java16
-rw-r--r--web/scripts3.js8
-rw-r--r--web/style3.css2
3 files changed, 22 insertions, 4 deletions
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java
index cefd3cdd..dabbea99 100644
--- a/src/java/com/juick/http/www/PageTemplates.java
+++ b/src/java/com/juick/http/www/PageTemplates.java
@@ -53,7 +53,7 @@ public class PageTemplates {
out.print("<head>");
out.print("<link rel=\"stylesheet\" href=\"/style.2014070300.css\"/>");
out.print("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>");
- out.print("<script type=\"text/javascript\" src=\"/scripts.2014062900.js\"></script>");
+ out.print("<script type=\"text/javascript\" src=\"/scripts.2014070500.js\"></script>");
if (headers != null) {
out.print(headers);
}
@@ -219,12 +219,19 @@ public class PageTemplates {
out.print("<a href=\"https://www.facebook.com/JuickCom\" rel=\"nofollow\" class=\"ico32-fb\">Facebook</a>");
out.println("</div>");
out.print(" <div id=\"footer-left\">juick.com &copy; 2008-2014");
- if (sapeon && sape != null && (visitor == null || visitor.UID == 1) && request.getQueryString() == null) {
- String links = sape.getPageLinks(request.getRequestURI(), request.getCookies()).render();
+
+ String queryString = request.getQueryString();
+ String requestURI = request.getRequestURI();
+ if (sapeon && sape != null && (visitor == null || visitor.UID == 1) && queryString == null) {
+ String links = sape.getPageLinks(requestURI, request.getCookies()).render();
if (links != null && !links.isEmpty()) {
out.print("<br/>Спонсоры: " + links);
}
}
+ if ((visitor == null || visitor.UID == 1) && queryString != null && requestURI != null && requestURI.equals("/")) {
+ out.print("<br/><a href=\"http://siam.li/\">сиам</a>");
+ }
+
out.println("</div>");
out.println("</div>");
@@ -529,6 +536,9 @@ public class PageTemplates {
out.print("<a href=\"#\" onclick=\"return showCommentFooter(this)\">Комментировать</a> ");
}
out.print("<a href=\"#\" onclick=\"return likeMessage(this," + msg.MID + ")\">Мне нравится</a>");
+ if (visitor != null && msg.Privacy < 0 && msg.User.UID == visitor.UID) {
+ out.print(" <a href=\"#\" onclick=\"return setPrivacy(this," + msg.MID + ")\">Открыть доступ</a>");
+ }
if (visitor != null && visitor.UID == 1) {
out.print(" <a href=\"#\" onclick=\"return setPopular(this," + msg.MID + ",2)\">+</a>");
out.print(" <a href=\"#\" onclick=\"return setPopular(this," + msg.MID + ",-1)\">-</a>");
diff --git a/web/scripts3.js b/web/scripts3.js
index e0a39fa4..9cb72a98 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -266,6 +266,14 @@ function setPopular(e,mid,popular) {
return false;
}
+function setPrivacy(e,mid) {
+ $.ajax('http://api.juick.com/messages/set_privacy?mid='+mid+'&hash='+hash).done(function() {
+ var a=$(e).closest("article");
+ a.append("<p>OK!</p>");
+ });
+ return false;
+}
+
/******************************************************************************/
jQuery.fn.selectText = function(){
diff --git a/web/style3.css b/web/style3.css
index b2369d03..0f23d6b4 100644
--- a/web/style3.css
+++ b/web/style3.css
@@ -175,7 +175,7 @@ blockquote { border-left: 1px dashed #CCC; margin: 10px 0 10px 10px; padding-lef
.dialogtxt { background: #EEEEE5; padding: 20px; }
/********/
-#footer { clear: both; font-size: 10pt; padding: 10px 0; color: #999; width: 1004px; margin: 0 auto; }
+#footer { clear: both; font-size: 10pt; padding: 10px 0; color: #999; width: 1004px; margin: 0 auto 20px 0; }
#footer-social { float: left; }
#footer-social a { display: inline-block; width: 32px; height: 32px; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; margin: 0 15px 0 0; }
#footer-left { margin-left: 286px; margin-right: 350px; }