mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
removed utils.getQueryParams() use utils.params()
This commit is contained in:
@@ -339,7 +339,7 @@ define('forum/category', [
|
||||
infinitescroll.loadMore('categories.loadMore', {
|
||||
cid: ajaxify.variables.get('category_id'),
|
||||
after: after,
|
||||
author: utils.getQueryParams().author
|
||||
author: utils.params().author
|
||||
}, function (data, done) {
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
|
||||
@@ -80,8 +80,8 @@ define('forum/search', ['search', 'autocomplete'], function(searchModule, autoco
|
||||
$('#posted-by-user').val(params.by);
|
||||
}
|
||||
|
||||
if ((params['categories[]'] || params.categories)) {
|
||||
$('#posted-in-categories').val(params['categories[]'] || params.categories);
|
||||
if (params.categories) {
|
||||
$('#posted-in-categories').val(params.categories);
|
||||
}
|
||||
|
||||
if (params.searchChildren) {
|
||||
|
||||
@@ -270,6 +270,9 @@
|
||||
value = options.skipToType[key] ? decodeURI(val[1]) : utils.toType(decodeURI(val[1]));
|
||||
|
||||
if (key) {
|
||||
if (key.substr(-2, 2) === '[]') {
|
||||
key = key.slice(0, -2);
|
||||
}
|
||||
if (!hash[key]) {
|
||||
hash[key] = value;
|
||||
} else {
|
||||
@@ -293,24 +296,6 @@
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user