diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index 6dd8ae270c..a21a251f6c 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -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', diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 9f4e87c43d..64ad635ab9 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -74,13 +74,18 @@ -
- - - - - - +
+
+ + + + +
+ +
+ + +
diff --git a/src/categories.js b/src/categories.js index 26198af0d3..6aff4bfbe7 100644 --- a/src/categories.js +++ b/src/categories.js @@ -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) { diff --git a/src/plugins.js b/src/plugins.js index c87b19462a..2a9bc7f9b2 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -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) { diff --git a/src/posts.js b/src/posts.js index 4bf7b80119..4a885a0876 100644 --- a/src/posts.js +++ b/src/posts.js @@ -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) { diff --git a/src/topics.js b/src/topics.js index fdb2db4e97..3d1ad3a4a6 100644 --- a/src/topics.js +++ b/src/topics.js @@ -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) { diff --git a/src/user.js b/src/user.js index fc63329382..adb55bcf3a 100644 --- a/src/user.js +++ b/src/user.js @@ -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) {