From 3184680827e2a611e71c57dd2a74c4e7e754b8a6 Mon Sep 17 00:00:00 2001
From: Ugnich Anton
Date: Sun, 8 Dec 2013 16:38:38 +0700
Subject: attachCommentPhoto
---
web/scripts3.js | 25 ++++++++++++++++++++-----
web/style3.css | 7 +++++--
2 files changed, 25 insertions(+), 7 deletions(-)
(limited to 'web')
diff --git a/web/scripts3.js b/web/scripts3.js
index 087a2d66..dc2cc330 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -117,7 +117,7 @@ function showGroup(gid) {
""+
"
"+item.body+"
"+
photo+
- ""+
+ ""+
replies
);
ul.append(li);
@@ -173,7 +173,7 @@ function showMessages(param) {
""+
""+item.body+"
"+
photo+
- ""+
+ ""+
replies
);
ul.append(li);
@@ -225,7 +225,7 @@ function showMessage(mid) {
""+
""+post.body+"
"+
photo+
- ""
+ ""
);
ul.append(li);
@@ -423,7 +423,7 @@ function showCommentForm(mid,rid) {
var c=$('#replies #'+rid+' .msg-comment');
c.wrap('');
c.before('');
- c.append('');
+ c.append('');
}
// $('#replies #'+rid+' .msg-links').hide();
$('#replies #'+rid+' .msg-comment').show();
@@ -435,6 +435,20 @@ function showCommentForm(mid,rid) {
return false;
}
+function attachCommentPhoto(div) {
+ if($(div).children().length===0) {
+ var inp=$('');
+ inp.on('change',function() {
+ $(this).parent().attr('class','attach-photo-active');
+ });
+ inp.trigger('click');
+ $(div).append(inp);
+ } else {
+ $(div).empty();
+ $(div).attr('class','attach-photo');
+ }
+}
+
function unfoldReply() {
if((0+window.location.hash.substring(1))>0) {
var el=$(window.location.hash);
@@ -795,7 +809,8 @@ $(document).ready(function() {
});
tareply.click(function () {
$(this).addClass("narrow");
- $(this).after('');
+ $(this).after('');
+ $(this).parent().after('');
$(this).off('click');
});
diff --git a/web/style3.css b/web/style3.css
index 1a2c15c1..c23d2c1d 100644
--- a/web/style3.css
+++ b/web/style3.css
@@ -62,8 +62,11 @@ pre { white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap;
.msg-links { font-size: small; color: #999; margin: 5px 0 0 0; }
.msg-comments { overflow: hidden; font-size: small; color: #AAA; text-indent: 10px; margin-top: 10px; }
.msg-comment { margin: 5px 0; }
-.msg-comment textarea { width: 506px; padding: 2px; resize: vertical; vertical-align: top; min-height: 12pt; height: 12pt; border: 1px solid #DDD; }
-.msg-comment .narrow { width: 450px; }
+.ta-wrapper { display: inline-block; border: 1px solid #DDD; }
+.msg-comment textarea { width: 506px; padding: 2px; resize: vertical; vertical-align: top; min-height: 12pt; height: 12pt; border: 0; }
+.msg-comment .narrow { width: 425px; }
+.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; }
.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; }
--
cgit v1.2.3