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

v1.18.x
Julian Lam 11 years ago
commit 3f70d45f3d

@ -36,7 +36,7 @@ define(function() {
app.enterRoom('topic_' + tid); app.enterRoom('topic_' + tid);
if($('#post-container .sub-posts').length > 1) { if($('#post-container .posts .post-row').length > 1) {
$('.topic-main-buttons').removeClass('hide').parent().removeClass('hide'); $('.topic-main-buttons').removeClass('hide').parent().removeClass('hide');
} }
@ -764,7 +764,7 @@ define(function() {
var postAuthorImage, mobileAuthorOverlay, pagination; var pagination;
var postcount = templates.get('postcount'); var postcount = templates.get('postcount');
function updateHeader() { function updateHeader() {
@ -776,10 +776,6 @@ define(function() {
app.scrollToBottom(); app.scrollToBottom();
}); });
} }
jQuery('.mobile-author-overlay').css('bottom', '0px');
postAuthorImage = postAuthorImage || document.getElementById('mobile-author-image');
mobileAuthorOverlay = mobileAuthorOverlay || document.getElementById('mobile-author-overlay');
pagination = pagination || document.getElementById('pagination'); pagination = pagination || document.getElementById('pagination');
pagination.parentNode.style.display = 'block'; pagination.parentNode.style.display = 'block';
@ -790,8 +786,6 @@ define(function() {
if (scrollTop < 50 && postcount > 1) { if (scrollTop < 50 && postcount > 1) {
localStorage.removeItem("topic:" + tid + ":bookmark"); localStorage.removeItem("topic:" + tid + ":bookmark");
postAuthorImage.src = (jQuery('.posts .avatar img').attr('src'));
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery('.posts').attr('data-username') + ', ' + jQuery('.posts').find('.relativeTimeAgo').html();
pagination.innerHTML = '0 out of ' + postcount; pagination.innerHTML = '0 out of ' + postcount;
return; return;
} }
@ -799,7 +793,7 @@ define(function() {
var count = 0, smallestNonNegative = 0; var count = 0, smallestNonNegative = 0;
jQuery('.sub-posts').each(function() { jQuery('.posts > .post-row').each(function() {
count++; count++;
this.postnumber = count; this.postnumber = count;
@ -819,8 +813,6 @@ define(function() {
} }
pagination.innerHTML = this.postnumber + ' out of ' + postcount; pagination.innerHTML = this.postnumber + ' out of ' + postcount;
postAuthorImage.src = (jQuery(this).find('.profile-image-block img').attr('src'));
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html();
} }
}); });

@ -72,7 +72,6 @@
<!-- END navigation --> <!-- END navigation -->
</ul> </ul>
<ul id="logged-in-menu" class="nav navbar-nav navbar-right hide"> <ul id="logged-in-menu" class="nav navbar-nav navbar-right hide">
<li> <li>
<a href="#" id="reconnect"></a> <a href="#" id="reconnect"></a>
@ -135,11 +134,15 @@
</li> </li>
</ul> </ul>
<div class="pagination-block"> <ul class="nav navbar-nav navbar-right pagination-block">
<i class="icon-upload pointer"></i> <li class="active">
<span id="pagination"></span> <a>
<i class="icon-upload pointer icon-rotate-180"></i> <i class="icon-upload pointer"></i>
</div> <span id="pagination"></span>
<i class="icon-upload pointer icon-rotate-180"></i>
</a>
</li>
</ul>
</div> </div>
</div> </div>
</div> </div>

@ -153,17 +153,6 @@
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<div class="mobile-author-overlay">
<div class="row">
<div class="col-xs-3">
<img id="mobile-author-image" src="" width=50 height=50 />
</div>
<div class="col-xs-9">
<h4><div id="mobile-author-overlay"></div></h4>
</div>
</div>
</div>
<div id="move_thread_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="Move Topic" aria-hidden="true"> <div id="move_thread_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="Move Topic" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">

@ -244,7 +244,7 @@ var user = require('./../user.js'),
}); });
app.get('/topics', function (req, res) { app.get('/topics', function (req, res) {
topics.getAllTopics(10, null, function (topics) { topics.getAllTopics(10, null, function (err, topics) {
res.json({ res.json({
topics: topics, topics: topics,
notopics: topics.length === 0 notopics: topics.length === 0

@ -43,7 +43,7 @@ var path = require('path'),
}, },
function(next) { function(next) {
var topicUrls = []; var topicUrls = [];
topics.getAllTopics(null, null, function(topics) { topics.getAllTopics(null, null, function(err, topics) {
topics.forEach(function(topic) { topics.forEach(function(topic) {
if (topic.deleted !== '1') { if (topic.deleted !== '1') {
topicUrls.push({ topicUrls.push({

@ -102,6 +102,8 @@ var RDB = require('./redis.js'),
threadTools.toggleFollow(tid, uid); threadTools.toggleFollow(tid, uid);
Topics.getTopicForCategoryView(tid, uid, function(topicData) { Topics.getTopicForCategoryView(tid, uid, function(topicData) {
topicData.unreplied = 1;
callback(null, { callback(null, {
topicData: topicData, topicData: topicData,
postData: postData postData: postData
@ -585,6 +587,10 @@ var RDB = require('./redis.js'),
Topics.getAllTopics = function(limit, after, callback) { Topics.getAllTopics = function(limit, after, callback) {
RDB.smembers('topics:tid', function(err, tids) { RDB.smembers('topics:tid', function(err, tids) {
if(err) {
return callback(err, null);
}
var topics = [], var topics = [],
numTids, x; numTids, x;
@ -620,7 +626,7 @@ var RDB = require('./redis.js'),
next(); next();
}); });
}, function(err) { }, function(err) {
callback(topics); callback(err, topics);
}); });
}); });
} }

@ -13,7 +13,7 @@ var cookie = require('cookie'),
client: RDB, client: RDB,
ttl: 60 * 60 * 24 * 14 ttl: 60 * 60 * 24 * 14
}), }),
user = require('./user'), user = require('./user'),
Groups = require('./groups'), Groups = require('./groups'),
posts = require('./posts'), posts = require('./posts'),
@ -31,7 +31,7 @@ var cookie = require('cookie'),
'categories': require('./admin/categories'), 'categories': require('./admin/categories'),
'user': require('./admin/user') 'user': require('./admin/user')
}, },
plugins = require('./plugins'); plugins = require('./plugins');
var users = {}, var users = {},
@ -578,7 +578,7 @@ module.exports.init = function(io) {
} }
posts.getTopicPostStats(); posts.getTopicPostStats();
io.sockets.in('topic_' + data.tid).emit('event:post_deleted', { io.sockets.in('topic_' + data.tid).emit('event:post_deleted', {
pid: data.pid pid: data.pid
}); });
@ -591,9 +591,9 @@ module.exports.init = function(io) {
if(err) { if(err) {
return callback(err); return callback(err);
} }
posts.getTopicPostStats(); posts.getTopicPostStats();
io.sockets.in('topic_' + data.tid).emit('event:post_restored', { io.sockets.in('topic_' + data.tid).emit('event:post_restored', {
pid: data.pid pid: data.pid
}); });
@ -861,7 +861,7 @@ module.exports.init = function(io) {
}); });
socket.on('api:admin.topics.getMore', function(data, callback) { socket.on('api:admin.topics.getMore', function(data, callback) {
topics.getAllTopics(data.limit, data.after, function(topics) { topics.getAllTopics(data.limit, data.after, function(err, topics) {
callback(JSON.stringify(topics)); callback(JSON.stringify(topics));
}); });
}); });

Loading…
Cancel
Save