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);
if($('#post-container .sub-posts').length > 1) {
if($('#post-container .posts .post-row').length > 1) {
$('.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');
function updateHeader() {
@ -776,10 +776,6 @@ define(function() {
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.parentNode.style.display = 'block';
@ -790,8 +786,6 @@ define(function() {
if (scrollTop < 50 && postcount > 1) {
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;
return;
}
@ -799,7 +793,7 @@ define(function() {
var count = 0, smallestNonNegative = 0;
jQuery('.sub-posts').each(function() {
jQuery('.posts > .post-row').each(function() {
count++;
this.postnumber = count;
@ -819,8 +813,6 @@ define(function() {
}
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 -->
</ul>
<ul id="logged-in-menu" class="nav navbar-nav navbar-right hide">
<li>
<a href="#" id="reconnect"></a>
@ -135,11 +134,15 @@
</li>
</ul>
<div class="pagination-block">
<i class="icon-upload pointer"></i>
<span id="pagination"></span>
<i class="icon-upload pointer icon-rotate-180"></i>
</div>
<ul class="nav navbar-nav navbar-right pagination-block">
<li class="active">
<a>
<i class="icon-upload pointer"></i>
<span id="pagination"></span>
<i class="icon-upload pointer icon-rotate-180"></i>
</a>
</li>
</ul>
</div>
</div>
</div>

@ -153,17 +153,6 @@
<div style="clear:both;"></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 class="modal-dialog">
<div class="modal-content">

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

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

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

@ -13,7 +13,7 @@ var cookie = require('cookie'),
client: RDB,
ttl: 60 * 60 * 24 * 14
}),
user = require('./user'),
Groups = require('./groups'),
posts = require('./posts'),
@ -31,7 +31,7 @@ var cookie = require('cookie'),
'categories': require('./admin/categories'),
'user': require('./admin/user')
},
plugins = require('./plugins');
plugins = require('./plugins');
var users = {},
@ -578,7 +578,7 @@ module.exports.init = function(io) {
}
posts.getTopicPostStats();
io.sockets.in('topic_' + data.tid).emit('event:post_deleted', {
pid: data.pid
});
@ -591,9 +591,9 @@ module.exports.init = function(io) {
if(err) {
return callback(err);
}
posts.getTopicPostStats();
io.sockets.in('topic_' + data.tid).emit('event:post_restored', {
pid: data.pid
});
@ -861,7 +861,7 @@ module.exports.init = function(io) {
});
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));
});
});

Loading…
Cancel
Save