From dc430dec23586fd8a6ed3a0cc272f7cb1d8a8d88 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 27 May 2017 13:52:55 +0300 Subject: readonly mode is now provided by Cloudflare --- .../main/java/com/juick/www/controllers/Help.java | 1 - .../main/java/com/juick/www/controllers/Home.java | 1 - .../java/com/juick/www/controllers/NewMessage.java | 39 +++-- .../main/java/com/juick/www/controllers/PM.java | 2 - .../com/juick/www/controllers/PageTemplates.java | 50 +++--- .../java/com/juick/www/controllers/Settings.java | 2 - .../java/com/juick/www/controllers/SignUp.java | 1 - .../main/java/com/juick/www/controllers/User.java | 4 - .../java/com/juick/www/controllers/UserThread.java | 8 +- juick-www/src/main/static/scripts.js | 167 ++++++++++----------- .../src/main/webapp/WEB-INF/layouts/content.html | 2 +- juick-www/src/main/webapp/WEB-INF/views/blog.html | 2 - juick-www/src/main/webapp/WEB-INF/views/index.html | 2 - .../webapp/WEB-INF/views/partial/navigation.html | 2 - .../webapp/WEB-INF/views/partial/newmessage.html | 4 - .../src/main/webapp/WEB-INF/views/pm_inbox.html | 2 - .../src/main/webapp/WEB-INF/views/pm_sent.html | 2 - 17 files changed, 123 insertions(+), 168 deletions(-) (limited to 'juick-www/src/main') diff --git a/juick-www/src/main/java/com/juick/www/controllers/Help.java b/juick-www/src/main/java/com/juick/www/controllers/Help.java index 847f5d88..602850de 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Help.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Help.java @@ -72,7 +72,6 @@ public class Help { model.addAttribute("navigation", navigation); model.addAttribute("content", content); model.addAttribute("visitor", visitor); - model.addAttribute("readonly", messagesService.isReadonly()); return "views/help"; } diff --git a/juick-www/src/main/java/com/juick/www/controllers/Home.java b/juick-www/src/main/java/com/juick/www/controllers/Home.java index 6aa18526..8e875f2f 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Home.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Home.java @@ -164,7 +164,6 @@ public class Home { model.addAttribute("title", title); model.addAttribute("headers", head); model.addAttribute("visitor", visitor); - model.addAttribute("readonly", messagesService.isReadonly()); model.addAttribute("noindex", paramShow == null && paramBefore == 0); List msgs = messagesService.getMessages(mids); diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java index 4de4f5e9..7875f52b 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java @@ -105,30 +105,27 @@ public class NewMessage { templates.pageNavigation(out, visitor, null); out.println("
"); - if (messagesService.isReadonly()) { - out.println("

Временно недоступно

"); + + out.println("
"); + out.println("

Место: Отменить

"); + out.println("

Фото: (JPG, PNG, до 10Мб)

"); + + String body = request.getParameter("body"); + if (body == null) { + body = StringUtils.EMPTY; } else { - out.println(""); - out.println("

Место: Отменить

"); - out.println("

Фото: (JPG, PNG, до 10Мб)

"); - - String body = request.getParameter("body"); - if (body == null) { - body = StringUtils.EMPTY; - } else { - if (body.length() > 4096) { - body = body.substring(0, 4096); - } - body = StringEscapeUtils.escapeHtml4(body); + if (body.length() > 4096) { + body = body.substring(0, 4096); } - out.println("


"); - - out.println("" + "" + "

"); - out.println("
"); - out.println("
"); - out.println("

Теги:

"); - printUserTags(out, visitor); + body = StringEscapeUtils.escapeHtml4(body); } + out.println("


"); + + out.println("" + "" + "

"); + out.println(""); + out.println("
"); + out.println("

Теги:

"); + printUserTags(out, visitor); out.println("
"); templates.pageFooter(request, out, visitor, false); diff --git a/juick-www/src/main/java/com/juick/www/controllers/PM.java b/juick-www/src/main/java/com/juick/www/controllers/PM.java index 82edb901..90fd14f8 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/PM.java +++ b/juick-www/src/main/java/com/juick/www/controllers/PM.java @@ -74,7 +74,6 @@ public class PM { model.addAttribute("visitor", visitor); model.addAttribute("msgs", msgs); model.addAttribute("tags", tagService.getPopularTags()); - model.addAttribute("readonly", messagesService.isReadonly()); return "views/pm_inbox"; } @@ -97,7 +96,6 @@ public class PM { model.addAttribute("msgs", msgs); model.addAttribute("tags", tagService.getPopularTags()); model.addAttribute("uname", uname); - model.addAttribute("readonly", messagesService.isReadonly()); return "views/pm_sent"; } diff --git a/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java b/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java index 9c6251b0..925d1013 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java +++ b/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java @@ -84,9 +84,9 @@ public class PageTemplates { out.println(""); out.flush(); if (visitor.getUid() > 0) { - out.println(""); + out.println(""); } else { - out.println(""); + out.println(""); } } @@ -112,9 +112,7 @@ public class PageTemplates { out.print("
  • Рекомендации
  • "); out.println(""); out.print(" "); @@ -334,29 +332,27 @@ public class PageTemplates { if (msg.getAttachmentType() != null) { out.println("
    "); } - if (!messagesService.isReadonly()) { - out.print(" "); + out.print(" "); out.print("