more style updates to topic + very basic quoting feature in, needs to be looked at in future

v1.18.x
psychobunny 12 years ago
parent ed26728a0f
commit e766cc0c64

@ -143,6 +143,8 @@ footer.footer {
.profile-image-block {
background: white;
display: inline-block;
text-align: center;
font-size: 12px;
}
li {
padding-bottom: 15px;
@ -170,16 +172,12 @@ footer.footer {
padding: 5px;
padding-left: 10px;
}
.post-content {
min-height: 50px;
padding: 2px 5px 0 5px;
}
.post-block {
.caret {
margin-top: -10px;
margin-left: -18px;
display: block;
border-width: 8px 8px 8px 0;
border-color: transparent #ddd transparent;
}
.post-buttons {
font-size: 12px;
float: right;
@ -199,9 +197,6 @@ footer.footer {
background: #fff;
}
li:last-child {
border-bottom: 0;
}
}
#user_label {

@ -9,18 +9,18 @@
<!-- BEGIN posts -->
<li class="row">
<div class="span1 profile-image-block">
<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
<img src="https://en.gravatar.com/userimage/18452752/f59e713c717466d2f5ad2a6970769f32.png" align="left" />
<i class="icon-star"></i>2432
</div>
<div class="span11">
<div class="post-block">
<p>{posts.content}</p>
<div id="content_{posts.pid}" class="post-content">{posts.content}</div>
<!--<p>Posted {posts.relativeTime} by user {posts.uid}.</p>-->
<div class="profile-block">
posted by <strong>psychobunny</strong> {posts.relativeTime}
<span class="post-buttons">
<div class="quote"><i class="icon-quote-left"></i></div>
<div id="quote_{posts.pid}" class="quote"><i class="icon-quote-left"></i></div>
<div class="favourite"><i class="icon-star-empty"></i></div>
<div class="post_reply">Reply <i class="icon-reply"></i></div>
</span>
@ -36,11 +36,14 @@
<script type="text/javascript">
jQuery('.post_reply').click(function() {
app.open_post_window('reply', "{TOPIC_ID}", "{TOPIC_NAME}");
app.open_post_window('reply', "{topic_id}", "{topic_name}");
});
jQuery('.quote').click(function() {
app.open_post_window('quote', "{TOPIC_ID}", "{TOPIC_NAME}");
app.open_post_window('quote', "{topic_id}", "{topic_name}");
// this needs to be looked at, obviously. only single line quotes work well I think maybe replace all \r\n with > ?
document.getElementById('post_content').innerHTML = '> ' + document.getElementById('content_' + this.id.replace('quote_', '')).innerHTML;
});
jQuery('.favourite').click(function() {

@ -21,12 +21,14 @@ var RDB = require('./redis.js'),
RDB.lrange('tid:' + tid + ':posts', start, end, function(pids) {
var content = [],
uid = [],
timestamp = [];
timestamp = [],
pid = [];
for (var i=0, ii=pids.length; i<ii; i++) {
content.push('pid:' + pids[i] + ':content');
uid.push('pid:' + pids[i] + ':uid');
timestamp.push('pid:' + pids[i] + ':timestamp');
pid.push(pids[i]);
}
if (pids.length > 0) {
@ -42,6 +44,7 @@ var RDB = require('./redis.js'),
var posts = [];
for (var i=0, ii=content.length; i<ii; i++) {
posts.push({
'pid' : pid[i],
'content' : marked(content[i]),
'uid' : uid[i],
'timestamp' : timestamp[i],
@ -49,7 +52,7 @@ var RDB = require('./redis.js'),
});
}
callback({'TOPIC_NAME':topic_name, 'TOPIC_ID': tid, 'posts': posts});
callback({'topic_name':topic_name, 'topic_id': tid, 'posts': posts});
});
} else {
callback({});

Loading…
Cancel
Save