Merge remote-tracking branch 'origin/master' into category-whitelisting

v1.18.x
Julian Lam 11 years ago
commit 0a06f1ac7d

@ -3,7 +3,7 @@ define(function() {
loadingMoreTopics = false;
Unread.init = function() {
app.enter_room('recent_posts');
app.enterRoom('recent_posts');
ajaxify.register_events([
'event:new_topic',

@ -74,13 +74,18 @@
<button class="btn btn-sm btn-primary btn post_reply" type="button">[[topic:reply]] <i class="fa fa-reply"></i></button>
</div>
<div class="btn-group pull-right post-tools">
<button class="btn btn-sm btn-default link" type="button" title="[[topic:link]]"><i class="fa fa-link"></i></button>
<button class="btn btn-sm btn-default main-post facebook-share" type="button" title=""><i class="fa fa-facebook"></i></button>
<button class="btn btn-sm btn-default main-post twitter-share" type="button" title=""><i class="fa fa-twitter"></i></button>
<button class="btn btn-sm btn-default main-post google-share" type="button" title=""><i class="fa fa-google-plus"></i></button>
<button class="btn btn-sm btn-default edit {posts.display_moderator_tools}" type="button" title="[[topic:edit]]"><i class="fa fa-pencil"></i></button>
<button class="btn btn-sm btn-default delete {posts.display_moderator_tools}" type="button" title="[[topic:delete]]"><i class="fa fa-trash-o"></i></button>
<div class="pull-right">
<div class="btn-group post-tools">
<button class="btn btn-sm btn-default link" type="button" title="[[topic:link]]"><i class="fa fa-link"></i></button>
<button class="btn btn-sm btn-default facebook-share" type="button" title=""><i class="fa fa-facebook"></i></button>
<button class="btn btn-sm btn-default twitter-share" type="button" title=""><i class="fa fa-twitter"></i></button>
<button class="btn btn-sm btn-default google-share" type="button" title=""><i class="fa fa-google-plus"></i></button>
</div>
<div class="btn-group post-tools">
<button class="btn btn-sm btn-default edit {posts.display_moderator_tools}" type="button" title="[[topic:edit]]"><i class="fa fa-pencil"></i></button>
<button class="btn btn-sm btn-default delete {posts.display_moderator_tools}" type="button" title="[[topic:delete]]"><i class="fa fa-trash-o"></i></button>
</div>
</div>
<input id="post_{posts.pid}_link" value="" class="pull-right" style="display:none;"></input>

@ -149,7 +149,7 @@ var RDB = require('./redis.js'),
if(cids && cids.length === 0) {
return callback(null, {categories : []});
}
Categories.getCategories(cids, current_user, callback);
});
};
@ -300,12 +300,12 @@ var RDB = require('./redis.js'),
RDB.hmgetObject('category:' + cid, fields, callback);
};
Categories.setCategoryField = function(cid, field, value) {
RDB.hset('category:' + cid, field, value);
Categories.setCategoryField = function(cid, field, value, callback) {
RDB.hset('category:' + cid, field, value, callback);
};
Categories.incrementCategoryFieldBy = function(cid, field, value) {
RDB.hincrby('category:' + cid, field, value);
Categories.incrementCategoryFieldBy = function(cid, field, value, callback) {
RDB.hincrby('category:' + cid, field, value, callback);
};
Categories.getCategories = function(cids, uid, callback) {

@ -202,9 +202,12 @@ var fs = require('fs'),
break;
case 'action':
async.each(hookList, function(hookObj) {
if (hookObj.method) hookObj.method.call(_self.libraries[hookObj.id], args);
else {
if (global.env === 'development') winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
if (hookObj.method) {
hookObj.method.call(_self.libraries[hookObj.id], args);
} else {
if (global.env === 'development') {
winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
}
}
});
break;
@ -215,7 +218,9 @@ var fs = require('fs'),
} else {
// Otherwise, this hook contains no methods
var returnVal = args;
if (callback) callback(null, returnVal);
if (callback) {
callback(null, returnVal);
}
}
},
isActive: function(id, callback) {

@ -44,14 +44,12 @@ var RDB = require('./redis'),
return callback(err, null);
}
content = newContent;
var timestamp = Date.now(),
postData = {
'pid': pid,
'uid': uid,
'tid': tid,
'content': content,
'content': newContent,
'timestamp': timestamp,
'reputation': 0,
'editor': '',
@ -348,13 +346,13 @@ var RDB = require('./redis'),
});
}
Posts.setPostField = function(pid, field, value, done) {
RDB.hset('post:' + pid, field, value);
Posts.setPostField = function(pid, field, value, callback) {
RDB.hset('post:' + pid, field, value, callback);
plugins.fireHook('action:post.setField', {
'pid': pid,
'field': field,
'value': value
}, done);
});
}
Posts.getPostsByPids = function(pids, callback) {

@ -682,7 +682,7 @@ var RDB = require('./redis'),
user.notifications.getUnreadByUniqueId(uid, 'topic:' + tid, function(err, nids) {
notifications.mark_read_multiple(nids, uid, function() {
});
});
}
@ -787,16 +787,16 @@ var RDB = require('./redis'),
RDB.hmgetObject('topic:' + tid, fields, callback);
}
Topics.setTopicField = function(tid, field, value) {
RDB.hset('topic:' + tid, field, value);
Topics.setTopicField = function(tid, field, value, callback) {
RDB.hset('topic:' + tid, field, value, callback);
}
Topics.increasePostCount = function(tid) {
RDB.hincrby('topic:' + tid, 'postcount', 1);
Topics.increasePostCount = function(tid, callback) {
RDB.hincrby('topic:' + tid, 'postcount', 1, callback);
}
Topics.increaseViewCount = function(tid) {
RDB.hincrby('topic:' + tid, 'viewcount', 1);
Topics.increaseViewCount = function(tid, callback) {
RDB.hincrby('topic:' + tid, 'viewcount', 1, callback);
}
Topics.isLocked = function(tid, callback) {

@ -316,8 +316,8 @@ var bcrypt = require('bcrypt'),
RDB.hset('user:' + uid, field, value, callback);
};
User.setUserFields = function(uid, data) {
RDB.hmset('user:' + uid, data);
User.setUserFields = function(uid, data, callback) {
RDB.hmset('user:' + uid, data, callback);
};
User.incrementUserFieldBy = function(uid, field, value, callback) {

Loading…
Cancel
Save