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');
|
$(window).trigger('action:categories.loading');
|
||||||
infinitescroll.loadMore('categories.loadMore', {
|
infinitescroll.loadMore('categories.loadMore', {
|
||||||
cid: ajaxify.variables.get('category_id'),
|
cid: ajaxify.variables.get('category_id'),
|
||||||
after: after
|
after: after,
|
||||||
|
author: utils.getQueryParams().author
|
||||||
}, function (data, done) {
|
}, function (data, done) {
|
||||||
|
|
||||||
if (data.topics && data.topics.length) {
|
if (data.topics && data.topics.length) {
|
||||||
|
|||||||
@@ -305,6 +305,24 @@
|
|||||||
return a;
|
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
|
// 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
|
// also supports JSON object and/or arrays parsing
|
||||||
toType: function(str) {
|
toType: function(str) {
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ SocketCategories.loadMore = function(socket, data, callback) {
|
|||||||
},
|
},
|
||||||
settings: function(next) {
|
settings: function(next) {
|
||||||
user.getSettings(socket.uid, next);
|
user.getSettings(socket.uid, next);
|
||||||
|
},
|
||||||
|
targetUid: function(next) {
|
||||||
|
if (data.author) {
|
||||||
|
user.getUidByUserslug(data.author, next);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, function(err, results) {
|
}, function(err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -55,8 +62,9 @@ SocketCategories.loadMore = function(socket, data, callback) {
|
|||||||
categories.getCategoryTopics({
|
categories.getCategoryTopics({
|
||||||
cid: data.cid,
|
cid: data.cid,
|
||||||
start: start,
|
start: start,
|
||||||
end: end,
|
stop: end,
|
||||||
uid: socket.uid
|
uid: socket.uid,
|
||||||
|
targetUid: results.targetUid
|
||||||
}, function(err, data) {
|
}, function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user