Merge branch 'master' of github.com:designcreateplay/NodeBB

v1.18.x
Julian Lam 12 years ago
commit 78c1139ad9

@ -21,6 +21,13 @@
&.deleted { &.deleted {
-moz-opacity: 0.30; -moz-opacity: 0.30;
opacity: 0.30; opacity: 0.30;
height:30px;
overflow-y:hidden;
}
&.deleted-expanded {
height:100%;
overflow-y:default;
} }
} }

@ -205,10 +205,14 @@
var windowHeight = document.body.offsetHeight - $(window).height(), var windowHeight = document.body.offsetHeight - $(window).height(),
half = windowHeight / 2; half = windowHeight / 2;
if (document.body.scrollTop > half && !app.infiniteLoaderActive) { if (document.body.scrollTop > half && !app.infiniteLoaderActive && $('#post-container').children().length) {
app.loadMorePosts(tid); app.loadMorePosts(tid);
} }
}); });
$('.post-container').on('click', '.deleted', function(ev) {
$(this).toggleClass('deleted-expanded');
});
}); });
var reply_fn = function() { var reply_fn = function() {

@ -186,6 +186,11 @@ var RDB = require('./redis.js'),
Categories.getRecentReplies = function(cid, count, callback) { Categories.getRecentReplies = function(cid, count, callback) {
RDB.zrevrange('categories:recent_posts:cid:' + cid, 0, (count<10)?10:count, function(err, pids) { RDB.zrevrange('categories:recent_posts:cid:' + cid, 0, (count<10)?10:count, function(err, pids) {
if(err) {
console.log(err);
callback([]);
return;
}
if (pids.length == 0) { if (pids.length == 0) {
callback([]); callback([]);

@ -60,11 +60,15 @@ var RDB = require('./redis.js'),
function getPostSummary(pid, callback) { function getPostSummary(pid, callback) {
Posts.getPostFields(pid, ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) { Posts.getPostFields(pid, ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) {
if(postData.deleted === '1') { if(postData.deleted === '1') {
return; return callback(null);
} }
Posts.addUserInfoToPost(postData, function() { Posts.addUserInfoToPost(postData, function() {
topics.getTopicField(postData.tid, 'slug', function(topicSlug) { topics.getTopicField(postData.tid, 'slug', function(topicSlug) {
if(postData.content)
postData.content = utils.strip_tags(postTools.markdownToHTML(postData.content));
postData.topicSlug = topicSlug; postData.topicSlug = topicSlug;
returnData.push(postData); returnData.push(postData);
callback(null); callback(null);
@ -77,6 +81,8 @@ var RDB = require('./redis.js'),
async.eachSeries(pids, getPostSummary, function(err) { async.eachSeries(pids, getPostSummary, function(err) {
if(!err) { if(!err) {
callback(returnData); callback(returnData);
} else {
console.log(err);
} }
}); });
}; };

@ -26,6 +26,7 @@ var user = require('./../user.js'),
categories.getRecentReplies(category.cid, 2, function(posts) { categories.getRecentReplies(category.cid, 2, function(posts) {
category["posts"] = posts; category["posts"] = posts;
category["post_count"] = posts.length>2 ? 2 : posts.length; category["post_count"] = posts.length>2 ? 2 : posts.length;
console.log(category.cid, 'worked');
callback(null); callback(null);
}); });
} }

Loading…
Cancel
Save