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

v1.18.x
Julian Lam 11 years ago
commit 21685f8c84

@ -1,5 +1,5 @@
# <img alt="NodeBB" src="http://i.imgur.com/3yj1n6N.png" />
![Dependency Management powered by David.](https://david-dm.org/designcreateplay/NodeBB.png)
[![Dependency Status](https://david-dm.org/designcreateplay/nodebb.png)](https://david-dm.org/designcreateplay/nodebb)
**NodeBB Forum Software** is powered by Node.js and built on a Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB is compatible down to IE8 and has many modern features out of the box such as social network integration and streaming discussions.

@ -484,7 +484,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
$('#post-container').on('shown.bs.dropdown', '.share-dropdown', function() {
var pid = $(this).parents('.post-row').attr('data-pid');
$('#post_' + pid + '_link').val(window.location.href + "#" + pid);
$('#post_' + pid + '_link').val(window.location.protocol + '//' + window.location.host + window.location.pathname + '#' + pid);
// without the setTimeout can't select the text in the input
setTimeout(function() {
$('#post_' + pid + '_link').putCursorAtEnd().select();
@ -1055,7 +1055,6 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
offset = 0;
}
if($('#post_anchor_' + pid).length) {
return scrollToPid(pid);
}
@ -1093,8 +1092,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
tid = $('#post-container').attr('data-tid');
function animateScroll() {
$('window,html').animate({
scrollTop: scrollTo.offset().top - $('#header-menu').height() - offset
$("html, body").animate({
scrollTop: (scrollTo.offset().top - $('#header-menu').height() - offset) + "px"
}, duration !== undefined ? duration : 400, function() {
updateHeader();
});

@ -410,7 +410,8 @@
} else {
// clean up all undefined conditionals
template = template.replace(/<!-- ELSE -->/gi, 'ENDIF -->')
.replace(/<!-- IF([^@]*?)ENDIF([^@]*?)-->/gi, '');
.replace(/<!-- IF([^@]*?)ENDIF([^@]*?)-->/gi, '')
.replace(/<!-- ENDIF ([^@]*?)-->/gi, '');
}
return template;

@ -43,11 +43,7 @@
todo: add a check for config.allowTopicsThumbnail if issue#1066 is a win
-->
<a href="../../user/{topics.userslug}" class="pull-left">
<!-- IF topics.thumb -->
<img src="{topics.thumb}" class="img-rounded user-img" title="{topics.username}"/>
<!-- ELSE -->
<img src="{topics.picture}" class="img-rounded user-img" title="{topics.username}"/>
<!-- ENDIF topics.thumb -->
<img src="<!-- IF topics.thumb -->{topics.thumb}<!-- ELSE -->{topics.picture}<!-- ENDIF topics.thumb -->" class="img-rounded user-img" title="{topics.username}"/>
</a>
<h3>

@ -75,7 +75,7 @@
<div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
<div class="text-center">
<div class="text-center instructions">
<span>
<small>[[topic:composer.content_is_parsed_with]] <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>. </small>
<span class="upload-instructions hide"><small>[[topic:composer.upload_instructions]]</small></span>

@ -8,7 +8,6 @@
<input type="hidden" template-variable="topic_name" value="{topic_name}" />
<input type="hidden" template-variable="postcount" value="{postcount}" />
<div class="topic">
<ol class="breadcrumb">
<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
@ -307,3 +306,9 @@
</div>
</div>
<div widget-area="footer" class="col-xs-12">
<!-- BEGIN widgets -->
{widgets.html}
<!-- END widgets -->
</div>

@ -65,8 +65,6 @@ var winston = require('winston'),
return callback(err);
}
db.decrObjectField('global', 'topicCount');
ThreadTools.lock(tid);
Plugins.fireHook('action:topic.delete', tid);
@ -101,10 +99,10 @@ var winston = require('winston'),
return callback(err);
}
db.incrObjectField('global', 'topicCount');
ThreadTools.unlock(tid);
Plugins.fireHook('action:topic.restore', tid);
events.logTopicRestore(uid, tid);
websockets.emitTopicPostStats();
@ -113,8 +111,6 @@ var winston = require('winston'),
tid: tid
});
Plugins.fireHook('action:topic.restore', tid);
callback(null, {
tid:tid
});
@ -134,7 +130,7 @@ var winston = require('winston'),
tid: tid
});
}
}
};
ThreadTools.unlock = function(tid, uid, callback) {
topics.setTopicField(tid, 'locked', 0);

@ -325,13 +325,13 @@ var async = require('async'),
Topics.getTopicDataWithUser = function(tid, callback) {
Topics.getTopicData(tid, function(err, topic) {
if(err) {
return callback(err, null);
if(err || !topic) {
return callback(err || new Error('topic doesn\'t exist'));
}
user.getUserFields(topic.uid, ['username', 'userslug', 'picture'] , function(err, userData) {
if(err) {
return callback(err, null);
return callback(err);
}
topic.username = userData.username;
@ -859,11 +859,7 @@ var async = require('async'),
}
function getReadStatus(next) {
if (uid && parseInt(uid, 10) > 0) {
Topics.hasReadTopic(tid, uid, next);
} else {
next(null, null);
}
Topics.hasReadTopic(tid, uid, next);
}
function getTeaser(next) {
@ -1158,6 +1154,16 @@ var async = require('async'),
});
}
Topics.updateTopicCount = function(callback) {
db.sortedSetCard('topics:recent', function(err, count) {
if(err) {
return callback(err);
}
db.setObjectField('global', 'topicCount', count, callback);
});
};
Topics.delete = function(tid, callback) {
async.parallel([
function(next) {
@ -1180,7 +1186,13 @@ var async = require('async'),
db.incrObjectFieldBy('category:' + cid, 'topic_count', -1, next);
});
}
], callback);
], function(err) {
if (err) {
return callback(err);
}
Topics.updateTopicCount(callback);
});
};
Topics.restore = function(tid, callback) {
@ -1210,7 +1222,13 @@ var async = require('async'),
db.incrObjectFieldBy('category:' + cid, 'topic_count', 1, next);
});
}
], callback);
], function(err) {
if (err) {
return callback(err);
}
Topics.updateTopicCount(callback);
});
});
};
}(exports));

Loading…
Cancel
Save