mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
@@ -332,7 +332,8 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'
|
||||
$(window).trigger('action:categories.loading');
|
||||
infinitescroll.loadMore('categories.loadMore', {
|
||||
cid: ajaxify.variables.get('category_id'),
|
||||
after: after
|
||||
after: after,
|
||||
author: utils.getQueryParams().author
|
||||
}, function (data, done) {
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
|
||||
@@ -305,6 +305,24 @@
|
||||
return a;
|
||||
},
|
||||
|
||||
getQueryParams: function() {
|
||||
var search = window.location.search.slice(1),
|
||||
data = {};
|
||||
|
||||
search = search.split('&');
|
||||
for(var x=0,numParams=search.length,temp;x<numParams;x++) {
|
||||
temp = search[x].split('=');
|
||||
if (temp[0].substr(-2, 2) !== '[]') {
|
||||
data[temp[0]] = temp[1];
|
||||
} else {
|
||||
data[temp[0].slice(0, -2)] = data[temp[0].slice(0, -2)] || [];
|
||||
data[temp[0].slice(0, -2)].push(temp[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
// return boolean if string 'true' or string 'false', or if a parsable string which is a number
|
||||
// also supports JSON object and/or arrays parsing
|
||||
toType: function(str) {
|
||||
|
||||
@@ -39,6 +39,13 @@ SocketCategories.loadMore = function(socket, data, callback) {
|
||||
},
|
||||
settings: function(next) {
|
||||
user.getSettings(socket.uid, next);
|
||||
},
|
||||
targetUid: function(next) {
|
||||
if (data.author) {
|
||||
user.getUidByUserslug(data.author, next);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
}, function(err, results) {
|
||||
if (err) {
|
||||
@@ -55,8 +62,9 @@ SocketCategories.loadMore = function(socket, data, callback) {
|
||||
categories.getCategoryTopics({
|
||||
cid: data.cid,
|
||||
start: start,
|
||||
end: end,
|
||||
uid: socket.uid
|
||||
stop: end,
|
||||
uid: socket.uid,
|
||||
targetUid: results.targetUid
|
||||
}, function(err, data) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
|
||||
Reference in New Issue
Block a user