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 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'web/scripts3.js') 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); -- cgit v1.2.3