From 29a8f0ae0fdc27a03b723c7a9ad3be7f35db7b23 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Thu, 17 Apr 2014 15:40:27 +0700 Subject: NewMessage complete rewrite --- web/scripts3.js | 19 +++++++++++++++++-- web/style3.css | 14 +++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'web') diff --git a/web/scripts3.js b/web/scripts3.js index ca111020..c5fb472c 100644 --- a/web/scripts3.js +++ b/web/scripts3.js @@ -93,7 +93,7 @@ function showMoreReplies(id) { function showCommentForm(mid,rid) { if($('#replies #'+rid+' textarea').length==0) { var c=$('#replies #'+rid+' .msg-comment'); - c.wrap('
'); + c.wrap(''); c.before(''); c.append('
'); } @@ -110,7 +110,7 @@ function showCommentForm(mid,rid) { function showCommentFooter(e) { var a=$(e).closest("article"); if(a.find("footer.comm").length==0) { - a.append('
'); + a.append('
'); a.find('textarea').autoResize({ extraSpace: 0, minHeight: 1 @@ -134,6 +134,21 @@ function attachCommentPhoto(div) { } } +function attachMessagePhoto(div) { + var f=$(div).closest('form'); + if(f.find('input:file').length===0) { + var inp=$(''); + inp.on('change',function() { + $(div).text("загрузить (✓)"); + }); + f.append(inp); + inp.trigger('click'); + } else { + f.find('input:file').remove(); + $(div).text("загрузить"); + } +} + function unfoldReply() { if((0+window.location.hash.substring(1))>0) { var el=$(window.location.hash); diff --git a/web/style3.css b/web/style3.css index b8903e47..9c6eb890 100644 --- a/web/style3.css +++ b/web/style3.css @@ -38,13 +38,13 @@ 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: 688px; 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; } +#newmessage { background: #E5E5E0; padding: 15px; margin-bottom: 20px; } +#newmessage textarea { border: 1px solid #CCC; padding: 4px; width: 688px; resize: vertical; min-height: 14pt; height: 14pt; margin: 0 0 5px 0; } +#newmessage input { border: 1px solid #CCC; padding: 2px 4px; margin: 5px 0; } +#newmessage>div { display: none; } +#newmessage .img { width: 500px; } +#newmessage .tags { width: 500px; } +#newmessage .subm { width: 150px; 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; } -- cgit v1.2.3