From 4fb2d4cad66b24efff2913c3058e2ed581bbef39 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Wed, 12 Mar 2014 02:20:20 +0700 Subject: New post form --- src/java/com/juick/http/www/Home.java | 13 +++++++++ src/java/com/juick/http/www/PageTemplates.java | 6 ++-- web/scripts3.js | 39 +++++++++++++++++++------- web/style3.css | 15 ++++++++-- 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/java/com/juick/http/www/Home.java b/src/java/com/juick/http/www/Home.java index c3a93107..41e85c0d 100644 --- a/src/java/com/juick/http/www/Home.java +++ b/src/java/com/juick/http/www/Home.java @@ -106,6 +106,19 @@ public class Home { out.println(""); } + if (visitor != null) { + out.println("
"); + } + if (mids.size() > 0) { int ad_mid = 0; if (visitor != null && (paramShow == null || paramShow.equals("top") || paramShow.equals("all"))) { diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index bb89ea4d..a6d278bf 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -52,9 +52,9 @@ public class PageTemplates { out.println(""); out.print(""); out.print(""); - out.print(""); + out.print(""); out.print(""); - out.print(""); + out.print(""); if (headers != null) { out.print(headers); } @@ -87,7 +87,7 @@ public class PageTemplates { out.print("Пожалуйста, введите теги сообщения
'); + return false; + } else if($('#newmessage textarea').val().length==0) { + openDialog('Пожалуйста, введите текст сообщения
'); + return false; + } + return true; } function showMoreReplies(id) { @@ -490,29 +512,26 @@ jQuery.fn.selectText = function(){ /******************************************************************************/ $(document).ready(function() { - var tareply=$('textarea.reply'); - tareply.autoResize({ + $('textarea').autoResize({ extraSpace: 0, minHeight: 1 }); - tareply.click(function () { + + $('textarea.reply').click(function () { $(this).addClass("narrow"); $(this).after(''); $(this).parent().after(''); $(this).off('click'); }); - var pmreply=$('textarea.replypm'); - pmreply.autoResize({ - extraSpace: 0, - minHeight: 1 - }); - pmreply.click(function () { + $('textarea.replypm').click(function () { $(this).addClass("narrowpm"); $(this).parent().after(''); $(this).off('click'); }); + unfoldPostForm(); unfoldReply(); + $(window).bind('hashchange',unfoldPostForm); $(window).bind('hashchange',unfoldReply); }); diff --git a/web/style3.css b/web/style3.css index 2fdcb5e3..b90d849e 100644 --- a/web/style3.css +++ b/web/style3.css @@ -1,5 +1,5 @@ html,body,div,h1,h2,ul,li,p,form,input,textarea,pre { margin: 0; padding: 0; } -html,input { font-family: sans-serif; font-size: 12pt; } +html,input,textarea { font-family: sans-serif; font-size: 12pt; } html { background: #EEEEE5; color: #000; } body { width: 1010px; margin: 0 auto; } h1,h2 { font-weight: normal; } @@ -38,6 +38,14 @@ body>header p { color: #000; font-size: 13pt; margin: 12px 0; text-align: center #content>p, #content>h1, #content>h2 { margin: 1em 0; } +#newmessage { background: #E5E5E0; padding: 15px; margin-bottom: 20px; text-align: right; } +#newmessage textarea { border: 1px solid #CCC; padding: 4px; width: 660px; resize: vertical; min-height: 14pt; height: 14pt; } +#newmessage>div { display: none; margin-top: 8px; } +#newmessage input { border: 1px solid #CCC; padding: 2px 4px; } +#newmessage .tags { width: 400px; float: left; } +#newmessage .attach-photo, #newmessage .attach-photo-active { margin-right: 10px; } +#newmessage .subm { width: 120px; background: #EEEEE5; } + article { margin: 10px 0 20px 58px; background: #FFF; padding: 12px 13px; } article>aside { margin: -12px 0 0 -71px; width: 48px; height: 48px; float: left; } article>aside img { width: 48px; height: 48px; } @@ -84,8 +92,8 @@ article input { width: 50px; margin-left: 6px; vertical-align: top; border: 1px .msg-comment textarea { width: 604px; padding: 2px; resize: vertical; vertical-align: top; min-height: 12pt; height: 12pt; border: 0; } .msg-comment .narrow { width: 524px; } .msg-comment .narrowpm { width: 550px; } -.attach-photo { display: inline-block; padding: 2px 4px; cursor: pointer; width: 16px; height: 13px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAQAAAAKsiavAAAAAXNSR0IArs4c6QAAAKRJREFUGNNjZICC6Q5M+xlQwD/HzAMMDEwwLnM9AxqAiDDO/M+AFzCh8B4zhrDwsfAxBjHcggkhm/CY2SDlHYQ5TZD5EoMMmgmMhSnvZnrPfDLzyQyvrPf/CzGs+L2TgYFhBoM0gzTjDAaGX7uwuQG/I1ldGRj+pzM8YXjMmMrAwOGK6cibfy2z3sMdeYpBBTMcHjMU/9zJzsjo8r8DIk1yQGEBAFzpL+AuTCqZAAAAAElFTkSuQmCC") no-repeat 3px 4px; } -.attach-photo-active { display: inline-block; padding: 2px 4px; cursor: pointer; width: 16px; height: 13px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAMAAACXZR4WAAAAAXNSR0IArs4c6QAAAEVQTFRFAAAAAJUAAJ0AAJIAAJkAAJYAAJwAAJcAAJoAAJgAAJkAAJoAAJoAAJgAAJkAAJoAAJkAAJkAAJkAAJkAAJkAAJkAAJkA9z3GXQAAABZ0Uk5TAAwNDg8REkBHSktRU1RVv9jZ2+Lj5OeV7PgAAABSSURBVAhbdcjBFkAgFADRIUlE9Or9/6daUC0cs5pzAXD65niKFSJQv/aChHHcrg4yA9jcILCW4tkbDGRVwfzDhs+yEBqcFsCmBiqHmULSDr0P3JdgDbuscEckAAAAAElFTkSuQmCC") no-repeat 3px 4px; } +.attach-photo { display: inline-block; padding: 2px 4px; cursor: pointer; width: 16px; height: 13px; overflow: hidden; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAQAAAAKsiavAAAAAXNSR0IArs4c6QAAAKRJREFUGNNjZICC6Q5M+xlQwD/HzAMMDEwwLnM9AxqAiDDO/M+AFzCh8B4zhrDwsfAxBjHcggkhm/CY2SDlHYQ5TZD5EoMMmgmMhSnvZnrPfDLzyQyvrPf/CzGs+L2TgYFhBoM0gzTjDAaGX7uwuQG/I1ldGRj+pzM8YXjMmMrAwOGK6cibfy2z3sMdeYpBBTMcHjMU/9zJzsjo8r8DIk1yQGEBAFzpL+AuTCqZAAAAAElFTkSuQmCC") no-repeat 3px 4px; } +.attach-photo-active { display: inline-block; padding: 2px 4px; cursor: pointer; width: 16px; height: 13px; overflow: hidden; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAMAAACXZR4WAAAAAXNSR0IArs4c6QAAAEVQTFRFAAAAAJUAAJ0AAJIAAJkAAJYAAJwAAJcAAJoAAJgAAJkAAJoAAJoAAJgAAJkAAJoAAJkAAJkAAJkAAJkAAJkAAJkAAJkA9z3GXQAAABZ0Uk5TAAwNDg8REkBHSktRU1RVv9jZ2+Lj5OeV7PgAAABSSURBVAhbdcjBFkAgFADRIUlE9Or9/6daUC0cs5pzAXD65niKFSJQv/aChHHcrg4yA9jcILCW4tkbDGRVwfzDhs+yEBqcFsCmBiqHmULSDr0P3JdgDbuscEckAAAAAElFTkSuQmCC") no-repeat 3px 4px; } .msg-comment input { width: 50px; margin-left: 6px; vertical-align: top; border: 1px solid #CCC; background: #EEE; color: #999; } .msg-recomms { margin-top: 10px; overflow: hidden; font-size: small; color: #AAA; text-indent: 10px; } blockquote { border-left: 1px dashed #CCC; margin: 10px 0 10px 10px; padding-left: 10px; } @@ -149,6 +157,7 @@ blockquote { border-left: 1px dashed #CCC; margin: 10px 0 10px 10px; padding-lef .dialogshare li { float: left; margin: 5px 10px 0 0; } .dialogshare a { display: block; width: 32px; height: 32px; background-image: url(//static.juick.com/sharesocial.png); } +.dialogtxt { background: #EEEEE5; padding: 20px; } /********/ #footer { clear: both; font-size: 10pt; padding: 10px 0; color: #999; } -- cgit v1.2.3