', {component: 'post/replies'}).html(html).hide().insertAfter(button).slideDown('fast');
diff --git a/public/src/client/topic/threadTools.js b/public/src/client/topic/threadTools.js
index 7eef6306a3..aab7654e27 100644
--- a/public/src/client/topic/threadTools.js
+++ b/public/src/client/topic/threadTools.js
@@ -7,7 +7,7 @@ define('forum/topic/threadTools', [
'forum/topic/move',
'forum/topic/delete-posts',
'components',
- 'translator'
+ 'translator',
], function (fork, move, deletePosts, components, translator) {
var ThreadTools = {};
@@ -101,7 +101,7 @@ define('forum/topic/threadTools', [
alert_id: 'topic_follow',
title: '[[global:please_log_in]]',
message: '[[topic:login_to_subscribe]]',
- timeout: 5000
+ timeout: 5000,
});
}
var message = '';
@@ -118,7 +118,7 @@ define('forum/topic/threadTools', [
alert_id: 'follow_thread',
message: message,
type: 'success',
- timeout: 5000
+ timeout: 5000,
});
$(window).trigger('action:topics.changeWatching', {tid: tid, type: type});
diff --git a/public/src/client/topic/votes.js b/public/src/client/topic/votes.js
index 8bd1b30b6b..cf342e3e9d 100644
--- a/public/src/client/topic/votes.js
+++ b/public/src/client/topic/votes.js
@@ -69,7 +69,7 @@ define('forum/topic/votes', ['components', 'translator'], function (components,
socket.emit(currentState ? 'posts.unvote' : method , {
pid: post.attr('data-pid'),
- room_id: app.currentRoom
+ room_id: app.currentRoom,
}, function (err) {
if (err) {
if (err.message === 'self-vote') {
@@ -100,7 +100,7 @@ define('forum/topic/votes', ['components', 'translator'], function (components,
title: 'Voters',
message: translated,
className: 'vote-modal',
- show: true
+ show: true,
});
dialog.on('click', function () {
diff --git a/public/src/client/unread.js b/public/src/client/unread.js
index e185788981..a9fea6b15e 100644
--- a/public/src/client/unread.js
+++ b/public/src/client/unread.js
@@ -94,7 +94,7 @@ define('forum/unread', ['forum/recent', 'topicSelect', 'forum/infinitescroll', '
infinitescroll.loadMore('topics.loadMoreUnreadTopics', {
after: $('[component="category"]').attr('data-nextstart'),
cid: cid,
- filter: ajaxify.data.selectedFilter.filter
+ filter: ajaxify.data.selectedFilter.filter,
}, function (data, done) {
if (data.topics && data.topics.length) {
recent.onTopicsLoaded('unread', data.topics, true, done);
diff --git a/public/src/client/users.js b/public/src/client/users.js
index bbf11b46db..5d7ff6ea8b 100644
--- a/public/src/client/users.js
+++ b/public/src/client/users.js
@@ -52,7 +52,7 @@ define('forum/users', ['translator'], function (translator) {
var query = {
section: activeSection,
- page: 1
+ page: 1,
};
if (!username) {
diff --git a/public/src/installer/install.js b/public/src/installer/install.js
index cb645771e4..1cb4eea7a5 100644
--- a/public/src/installer/install.js
+++ b/public/src/installer/install.js
@@ -10,7 +10,7 @@ $('document').ready(function () {
if ($('#database-error').length) {
$('[name="database"]').parents('.input-row').addClass('error');
$('html, body').animate({
- scrollTop: ($('#database-error').offset().top + 100) + 'px'
+ scrollTop: ($('#database-error').offset().top + 100) + 'px',
}, 400);
}
diff --git a/public/src/modules/autocomplete.js b/public/src/modules/autocomplete.js
index ecaf563d10..390822012c 100644
--- a/public/src/modules/autocomplete.js
+++ b/public/src/modules/autocomplete.js
@@ -29,15 +29,15 @@ define('autocomplete', function () {
user: {
uid: user.uid,
name: user.username,
- slug: user.userslug
- }
+ slug: user.userslug,
+ },
};
});
response(names);
}
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
});
- }
+ },
});
});
};
@@ -49,7 +49,7 @@ define('autocomplete', function () {
select: onselect,
source: function (request, response) {
socket.emit('groups.search', {
- query: request.term
+ query: request.term,
}, function (err, results) {
if (err) {
return app.alertError(err.message);
@@ -62,15 +62,15 @@ define('autocomplete', function () {
value: group.name,
group: {
name: group.name,
- slug: group.slug
- }
+ slug: group.slug,
+ },
};
});
response(names);
}
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
});
- }
+ },
});
});
};
@@ -95,7 +95,7 @@ define('autocomplete', function () {
source: function (request, response) {
socket.emit('topics.autocompleteTags', {
query: request.term,
- cid: ajaxify.data.cid || 0
+ cid: ajaxify.data.cid || 0,
}, function (err, tags) {
if (err) {
return app.alertError(err.message);
@@ -105,7 +105,7 @@ define('autocomplete', function () {
}
$('.ui-autocomplete a').attr('data-ajaxify', 'false');
});
- }
+ },
});
});
};
diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js
index f231fd765d..9bfa0306b3 100644
--- a/public/src/modules/chat.js
+++ b/public/src/modules/chat.js
@@ -9,7 +9,7 @@ define('chat', [
'forum/chats',
'forum/chats/messages',
'translator',
- 'scrollStop'
+ 'scrollStop',
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator, scrollStop) {
var module = {};
@@ -72,7 +72,7 @@ define('chat', [
taskbar.push('chat', modal.attr('UUID'), {
title: username,
touid: data.message.fromUser.uid,
- roomId: data.roomId
+ roomId: data.roomId,
});
}
} else {
@@ -119,7 +119,7 @@ define('chat', [
});
templates.parse('partials/chats/dropdown', {
- rooms: rooms
+ rooms: rooms,
}, function (html) {
translator.translate(html, function (translated) {
chatsListEl.empty().html(translated);
@@ -175,7 +175,7 @@ define('chat', [
chatModal.find('.modal-content').resizable({
handles: 'n, e, s, w, se',
minHeight: 250,
- minWidth: 400
+ minWidth: 400,
});
chatModal.find('.modal-content').on('resize', function (event, ui) {
@@ -194,7 +194,7 @@ define('chat', [
chatModal.find('#chat-message-input').focus();
},
distance: 10,
- handle: '.modal-header'
+ handle: '.modal-header',
});
});
@@ -264,7 +264,7 @@ define('chat', [
title: data.roomName || (data.users.length ? data.users[0].username : ''),
roomId: data.roomId,
icon: 'fa-comment',
- state: ''
+ state: '',
});
$(window).trigger('action:chat.loaded', chatModal);
diff --git a/public/src/modules/components.js b/public/src/modules/components.js
index ef936d0f75..2aeefb7f57 100644
--- a/public/src/modules/components.js
+++ b/public/src/modules/components.js
@@ -52,7 +52,7 @@ define('components', function () {
},
'chat/message/body': function (messageId) {
return $('[component="chat/message"][data-mid="' + messageId + '"] [component="chat/message/body"]');
- }
+ },
};
components.get = function () {
diff --git a/public/src/modules/coverPhoto.js b/public/src/modules/coverPhoto.js
index fa6bdc4d7d..e1eba864d0 100644
--- a/public/src/modules/coverPhoto.js
+++ b/public/src/modules/coverPhoto.js
@@ -2,12 +2,12 @@
/* globals define, app */
define('coverPhoto', [
- 'vendor/jquery/draggable-background/backgroundDraggable'
+ 'vendor/jquery/draggable-background/backgroundDraggable',
], function () {
var coverPhoto = {
coverEl: null,
- saveFn: null
+ saveFn: null,
};
coverPhoto.init = function (coverEl, saveFn, uploadFn, removeFn) {
@@ -56,14 +56,14 @@ define('coverPhoto', [
coverEl.toggleClass('active', 1)
.backgroundDraggable({
axis: 'y',
- units: 'percent'
+ units: 'percent',
});
app.alert({
alert_id: 'drag_start',
title: '[[modules:cover.dragging_title]]',
message: '[[modules:cover.dragging_message]]',
- timeout: 5000
+ timeout: 5000,
});
}
diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js
index 3035d29fc4..83bfc5a80d 100644
--- a/public/src/modules/helpers.js
+++ b/public/src/modules/helpers.js
@@ -174,7 +174,7 @@
if (privileges.hasOwnProperty(priv)) {
states.push({
name: priv,
- state: privileges[priv]
+ state: privileges[priv],
});
}
}
@@ -285,5 +285,5 @@
}(
typeof exports === 'object' ? exports :
typeof define === 'function' && define.amd ? {} :
- helpers = {}
+ helpers = {},
));
diff --git a/public/src/modules/iconSelect.js b/public/src/modules/iconSelect.js
index 5f04baf59f..1919f8242c 100644
--- a/public/src/modules/iconSelect.js
+++ b/public/src/modules/iconSelect.js
@@ -40,7 +40,7 @@ define('iconSelect', function () {
el.attr('value', '');
onModified(el);
- }
+ },
},
success: {
label: 'Select',
@@ -56,9 +56,9 @@ define('iconSelect', function () {
}
onModified(el);
- }
- }
- }
+ },
+ },
+ },
});
picker.on('show.bs.modal', function () {
diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js
index b281a46fff..cdc5d728bc 100644
--- a/public/src/modules/navigator.js
+++ b/public/src/modules/navigator.js
@@ -173,13 +173,13 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
navigator.scrollUp = function () {
$('body,html').animate({
- scrollTop: $(window).scrollTop() - $(window).height()
+ scrollTop: $(window).scrollTop() - $(window).height(),
});
};
navigator.scrollDown = function () {
$('body,html').animate({
- scrollTop: $(window).scrollTop() + $(window).height()
+ scrollTop: $(window).scrollTop() + $(window).height(),
});
};
@@ -266,7 +266,7 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
}
$('html, body').animate({
- scrollTop: scrollTop + 'px'
+ scrollTop: scrollTop + 'px',
}, duration, function () {
if (done) {
// Re-enable onScroll behaviour
diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index c668cbbfc7..1ae246e282 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -71,7 +71,7 @@ define('notifications', ['sounds', 'translator', 'components'], function (sound,
var payload = {
alert_id: 'new_notif',
title: '[[notifications:new_notification]]',
- timeout: 2000
+ timeout: 2000,
};
if (notifData.path) {
@@ -151,7 +151,7 @@ define('notifications', ['sounds', 'translator', 'components'], function (sound,
var payload = {
count: count,
- updateFavicon: true
+ updateFavicon: true,
};
$(window).trigger('action:notification.updateCount', payload);
diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js
index 40be206c19..f8da4c4442 100644
--- a/public/src/modules/pictureCropper.js
+++ b/public/src/modules/pictureCropper.js
@@ -13,7 +13,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
title: data.title || '[[global:upload_file]]',
description: data.description || '',
button: data.button || '[[global:upload]]',
- accept: data.accept ? data.accept.replace(/,/g, ', ') : ''
+ accept: data.accept ? data.accept.replace(/,/g, ', ') : '',
}, function (uploadModal) {
uploadModal = $(uploadModal);
@@ -92,10 +92,10 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
autoCropArea: 1,
ready: function () {
cropperModal.find('.crop-btn').trigger('click');
- }
+ },
});
});
- }
+ },
});
});
});
@@ -131,7 +131,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
socketMethod: data.socketMethod,
aspectRatio: data.aspectRatio,
paramName: data.paramName,
- paramValue: data.paramValue
+ paramValue: data.paramValue,
}, callback);
}, false);
diff --git a/public/src/modules/search.js b/public/src/modules/search.js
index 990c9dec97..e7aefb7056 100644
--- a/public/src/modules/search.js
+++ b/public/src/modules/search.js
@@ -4,7 +4,7 @@
define('search', ['navigator', 'translator'], function (nav, translator) {
var Search = {
- current: {}
+ current: {},
};
Search.query = function (data, callback) {
@@ -39,7 +39,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
var postedBy = data.by || '';
var query = {
term: data.term,
- 'in': searchIn
+ 'in': searchIn,
};
if (postedBy && (searchIn === 'posts' || searchIn === 'titles' || searchIn === 'titlesposts')) {
@@ -89,7 +89,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
Search.queryTopic = function (tid, term, callback) {
socket.emit('topics.search', {
tid: tid,
- term: term
+ term: term,
}, function (err, pids) {
if (err) {
return app.alertError(err.message);
@@ -102,7 +102,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
return a - b;
}),
tid: tid,
- term: term
+ term: term,
};
Search.checkPagePresence(tid, function () {
@@ -121,7 +121,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
};
Search.topicDOM = {
- active: false
+ active: false,
};
Search.topicDOM.prev = function () {
@@ -144,7 +144,7 @@ define('search', ['navigator', 'translator'], function (nav, translator) {
var data = {
pid: Search.current.results[index],
tid: Search.current.tid,
- topicPostSort: config.topicPostSort
+ topicPostSort: config.topicPostSort,
};
socket.emit('posts.getPidIndex', data, function (err, postIndex) {
if (err) {
diff --git a/public/src/modules/settings.js b/public/src/modules/settings.js
index 090c83e2d0..c1bdaa219f 100644
--- a/public/src/modules/settings.js
+++ b/public/src/modules/settings.js
@@ -10,7 +10,7 @@ define('settings', function () {
'settings/select',
'settings/array',
'settings/key',
- 'settings/object'
+ 'settings/object',
];
var Settings,
@@ -284,7 +284,7 @@ define('settings', function () {
}
socket.emit('admin.settings.set', {
hash: hash,
- values: settings
+ values: settings,
}, function (err) {
if (notify) {
if (err) {
@@ -292,14 +292,14 @@ define('settings', function () {
title: 'Settings Not Saved',
type: 'danger',
message: "NodeBB failed to save the settings.",
- timeout: 5000
+ timeout: 5000,
});
} else {
app.alert({
title: 'Settings Saved',
type: 'success',
message: "Settings have been successfully saved",
- timeout: 2500
+ timeout: 2500,
});
}
}
@@ -317,7 +317,7 @@ define('settings', function () {
settings._ = JSON.parse(settings._);
} catch (_error) {}
Settings.cfg = settings;
- }
+ },
};
@@ -383,7 +383,7 @@ define('settings', function () {
*/
sync: function (hash, wrapper, callback) {
socket.emit('admin.settings.get', {
- hash: hash
+ hash: hash,
}, function (err, values) {
if (err) {
if (typeof callback === 'function') {
@@ -442,7 +442,7 @@ define('settings', function () {
title: 'Attributes Not Saved',
message: "'" + (notSaved.join(', ')) + "' could not be saved. Please contact the plugin-author!",
type: 'danger',
- timeout: 5000
+ timeout: 5000,
});
}
helper.persistSettings(hash, Settings.cfg, notify, callback);
@@ -450,7 +450,7 @@ define('settings', function () {
load: function (hash, formEl, callback) {
callback = callback || function () {};
socket.emit('admin.settings.get', {
- hash: hash
+ hash: hash,
}, function (err, values) {
if (err) {
return callback(err);
@@ -502,7 +502,7 @@ define('settings', function () {
socket.emit('admin.settings.set', {
hash: hash,
- values: values
+ values: values,
}, function (err) {
// Remove unsaved flag to re-enable ajaxify
app.flags._unsaved = false;
@@ -514,19 +514,19 @@ define('settings', function () {
app.alert({
title: 'Error while saving settings',
type: 'error',
- timeout: 2500
+ timeout: 2500,
});
} else {
app.alert({
title: 'Settings Saved',
type: 'success',
- timeout: 2500
+ timeout: 2500,
});
}
}
});
}
- }
+ },
};
diff --git a/public/src/modules/settings/array.js b/public/src/modules/settings/array.js
index fd94ed8226..4ea250b575 100644
--- a/public/src/modules/settings/array.js
+++ b/public/src/modules/settings/array.js
@@ -13,7 +13,7 @@ define('settings/array', function () {
function createRemoveButton(elements) {
var rm = $(helper.createElement('button', {
"class": 'btn btn-xs btn-primary remove',
- title: 'Remove Item'
+ title: 'Remove Item',
}, '-'));
rm.click(function (event) {
event.preventDefault();
@@ -76,7 +76,7 @@ define('settings/array', function () {
newValue = element.data('new') || '',
add = $(helper.createElement('button', {
"class": 'btn btn-sm btn-primary add',
- title: 'Expand Array'
+ title: 'Expand Array',
}, '+'));
add.click(function (event) {
event.preventDefault();
@@ -139,7 +139,7 @@ define('settings/array', function () {
} else {
return void 0;
}
- }
+ },
};
return SettingsArray;
diff --git a/public/src/modules/settings/checkbox.js b/public/src/modules/settings/checkbox.js
index 865e89c0f3..ca4aaab829 100644
--- a/public/src/modules/settings/checkbox.js
+++ b/public/src/modules/settings/checkbox.js
@@ -10,7 +10,7 @@ define('settings/checkbox', function () {
},
create: function () {
return Settings.helper.createElement('input', {
- type: 'checkbox'
+ type: 'checkbox',
});
},
set: function (element, value) {
@@ -29,7 +29,7 @@ define('settings/checkbox', function () {
return value ? 1 : 0;
}
return value;
- }
+ },
};
return SettingsCheckbox;
diff --git a/public/src/modules/settings/key.js b/public/src/modules/settings/key.js
index c5cac01103..d155a8808a 100644
--- a/public/src/modules/settings/key.js
+++ b/public/src/modules/settings/key.js
@@ -24,7 +24,7 @@ define('settings/key', function () {
191: '/',
219: '[',
220: '\\',
- 221: ']'
+ 221: ']',
});
function Key() {
@@ -213,7 +213,7 @@ define('settings/key', function () {
} else {
return void 0;
}
- }
+ },
};
return SettingsKey;
diff --git a/public/src/modules/settings/number.js b/public/src/modules/settings/number.js
index ed96008038..b31296c6fd 100644
--- a/public/src/modules/settings/number.js
+++ b/public/src/modules/settings/number.js
@@ -8,7 +8,7 @@ define('settings/number', function () {
return value ? +value : void 0;
}
return value ? +value : 0;
- }
+ },
};
});
diff --git a/public/src/modules/settings/object.js b/public/src/modules/settings/object.js
index 05971d6d73..6c5e061a60 100644
--- a/public/src/modules/settings/object.js
+++ b/public/src/modules/settings/object.js
@@ -108,7 +108,7 @@ define('settings/object', function () {
} else {
return void 0;
}
- }
+ },
};
return SettingsObject;
diff --git a/public/src/modules/settings/select.js b/public/src/modules/settings/select.js
index 5e62b27226..bb13fcbb65 100644
--- a/public/src/modules/settings/select.js
+++ b/public/src/modules/settings/select.js
@@ -41,7 +41,7 @@ define('settings/select', function () {
} else {
return void 0;
}
- }
+ },
};
return SettingsSelect;
diff --git a/public/src/modules/settings/textarea.js b/public/src/modules/settings/textarea.js
index 8f1bcd90ca..b0b9840443 100644
--- a/public/src/modules/settings/textarea.js
+++ b/public/src/modules/settings/textarea.js
@@ -27,7 +27,7 @@ define('settings/textarea', function () {
} else {
return void 0;
}
- }
+ },
};
return SettingsArea;
diff --git a/public/src/modules/taskbar.js b/public/src/modules/taskbar.js
index 7a0b3c39ea..6536faafc7 100644
--- a/public/src/modules/taskbar.js
+++ b/public/src/modules/taskbar.js
@@ -50,7 +50,7 @@ define('taskbar', function () {
module: module,
uuid: uuid,
options: options,
- element: element
+ element: element,
};
$(window).trigger('filter:taskbar.push', data);
@@ -119,7 +119,7 @@ define('taskbar', function () {
'')
.attr({
'data-module': data.module,
- 'data-uuid': data.uuid
+ 'data-uuid': data.uuid,
})
.addClass(data.options.state !== undefined ? data.options.state : 'active');
diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js
index aa719ff1a2..fc7498c821 100644
--- a/public/src/modules/translator.js
+++ b/public/src/modules/translator.js
@@ -532,7 +532,7 @@
jQuery('html').css('direction', value).attr('data-dir', value);
}
});
- }
+ },
};
return adaptor;
diff --git a/public/src/modules/uploader.js b/public/src/modules/uploader.js
index 0e2a7e7ec8..4fb79bd3ad 100644
--- a/public/src/modules/uploader.js
+++ b/public/src/modules/uploader.js
@@ -11,7 +11,7 @@ define('uploader', ['translator'], function (translator) {
module.show({
route: route,
params: params,
- fileSize: fileSize
+ fileSize: fileSize,
}, callback);
};
@@ -23,7 +23,7 @@ define('uploader', ['translator'], function (translator) {
title: data.title || '[[global:upload_file]]',
description: data.description || '',
button: data.button || '[[global:upload]]',
- accept: data.accept ? data.accept.replace(/,/g, ', ') : ''
+ accept: data.accept ? data.accept.replace(/,/g, ', ') : '',
}, function (uploadModal) {
uploadModal = $(uploadModal);
@@ -76,7 +76,7 @@ define('uploader', ['translator'], function (translator) {
uploadModal.find('#uploadForm').ajaxSubmit({
headers: {
- 'x-csrf-token': config.csrf_token
+ 'x-csrf-token': config.csrf_token,
},
error: function (xhr) {
xhr = maybeParse(xhr);
@@ -99,7 +99,7 @@ define('uploader', ['translator'], function (translator) {
module.hideAlerts(uploadModal);
uploadModal.modal('hide');
}, 750);
- }
+ },
});
}
diff --git a/public/src/require-config.js b/public/src/require-config.js
index 0e021f6be0..661083fb8e 100644
--- a/public/src/require-config.js
+++ b/public/src/require-config.js
@@ -6,6 +6,6 @@ require.config({
'forum': '../client',
'admin': '../admin',
'vendor': '../../vendor',
- 'plugins': '../../plugins'
- }
+ 'plugins': '../../plugins',
+ },
});
diff --git a/public/src/sockets.js b/public/src/sockets.js
index c255287c58..e98e059da7 100644
--- a/public/src/sockets.js
+++ b/public/src/sockets.js
@@ -12,7 +12,7 @@ app.isConnected = false;
reconnectionAttempts: config.maxReconnectionAttempts,
reconnectionDelay: config.reconnectionDelay,
transports: config.socketioTransports,
- path: config.relative_path + '/socket.io'
+ path: config.relative_path + '/socket.io',
};
socket = io(config.websocketAddress, ioParams);
@@ -112,7 +112,7 @@ app.isConnected = false;
}
reconnectEl.addClass('active').removeClass('hide').tooltip({
- placement: 'bottom'
+ placement: 'bottom',
});
}
diff --git a/public/src/utils.js b/public/src/utils.js
index 42d4b6f3ad..d5b0e87054 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -181,7 +181,7 @@
"tiff": "image/tiff",
"xbm": "image/x-xbitmap",
"xpm": "image/x-xpixmap",
- "xwd": "image/x-xwindowdump"
+ "xwd": "image/x-xwindowdump",
},
fileMimeType: function (path) {
@@ -439,7 +439,7 @@
targetLocation.host === referenceLocation.host && targetLocation.protocol === referenceLocation.protocol && // Otherwise need to check if protocol and host match
(relative_path.length > 0 ? targetLocation.pathname.indexOf(relative_path) === 0 : true) // Subfolder installs need this additional check
);
- }
+ },
};
if (typeof String.prototype.startsWith != 'function') {
@@ -480,6 +480,6 @@
}('undefined' === typeof module ? {
module: {
- exports: {}
- }
+ exports: {},
+ },
} : module));
diff --git a/public/src/widgets.js b/public/src/widgets.js
index 377ccb2c53..041804ae95 100644
--- a/public/src/widgets.js
+++ b/public/src/widgets.js
@@ -34,7 +34,7 @@
template: template + '.tpl',
url: url,
cid: ajaxify.data.cid,
- isMobile: utils.isMobile()
+ isMobile: utils.isMobile(),
}, function (renderedAreas) {
for (var x = 0; x < renderedAreas.length; ++x) {
var renderedWidgets = renderedAreas[x].widgets;
@@ -79,7 +79,7 @@
widgetAreas.find('img[title].teaser-pic,img[title].user-img').each(function () {
$(this).tooltip({
placement: 'top',
- title: $(this).attr('title')
+ title: $(this).attr('title'),
});
});
$(window).trigger('action:widgets.loaded', {});
diff --git a/src/analytics.js b/src/analytics.js
index 6b248057da..4da4c819bb 100644
--- a/src/analytics.js
+++ b/src/analytics.js
@@ -193,7 +193,7 @@ Analytics.getCategoryAnalytics = function (cid, callback) {
Analytics.getErrorAnalytics = function (callback) {
async.parallel({
'not-found': async.apply(Analytics.getDailyStatsForSet, 'analytics:errors:404', Date.now(), 7),
- 'toobusy': async.apply(Analytics.getDailyStatsForSet, 'analytics:errors:503', Date.now(), 7)
+ 'toobusy': async.apply(Analytics.getDailyStatsForSet, 'analytics:errors:503', Date.now(), 7),
}, callback);
};
diff --git a/src/batch.js b/src/batch.js
index 19595df07e..53f88bfc05 100644
--- a/src/batch.js
+++ b/src/batch.js
@@ -57,7 +57,7 @@ exports.processSortedSet = function (setKey, process, options, callback) {
});
});
},
- callback
+ callback,
);
};
@@ -105,6 +105,6 @@ exports.processArray = function (array, process, options, callback) {
},
function (err) {
callback(err);
- }
+ },
);
};
diff --git a/src/categories.js b/src/categories.js
index 5bb5222d38..4021f05749 100644
--- a/src/categories.js
+++ b/src/categories.js
@@ -49,7 +49,7 @@ var privileges = require('./privileges');
},
isIgnored: function (next) {
Categories.isIgnored([data.cid], data.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -62,7 +62,7 @@ var privileges = require('./privileges');
},
function (data, next) {
next(null, data.category);
- }
+ },
], callback);
};
@@ -73,7 +73,7 @@ var privileges = require('./privileges');
Categories.getPageCount = function (cid, uid, callback) {
async.parallel({
topicCount: async.apply(Categories.getCategoryField, cid, 'topic_count'),
- settings: async.apply(user.getSettings, uid)
+ settings: async.apply(user.getSettings, uid),
}, function (err, results) {
if (err) {
return callback(err);
@@ -107,7 +107,7 @@ var privileges = require('./privileges');
},
function (cids, next) {
Categories.getCategories(cids, uid, next);
- }
+ },
], callback);
};
@@ -146,7 +146,7 @@ var privileges = require('./privileges');
},
hasRead: function (next) {
Categories.hasReadCategories(cids, uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -224,7 +224,7 @@ var privileges = require('./privileges');
return parentData[parentCids.indexOf(parseInt(category.parentCid, 10))];
});
next(null, parentData);
- }
+ },
], callback);
};
@@ -266,7 +266,7 @@ var privileges = require('./privileges');
async.each(category.children, function (child, next) {
getChildrenRecursive(child, uid, next);
}, next);
- }
+ },
], callback);
}
@@ -357,7 +357,7 @@ var privileges = require('./privileges');
return uid && !isIgnoring[index];
});
next(null, readingUids);
- }
+ },
], callback);
};
diff --git a/src/categories/activeusers.js b/src/categories/activeusers.js
index 15673939ae..148db6aceb 100644
--- a/src/categories/activeusers.js
+++ b/src/categories/activeusers.js
@@ -22,7 +22,7 @@ module.exports = function (Categories) {
});
next(null, uids);
- }
+ },
], callback);
};
};
diff --git a/src/categories/create.js b/src/categories/create.js
index 508d8ab348..26c4e45240 100644
--- a/src/categories/create.js
+++ b/src/categories/create.js
@@ -41,7 +41,7 @@ module.exports = function (Categories) {
link: '',
numRecentReplies: 1,
class: ( data.class ? data.class : 'col-md-3 col-xs-6' ),
- imageClass: 'cover'
+ imageClass: 'cover',
};
plugins.fireHook('filter:category.create', {category: category, data: data}, next);
@@ -63,7 +63,7 @@ module.exports = function (Categories) {
async.apply(db.sortedSetAdd, 'cid:' + parentCid + ':children', category.order, category.cid),
async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'administrators'),
async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'registered-users'),
- async.apply(privileges.categories.give, ['find', 'read', 'topics:read'], category.cid, 'guests')
+ async.apply(privileges.categories.give, ['find', 'read', 'topics:read'], category.cid, 'guests'),
], next);
},
function (results, next) {
@@ -75,7 +75,7 @@ module.exports = function (Categories) {
function (category, next) {
plugins.fireHook('action:category.create', category);
next(null, category);
- }
+ },
], callback);
};
@@ -93,7 +93,7 @@ module.exports = function (Categories) {
function (next) {
async.parallel({
source: async.apply(db.getObject, 'category:' + fromCid),
- destination: async.apply(db.getObject, 'category:' + toCid)
+ destination: async.apply(db.getObject, 'category:' + toCid),
}, next);
},
function (results, next) {
@@ -132,7 +132,7 @@ module.exports = function (Categories) {
},
function (results, next) {
Categories.copyPrivilegesFrom(fromCid, toCid, next);
- }
+ },
], function (err) {
callback(err, destination);
});
@@ -165,7 +165,7 @@ module.exports = function (Categories) {
async.eachSeries(members, function (member, next) {
groups.join('cid:' + toCid + ':privileges:' + privilege, member, next);
}, next);
- }
+ },
], callback);
}
diff --git a/src/categories/data.js b/src/categories/data.js
index ccc31343d9..3a66cd29e0 100644
--- a/src/categories/data.js
+++ b/src/categories/data.js
@@ -96,7 +96,7 @@ module.exports = function (Categories) {
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
function (cids, next) {
Categories.getCategoriesFields(cids, fields, next);
- }
+ },
], callback);
};
diff --git a/src/categories/delete.js b/src/categories/delete.js
index 06d4931132..b1fd7ba407 100644
--- a/src/categories/delete.js
+++ b/src/categories/delete.js
@@ -33,7 +33,7 @@ module.exports = function (Categories) {
function (next) {
plugins.fireHook('action:category.delete', cid);
next();
- }
+ },
], callback);
};
@@ -55,14 +55,14 @@ module.exports = function (Categories) {
'cid:' + cid + ':ignorers',
'cid:' + cid + ':children',
'cid:' + cid + ':tag:whitelist',
- 'category:' + cid
+ 'category:' + cid,
], next);
},
function (next) {
async.each(privileges.privilegeList, function (privilege, next) {
groups.destroy('cid:' + cid + ':privileges:' + privilege, next);
}, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -77,7 +77,7 @@ module.exports = function (Categories) {
},
children: function (next) {
db.getSortedSetRange('cid:' + cid + ':children', 0, -1, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -94,12 +94,12 @@ module.exports = function (Categories) {
},
function (next) {
db.sortedSetAdd('cid:0:children', cid, cid, next);
- }
+ },
], next);
}, next);
- }
+ },
], next);
- }
+ },
], function (err) {
callback(err);
});
diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js
index 831991d61a..c77819f28e 100644
--- a/src/categories/recentreplies.js
+++ b/src/categories/recentreplies.js
@@ -29,7 +29,7 @@ module.exports = function (Categories) {
},
function (pids, next) {
posts.getPostSummaryByPids(pids, uid, {stripTags: true}, next);
- }
+ },
], callback);
};
@@ -40,7 +40,7 @@ module.exports = function (Categories) {
},
numRecentReplies: function (next) {
db.getObjectField('category:' + cid, 'numRecentReplies', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -61,7 +61,7 @@ module.exports = function (Categories) {
},
function (next) {
db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid, next);
- }
+ },
], callback);
});
};
@@ -95,7 +95,7 @@ module.exports = function (Categories) {
bubbleUpChildrenPosts(categoryData);
next();
- }
+ },
], callback);
};
@@ -135,13 +135,13 @@ module.exports = function (Categories) {
teaser.tid = teaser.uid = teaser.user.uid = undefined;
teaser.topic = {
slug: topicData[index].slug,
- title: validator.escape(String(topicData[index].title))
+ title: validator.escape(String(topicData[index].title)),
};
}
});
results.teasers = results.teasers.filter(Boolean);
next(null, results.teasers);
- }
+ },
], callback);
}
@@ -211,9 +211,9 @@ module.exports = function (Categories) {
},
function (next) {
db.sortedSetAdd('cid:' + cid + ':pids', timestamps, pids, next);
- }
+ },
], next);
- }
+ },
], next);
}, function (err) {
if (err) {
@@ -238,7 +238,7 @@ module.exports = function (Categories) {
},
function (next) {
db.incrObjectFieldBy('category:' + newCid, 'post_count', postCount, next);
- }
+ },
], function (err) {
if (err) {
winston.error(err.message);
diff --git a/src/categories/topics.js b/src/categories/topics.js
index 9e477e51ef..7dba06ab37 100644
--- a/src/categories/topics.js
+++ b/src/categories/topics.js
@@ -32,7 +32,7 @@ module.exports = function (Categories) {
},
function (results, next) {
next(null, {topics: results.topics, nextStart: data.stop + 1});
- }
+ },
], callback);
};
@@ -76,7 +76,7 @@ module.exports = function (Categories) {
});
next(null, pinnedTids.concat(normalTids));
- }
+ },
], callback);
};
@@ -132,14 +132,14 @@ module.exports = function (Categories) {
},
function (next) {
db.sortedSetIncrBy('cid:' + cid + ':tids:posts', 1, postData.tid, next);
- }
+ },
], function (err) {
next(err);
});
},
function (next) {
Categories.updateRecentTid(cid, postData.tid, next);
- }
+ },
], callback);
};
diff --git a/src/categories/update.js b/src/categories/update.js
index afaad6d974..b8f15ac1f5 100644
--- a/src/categories/update.js
+++ b/src/categories/update.js
@@ -61,7 +61,7 @@ module.exports = function (Categories) {
function (next) {
plugins.fireHook('action:category.update', {cid: cid, modified: category});
next();
- }
+ },
], callback);
}
@@ -84,7 +84,7 @@ module.exports = function (Categories) {
} else {
next();
}
- }
+ },
], callback);
}
@@ -108,9 +108,9 @@ module.exports = function (Categories) {
},
function (next) {
db.setObjectField('category:' + cid, 'parentCid', newParent, next);
- }
+ },
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -131,7 +131,7 @@ module.exports = function (Categories) {
return index;
});
db.sortedSetAdd('cid:' + cid + ':tag:whitelist', scores, tags, next);
- }
+ },
], callback);
}
@@ -148,9 +148,9 @@ module.exports = function (Categories) {
function (next) {
parentCid = parseInt(parentCid, 10) || 0;
db.sortedSetAdd('cid:' + parentCid + ':children', order, cid, next);
- }
+ },
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -163,7 +163,7 @@ module.exports = function (Categories) {
},
function (parsedDescription, next) {
Categories.setCategoryField(cid, 'descriptionParsed', parsedDescription, next);
- }
+ },
], callback);
};
diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js
index 2c99a981c3..a7aa1716b4 100644
--- a/src/controllers/accounts.js
+++ b/src/controllers/accounts.js
@@ -10,7 +10,7 @@ var accountsController = {
posts: require('./accounts/posts'),
notifications: require('./accounts/notifications'),
chats: require('./accounts/chats'),
- session: require('./accounts/session')
+ session: require('./accounts/session'),
};
module.exports = accountsController;
diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js
index c951bafdbd..0e551c4fda 100644
--- a/src/controllers/accounts/chats.js
+++ b/src/controllers/accounts/chats.js
@@ -21,7 +21,7 @@ chatsController.get = function (req, res, callback) {
function (next) {
async.parallel({
uid: async.apply(user.getUidByUserslug, req.params.userslug),
- username: async.apply(user.getUsernameByUserslug, req.params.userslug)
+ username: async.apply(user.getUsernameByUserslug, req.params.userslug),
}, next);
},
function (results, next) {
@@ -45,7 +45,7 @@ chatsController.get = function (req, res, callback) {
nextStart: recentChats.nextStart,
allowed: true,
title: '[[pages:chats]]',
- breadcrumbs: helpers.buildBreadcrumbs([{text: username, url: '/user/' + req.params.userslug}, {text: '[[pages:chats]]'}])
+ breadcrumbs: helpers.buildBreadcrumbs([{text: username, url: '/user/' + req.params.userslug}, {text: '[[pages:chats]]'}]),
});
}
messaging.isUserInRoom(req.uid, req.params.roomid, next);
@@ -62,10 +62,10 @@ chatsController.get = function (req, res, callback) {
callerUid: req.uid,
uid: uid,
roomId: req.params.roomid,
- isNew: false
- })
+ isNew: false,
+ }),
}, next);
- }
+ },
], function (err, data) {
if (err) {
return callback(err);
@@ -89,7 +89,7 @@ chatsController.get = function (req, res, callback) {
room.breadcrumbs = helpers.buildBreadcrumbs([
{text: username, url: '/user/' + req.params.userslug},
{text: '[[pages:chats]]', url: '/user/' + req.params.userslug + '/chats'},
- {text: room.roomName || room.usernames || '[[pages:chats]]'}
+ {text: room.roomName || room.usernames || '[[pages:chats]]'},
]);
room.maximumUsersInChatRoom = parseInt(meta.config.maximumUsersInChatRoom, 10) || 0;
room.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000;
diff --git a/src/controllers/accounts/edit.js b/src/controllers/accounts/edit.js
index c9549a1def..c31d55efa3 100644
--- a/src/controllers/accounts/edit.js
+++ b/src/controllers/accounts/edit.js
@@ -78,7 +78,7 @@ function renderRoute(name, req, res, next) {
userData.breadcrumbs = helpers.buildBreadcrumbs([
{text: userData.username, url: '/user/' + userData.userslug},
{text: '[[user:edit]]', url: '/user/' + userData.userslug + '/edit'},
- {text: '[[user:' + name + ']]'}
+ {text: '[[user:' + name + ']]'},
]);
res.render('account/edit/' + name, userData);
@@ -97,7 +97,7 @@ function getUserData(req, next, callback) {
return callback();
}
db.getObjectField('user:' + userData.uid, 'password', next);
- }
+ },
], function (err, password) {
if (err) {
return callback(err);
@@ -128,7 +128,7 @@ editController.uploadPicture = function (req, res, next) {
}
user.uploadPicture(updateUid, userPhoto, next);
- }
+ },
], function (err, image) {
fs.unlink(userPhoto.path, function (err) {
if (err) {
@@ -148,7 +148,7 @@ editController.uploadCoverPicture = function (req, res, next) {
user.updateCoverPicture({
file: req.files.files[0],
- uid: params.uid
+ uid: params.uid,
}, function (err, image) {
if (err) {
return next(err);
diff --git a/src/controllers/accounts/follow.js b/src/controllers/accounts/follow.js
index 7d1e91b5e2..3f4b3a45f1 100644
--- a/src/controllers/accounts/follow.js
+++ b/src/controllers/accounts/follow.js
@@ -36,7 +36,7 @@ function getFollow(tpl, name, req, res, callback) {
}
var method = name === 'following' ? 'getFollowing' : 'getFollowers';
user[method](userData.uid, start, stop, next);
- }
+ },
], function (err, users) {
if (err) {
return callback(err);
diff --git a/src/controllers/accounts/groups.js b/src/controllers/accounts/groups.js
index 038d63de1d..3fd97965b2 100644
--- a/src/controllers/accounts/groups.js
+++ b/src/controllers/accounts/groups.js
@@ -38,7 +38,7 @@ groupsController.get = function (req, res, callback) {
group.members = members[index];
});
next();
- }
+ },
], function (err) {
if (err) {
return callback(err);
diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js
index 2ef476a4ef..b4a2af17af 100644
--- a/src/controllers/accounts/helpers.js
+++ b/src/controllers/accounts/helpers.js
@@ -59,7 +59,7 @@ helpers.getUserDataByUserSlug = function (userslug, callerUID, callback) {
},
sso: function (next) {
plugins.fireHook('filter:auth.list', {uid: uid, associations: []}, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -144,7 +144,7 @@ helpers.getUserDataByUserSlug = function (userslug, callerUID, callback) {
userData['email:disableEdit'] = !userData.isAdmin && parseInt(meta.config['email:disableEdit'], 10) === 1;
next(null, userData);
- }
+ },
], callback);
};
diff --git a/src/controllers/accounts/info.js b/src/controllers/accounts/info.js
index 77ab2f275e..ca996b6f9e 100644
--- a/src/controllers/accounts/info.js
+++ b/src/controllers/accounts/info.js
@@ -23,9 +23,9 @@ infoController.get = function (req, res, callback) {
history: async.apply(user.getModerationHistory, userData.uid),
sessions: async.apply(user.auth.getSessions, userData.uid, req.sessionID),
usernames: async.apply(user.getHistory, 'user:' + userData.uid + ':usernames'),
- emails: async.apply(user.getHistory, 'user:' + userData.uid + ':emails')
+ emails: async.apply(user.getHistory, 'user:' + userData.uid + ':emails'),
}, next);
- }
+ },
], function (err, data) {
if (err) {
return callback(err);
diff --git a/src/controllers/accounts/notifications.js b/src/controllers/accounts/notifications.js
index 50a5a5913b..8b2479052c 100644
--- a/src/controllers/accounts/notifications.js
+++ b/src/controllers/accounts/notifications.js
@@ -14,7 +14,7 @@ notificationsController.get = function (req, res, next) {
notifications: notifications,
nextStart: 40,
title: '[[pages:notifications]]',
- breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:notifications]]'}])
+ breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:notifications]]'}]),
});
});
};
diff --git a/src/controllers/accounts/posts.js b/src/controllers/accounts/posts.js
index 9875387997..dbb1f231ac 100644
--- a/src/controllers/accounts/posts.js
+++ b/src/controllers/accounts/posts.js
@@ -18,44 +18,44 @@ var templateToData = {
set: 'bookmarks',
type: 'posts',
noItemsFoundKey: '[[topic:bookmarks.has_no_bookmarks]]',
- crumb: '[[user:bookmarks]]'
+ crumb: '[[user:bookmarks]]',
},
'account/posts': {
set: 'posts',
type: 'posts',
noItemsFoundKey: '[[user:has_no_posts]]',
- crumb: '[[global:posts]]'
+ crumb: '[[global:posts]]',
},
'account/upvoted': {
set: 'upvote',
type: 'posts',
noItemsFoundKey: '[[user:has_no_upvoted_posts]]',
- crumb: '[[global:upvoted]]'
+ crumb: '[[global:upvoted]]',
},
'account/downvoted': {
set: 'downvote',
type: 'posts',
noItemsFoundKey: '[[user:has_no_downvoted_posts]]',
- crumb: '[[global:downvoted]]'
+ crumb: '[[global:downvoted]]',
},
'account/best': {
set: 'posts:votes',
type: 'posts',
noItemsFoundKey: '[[user:has_no_voted_posts]]',
- crumb: '[[global:best]]'
+ crumb: '[[global:best]]',
},
'account/watched': {
set: 'followed_tids',
type: 'topics',
noItemsFoundKey: '[[user:has_no_watched_topics]]',
- crumb: '[[user:watched]]'
+ crumb: '[[user:watched]]',
},
'account/topics': {
set: 'topics',
type: 'topics',
noItemsFoundKey: '[[user:has_no_topics]]',
- crumb: '[[global:topics]]'
- }
+ crumb: '[[global:topics]]',
+ },
};
postsController.getBookmarks = function (req, res, next) {
@@ -101,7 +101,7 @@ function getFromUserSet(template, req, res, callback) {
},
userData: function (next) {
accountHelpers.getUserDataByUserSlug(req.params.userslug, req.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -127,9 +127,9 @@ function getFromUserSet(template, req, res, callback) {
var start = (page - 1) * itemsPerPage;
var stop = start + itemsPerPage - 1;
data.method(setName, req.uid, start, stop, next);
- }
+ },
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
diff --git a/src/controllers/accounts/profile.js b/src/controllers/accounts/profile.js
index e95fedd0d1..29d7ca57a7 100644
--- a/src/controllers/accounts/profile.js
+++ b/src/controllers/accounts/profile.js
@@ -62,7 +62,7 @@ profileController.get = function (req, res, callback) {
} else {
next();
}
- }
+ },
}, next);
},
function (results, next) {
@@ -93,20 +93,20 @@ profileController.get = function (req, res, callback) {
res.locals.metaTags = [
{
name: "title",
- content: userData.fullname || userData.username
+ content: userData.fullname || userData.username,
},
{
name: "description",
- content: plainAboutMe
+ content: plainAboutMe,
},
{
property: 'og:title',
- content: userData.fullname || userData.username
+ content: userData.fullname || userData.username,
},
{
property: 'og:description',
- content: plainAboutMe
- }
+ content: plainAboutMe,
+ },
];
if (userData.picture) {
@@ -114,13 +114,13 @@ profileController.get = function (req, res, callback) {
{
property: 'og:image',
content: userData.picture,
- noEscape: true
+ noEscape: true,
},
{
property: "og:image:url",
content: userData.picture,
- noEscape: true
- }
+ noEscape: true,
+ },
);
}
userData.selectedGroup = userData.groups.find(function (group) {
@@ -128,7 +128,7 @@ profileController.get = function (req, res, callback) {
});
plugins.fireHook('filter:user.account', {userData: userData, uid: req.uid}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
diff --git a/src/controllers/accounts/session.js b/src/controllers/accounts/session.js
index e8123820ee..a971f4ccde 100644
--- a/src/controllers/accounts/session.js
+++ b/src/controllers/accounts/session.js
@@ -42,7 +42,7 @@ sessionController.revoke = function (req, res, next) {
}
user.auth.revokeSession(_id, uid, next);
- }
+ },
], function (err) {
if (err) {
return res.status(500).send(err.message);
diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js
index 44499e7e68..39141fcb2f 100644
--- a/src/controllers/accounts/settings.js
+++ b/src/controllers/accounts/settings.js
@@ -42,7 +42,7 @@ settingsController.get = function (req, res, callback) {
},
soundsMapping: function (next) {
meta.sounds.getMapping(userData.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -53,7 +53,7 @@ settingsController.get = function (req, res, callback) {
var soundSettings = {
'notificationSound': 'notification',
'incomingChatSound': 'chat-incoming',
- 'outgoingChatSound': 'chat-outgoing'
+ 'outgoingChatSound': 'chat-outgoing',
};
Object.keys(soundSettings).forEach(function (setting) {
@@ -68,7 +68,7 @@ settingsController.get = function (req, res, callback) {
userData.customSettings = data.customSettings;
userData.disableEmailSubscriptions = parseInt(meta.config.disableEmailSubscriptions, 10) === 1;
next();
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -78,7 +78,7 @@ settingsController.get = function (req, res, callback) {
{value: 'off', name: '[[user:digest_off]]', selected: 'off' === userData.settings.dailyDigestFreq},
{value: 'day', name: '[[user:digest_daily]]', selected: 'day' === userData.settings.dailyDigestFreq},
{value: 'week', name: '[[user:digest_weekly]]', selected: 'week' === userData.settings.dailyDigestFreq},
- {value: 'month', name: '[[user:digest_monthly]]', selected: 'month' === userData.settings.dailyDigestFreq}
+ {value: 'month', name: '[[user:digest_monthly]]', selected: 'month' === userData.settings.dailyDigestFreq},
];
@@ -99,7 +99,7 @@ settingsController.get = function (req, res, callback) {
{ "name": "Spacelab", "value": "spacelab" },
{ "name": "Superhero", "value": "superhero" },
{ "name": "United", "value": "united" },
- { "name": "Yeti", "value": "yeti" }
+ { "name": "Yeti", "value": "yeti" },
];
var isCustom = true;
@@ -117,7 +117,7 @@ settingsController.get = function (req, res, callback) {
userData.homePageRoutes.push({
route: 'custom',
name: 'Custom',
- selected: isCustom
+ selected: isCustom,
});
userData.bootswatchSkinOptions.forEach(function (skin) {
@@ -157,7 +157,7 @@ function getHomePageRoutes(callback) {
categoryData = categoryData.map(function (category) {
return {
route: 'category/' + category.slug,
- name: 'Category: ' + category.name
+ name: 'Category: ' + category.name,
};
});
@@ -166,25 +166,25 @@ function getHomePageRoutes(callback) {
plugins.fireHook('filter:homepage.get', {routes: [
{
route: 'categories',
- name: 'Categories'
+ name: 'Categories',
},
{
route: 'unread',
- name: 'Unread'
+ name: 'Unread',
},
{
route: 'recent',
- name: 'Recent'
+ name: 'Recent',
},
{
route: 'popular',
- name: 'Popular'
- }
+ name: 'Popular',
+ },
].concat(categoryData)}, next);
},
function (data, next) {
next(null, data.routes);
- }
+ },
], callback);
}
diff --git a/src/controllers/admin.js b/src/controllers/admin.js
index 7f622466cd..70fbe6795d 100644
--- a/src/controllers/admin.js
+++ b/src/controllers/admin.js
@@ -10,7 +10,7 @@ var adminController = {
appearance: require('./admin/appearance'),
extend: {
widgets: require('./admin/widgets'),
- rewards: require('./admin/rewards')
+ rewards: require('./admin/rewards'),
},
events: require('./admin/events'),
logs: require('./admin/logs'),
@@ -28,7 +28,7 @@ var adminController = {
themes: require('./admin/themes'),
users: require('./admin/users'),
uploads: require('./admin/uploads'),
- info: require('./admin/info')
+ info: require('./admin/info'),
};
diff --git a/src/controllers/admin/blacklist.js b/src/controllers/admin/blacklist.js
index 73e4d6c333..e4ce35ccdc 100644
--- a/src/controllers/admin/blacklist.js
+++ b/src/controllers/admin/blacklist.js
@@ -11,7 +11,7 @@ blacklistController.get = function (req, res, next) {
}
res.render('admin/manage/ip-blacklist', {
rules: rules,
- title: '[[pages:ip-blacklist]]'
+ title: '[[pages:ip-blacklist]]',
});
});
};
diff --git a/src/controllers/admin/cache.js b/src/controllers/admin/cache.js
index 21ef6ff086..db82f05532 100644
--- a/src/controllers/admin/cache.js
+++ b/src/controllers/admin/cache.js
@@ -19,15 +19,15 @@ cacheController.get = function (req, res, next) {
max: postCache.max,
itemCount: postCache.itemCount,
percentFull: percentFull,
- avgPostSize: avgPostSize
+ avgPostSize: avgPostSize,
},
groupCache: {
length: groupCache.length,
max: groupCache.max,
itemCount: groupCache.itemCount,
percentFull: ((groupCache.length / groupCache.max) * 100).toFixed(2),
- dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false
- }
+ dump: req.query.debug ? JSON.stringify(groupCache.dump(), null, 4) : false,
+ },
});
};
diff --git a/src/controllers/admin/categories.js b/src/controllers/admin/categories.js
index 8a59bb0b4e..727332a24c 100644
--- a/src/controllers/admin/categories.js
+++ b/src/controllers/admin/categories.js
@@ -14,7 +14,7 @@ var categoriesController = {};
categoriesController.get = function (req, res, next) {
async.parallel({
category: async.apply(categories.getCategories, [req.params.category_id], req.user.uid),
- privileges: async.apply(privileges.categories.list, req.params.category_id)
+ privileges: async.apply(privileges.categories.list, req.params.category_id),
}, function (err, data) {
if (err) {
return next(err);
@@ -32,7 +32,7 @@ categoriesController.get = function (req, res, next) {
data.category.name = translator.escape(String(data.category.name));
res.render('admin/manage/category', {
category: data.category,
- privileges: data.privileges
+ privileges: data.privileges,
});
});
});
@@ -46,7 +46,7 @@ categoriesController.getAll = function (req, res, next) {
categoriesController.getAnalytics = function (req, res, next) {
async.parallel({
name: async.apply(categories.getCategoryField, req.params.category_id, 'name'),
- analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id)
+ analytics: async.apply(analytics.getCategoryAnalytics, req.params.category_id),
}, function (err, data) {
if (err) {
return next(err);
diff --git a/src/controllers/admin/dashboard.js b/src/controllers/admin/dashboard.js
index 09c2838d73..4ca100326b 100644
--- a/src/controllers/admin/dashboard.js
+++ b/src/controllers/admin/dashboard.js
@@ -20,18 +20,18 @@ dashboardController.get = function (req, res, next) {
{
done: !meta.reloadRequired,
doneText: '[[admin/general/dashboard:restart-not-required]]',
- notDoneText:'[[admin/general/dashboard:restart-required]]'
+ notDoneText:'[[admin/general/dashboard:restart-required]]',
},
{
done: plugins.hasListeners('filter:search.query'),
doneText: '[[admin/general/dashboard:search-plugin-installed]]',
notDoneText:'[[admin/general/dashboard:search-plugin-not-installed]]',
tooltip: '[[admin/general/dashboard:search-plugin-tooltip]]',
- link:'/admin/extend/plugins'
- }
+ link:'/admin/extend/plugins',
+ },
];
plugins.fireHook('filter:admin.notices', notices, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -39,7 +39,7 @@ dashboardController.get = function (req, res, next) {
res.render('admin/general/dashboard', {
version: nconf.get('version'),
notices: results.notices,
- stats: results.stats
+ stats: results.stats,
});
});
};
@@ -57,7 +57,7 @@ function getStats(callback) {
},
function (next) {
getStatsForSet('topics:tid', 'topicCount', next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -75,7 +75,7 @@ function getStatsForSet(set, field, callback) {
var terms = {
day: 86400000,
week: 604800000,
- month: 2592000000
+ month: 2592000000,
};
var now = Date.now();
@@ -91,7 +91,7 @@ function getStatsForSet(set, field, callback) {
},
alltime: function (next) {
getGlobalField(field, next);
- }
+ },
}, callback);
}
diff --git a/src/controllers/admin/database.js b/src/controllers/admin/database.js
index 5a28b95ec4..5ad87e6c5f 100644
--- a/src/controllers/admin/database.js
+++ b/src/controllers/admin/database.js
@@ -24,7 +24,7 @@ databaseController.get = function (req, res, next) {
} else {
next();
}
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
diff --git a/src/controllers/admin/errors.js b/src/controllers/admin/errors.js
index 4cacd425c9..23ab102a25 100644
--- a/src/controllers/admin/errors.js
+++ b/src/controllers/admin/errors.js
@@ -11,7 +11,7 @@ var errorsController = {};
errorsController.get = function (req, res, next) {
async.parallel({
'not-found': async.apply(meta.errors.get, true),
- analytics: async.apply(analytics.getErrorAnalytics)
+ analytics: async.apply(analytics.getErrorAnalytics),
}, function (err, data) {
if (err) {
return next(err);
@@ -24,7 +24,7 @@ errorsController.get = function (req, res, next) {
errorsController.export = function (req, res, next) {
async.waterfall([
async.apply(meta.errors.get, false),
- async.apply(json2csv)
+ async.apply(json2csv),
], function (err, csv) {
if (err) {
return next(err);
diff --git a/src/controllers/admin/events.js b/src/controllers/admin/events.js
index 8a4d63bad1..f3ac6b6925 100644
--- a/src/controllers/admin/events.js
+++ b/src/controllers/admin/events.js
@@ -22,7 +22,7 @@ eventsController.get = function (req, res, next) {
},
events: function (next) {
events.getEvents(start, stop, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -33,7 +33,7 @@ eventsController.get = function (req, res, next) {
res.render('admin/advanced/events', {
events: results.events,
pagination: pagination.create(page, pageCount),
- next: 20
+ next: 20,
});
});
};
diff --git a/src/controllers/admin/flags.js b/src/controllers/admin/flags.js
index 03c9329fca..ad81494c19 100644
--- a/src/controllers/admin/flags.js
+++ b/src/controllers/admin/flags.js
@@ -29,7 +29,7 @@ flagsController.get = function (req, res, next) {
analytics: function (next) {
analytics.getDailyStatsForSet('analytics:flags', Date.now(), 30, next);
},
- assignees: async.apply(user.getAdminsandGlobalModsandModerators)
+ assignees: async.apply(user.getAdminsandGlobalModsandModerators),
}, function (err, results) {
if (err) {
return next(err);
@@ -39,7 +39,7 @@ flagsController.get = function (req, res, next) {
results.assignees = results.assignees.map(function (userObj) {
return {
uid: userObj.uid,
- username: userObj.username
+ username: userObj.username,
};
});
@@ -94,7 +94,7 @@ function getFlagData(req, res, callback) {
}
posts.getFlags(sets, cid, req.uid, start, stop, next);
- }
+ },
], callback);
}
diff --git a/src/controllers/admin/groups.js b/src/controllers/admin/groups.js
index db940c8324..ce2fdaba97 100644
--- a/src/controllers/admin/groups.js
+++ b/src/controllers/admin/groups.js
@@ -35,7 +35,7 @@ groupsController.list = function (req, res, next) {
},
function (groupData, next) {
next(null, {groups: groupData, pagination: pagination.create(page, pageCount)});
- }
+ },
], function (err, data) {
if (err) {
return next(err);
@@ -44,7 +44,7 @@ groupsController.list = function (req, res, next) {
res.render('admin/manage/groups', {
groups: data.groups,
pagination: data.pagination,
- yourid: req.uid
+ yourid: req.uid,
});
});
};
@@ -60,7 +60,7 @@ groupsController.get = function (req, res, callback) {
return callback();
}
groups.get(groupName, {uid: req.uid, truncateUserList: true, userListCount: 20}, next);
- }
+ },
], function (err, group) {
if (err) {
return callback(err);
diff --git a/src/controllers/admin/homepage.js b/src/controllers/admin/homepage.js
index 9fdf3a2371..44d8074697 100644
--- a/src/controllers/admin/homepage.js
+++ b/src/controllers/admin/homepage.js
@@ -25,11 +25,11 @@ homePageController.get = function (req, res, next) {
categoryData = categoryData.map(function (category) {
return {
route: 'category/' + category.slug,
- name: 'Category: ' + category.name
+ name: 'Category: ' + category.name,
};
});
next(null, categoryData);
- }
+ },
], function (err, categoryData) {
if (err || !categoryData) {
categoryData = [];
@@ -38,16 +38,16 @@ homePageController.get = function (req, res, next) {
plugins.fireHook('filter:homepage.get', {routes: [
{
route: 'categories',
- name: 'Categories'
+ name: 'Categories',
},
{
route: 'recent',
- name: 'Recent'
+ name: 'Recent',
},
{
route: 'popular',
- name: 'Popular'
- }
+ name: 'Popular',
+ },
].concat(categoryData)}, function (err, data) {
if (err) {
return next(err);
@@ -55,7 +55,7 @@ homePageController.get = function (req, res, next) {
data.routes.push({
route: '',
- name: 'Custom'
+ name: 'Custom',
});
res.render('admin/general/homepage', data);
diff --git a/src/controllers/admin/info.js b/src/controllers/admin/info.js
index 8fa54ae4f0..89160fb21f 100644
--- a/src/controllers/admin/info.js
+++ b/src/controllers/admin/info.js
@@ -49,7 +49,7 @@ function getNodeInfo(callback) {
title: process.title,
version: process.version,
memoryUsage: process.memoryUsage(),
- uptime: process.uptime()
+ uptime: process.uptime(),
},
os: {
hostname: os.hostname(),
@@ -57,8 +57,8 @@ function getNodeInfo(callback) {
platform: os.platform(),
arch: os.arch(),
release: os.release(),
- load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', ')
- }
+ load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
+ },
};
async.parallel({
@@ -67,7 +67,7 @@ function getNodeInfo(callback) {
},
gitInfo: function (next) {
getGitInfo(next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -93,7 +93,7 @@ function getGitInfo(callback) {
},
branch: function (next) {
get('git rev-parse --abbrev-ref HEAD', next);
- }
+ },
}, callback);
}
diff --git a/src/controllers/admin/languages.js b/src/controllers/admin/languages.js
index 2b458d1508..5dd4b14a00 100644
--- a/src/controllers/admin/languages.js
+++ b/src/controllers/admin/languages.js
@@ -17,7 +17,7 @@ languagesController.get = function (req, res, next) {
});
res.render('admin/general/languages', {
- languages: languages
+ languages: languages,
});
});
};
diff --git a/src/controllers/admin/logs.js b/src/controllers/admin/logs.js
index 6723d3795f..e30793a8e1 100644
--- a/src/controllers/admin/logs.js
+++ b/src/controllers/admin/logs.js
@@ -13,7 +13,7 @@ logsController.get = function (req, res, next) {
}
res.render('admin/advanced/logs', {
- data: validator.escape(logs)
+ data: validator.escape(logs),
});
});
};
diff --git a/src/controllers/admin/plugins.js b/src/controllers/admin/plugins.js
index f1a72720ac..1c70077bec 100644
--- a/src/controllers/admin/plugins.js
+++ b/src/controllers/admin/plugins.js
@@ -24,7 +24,7 @@ pluginsController.get = function (req, res, next) {
next(null, plugins);
});
- }
+ },
}, function (err, payload) {
if (err) {
return next(err);
@@ -48,7 +48,7 @@ pluginsController.get = function (req, res, next) {
}),
incompatible: payload.all.filter(function (plugin) {
return compatiblePkgNames.indexOf(plugin.name) === -1;
- })
+ }),
});
});
};
diff --git a/src/controllers/admin/settings.js b/src/controllers/admin/settings.js
index 0d1f509631..ba8fb4318f 100644
--- a/src/controllers/admin/settings.js
+++ b/src/controllers/admin/settings.js
@@ -47,11 +47,11 @@ function renderEmail(req, res, next) {
path: path,
fullpath: email,
text: text,
- original: original.toString()
+ original: original.toString(),
});
});
}, next);
- }
+ },
], function (err, emails) {
if (err) {
return next(err);
@@ -61,7 +61,7 @@ function renderEmail(req, res, next) {
emails: emails,
sendable: emails.filter(function (email) {
return email.path.indexOf('_plaintext') === -1 && email.path.indexOf('partials') === -1;
- })
+ }),
});
});
}
diff --git a/src/controllers/admin/social.js b/src/controllers/admin/social.js
index 11c7982701..1a287c0272 100644
--- a/src/controllers/admin/social.js
+++ b/src/controllers/admin/social.js
@@ -12,7 +12,7 @@ socialController.get = function (req, res, next) {
}
res.render('admin/general/social', {
- posts: posts
+ posts: posts,
});
});
};
diff --git a/src/controllers/admin/sounds.js b/src/controllers/admin/sounds.js
index 801a2067ac..a097387949 100644
--- a/src/controllers/admin/sounds.js
+++ b/src/controllers/admin/sounds.js
@@ -12,12 +12,12 @@ soundsController.get = function (req, res, next) {
sounds = Object.keys(sounds).map(function (name) {
return {
- name: name
+ name: name,
};
});
res.render('admin/general/sounds', {
- sounds: sounds
+ sounds: sounds,
});
});
};
diff --git a/src/controllers/admin/uploads.js b/src/controllers/admin/uploads.js
index 346e7765e4..701294153b 100644
--- a/src/controllers/admin/uploads.js
+++ b/src/controllers/admin/uploads.js
@@ -73,8 +73,8 @@ uploadsController.uploadTouchIcon = function (req, res, next) {
path: path.join(nconf.get('upload_path'), 'system', 'touchicon-' + size + '.png'),
extension: 'png',
width: size,
- height: size
- })
+ height: size,
+ }),
], next);
}, function (err) {
fs.unlink(uploadedFile.path, function (err) {
diff --git a/src/controllers/admin/users.js b/src/controllers/admin/users.js
index 0e67c7d64c..eb774f1e26 100644
--- a/src/controllers/admin/users.js
+++ b/src/controllers/admin/users.js
@@ -18,7 +18,7 @@ var userFields = ['uid', 'username', 'userslug', 'email', 'postcount', 'joindate
usersController.search = function (req, res, next) {
res.render('admin/manage/users', {
search_display: '',
- users: []
+ users: [],
});
};
@@ -97,14 +97,14 @@ usersController.registrationQueue = function (req, res, next) {
invites.invitations = invites.invitations.map(function (email, i) {
return {
email: email,
- username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i]
+ username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i],
};
});
});
next(null, invitations);
- }
+ },
], next);
- }
+ },
}, function (err, data) {
if (err) {
return next(err);
@@ -142,9 +142,9 @@ function getUsers(set, section, min, max, req, res, next) {
},
function (uids, next) {
user.getUsersWithFields(uids, userFields, req.uid, next);
- }
+ },
], next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -157,7 +157,7 @@ function getUsers(set, section, min, max, req, res, next) {
var data = {
users: results.users,
page: page,
- pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage))
+ pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage)),
};
data[section] = true;
render(req, res, data);
@@ -181,7 +181,7 @@ usersController.getCSV = function (req, res, next) {
events.log({
type: 'getUsersCSV',
uid: req.user.uid,
- ip: req.ip
+ ip: req.ip,
});
user.getUsersCSV(function (err, data) {
diff --git a/src/controllers/api.js b/src/controllers/api.js
index 1bbf3962c8..ff2f0041ac 100644
--- a/src/controllers/api.js
+++ b/src/controllers/api.js
@@ -71,7 +71,7 @@ apiController.getConfig = function (req, res, next) {
enabled: parseInt(meta.config.cookieConsentEnabled, 10) === 1,
message: translator.escape(meta.config.cookieConsentMessage || '[[global:cookies.message]]').replace(/\\/g, '\\\\'),
dismiss: translator.escape(meta.config.cookieConsentDismiss || '[[global:cookies.accept]]').replace(/\\/g, '\\\\'),
- link: translator.escape(meta.config.cookieConsentLink || '[[global:cookies.learn_more]]').replace(/\\/g, '\\\\')
+ link: translator.escape(meta.config.cookieConsentLink || '[[global:cookies.learn_more]]').replace(/\\/g, '\\\\'),
};
async.waterfall([
@@ -93,7 +93,7 @@ apiController.getConfig = function (req, res, next) {
config.delayImageLoading = settings.delayImageLoading !== undefined ? settings.delayImageLoading : true;
config.bootswatchSkin = settings.bootswatchSkin || config.bootswatchSkin;
plugins.fireHook('filter:config.get', config, next);
- }
+ },
], function (err, config) {
if (err) {
return next(err);
@@ -119,7 +119,7 @@ apiController.renderWidgets = function (req, res, next) {
url: req.query.url,
locations: req.query.locations,
isMobile: req.query.isMobile === 'true',
- cid: req.query.cid
+ cid: req.query.cid,
},
req,
res,
@@ -138,7 +138,7 @@ apiController.getPostData = function (pid, uid, callback) {
},
post: function (next) {
posts.getPostData(pid, next);
- }
+ },
}, function (err, results) {
if (err || !results.post) {
return callback(err);
@@ -167,7 +167,7 @@ apiController.getTopicData = function (tid, uid, callback) {
},
topic: function (next) {
topics.getTopicData(tid, next);
- }
+ },
}, function (err, results) {
if (err || !results.topic) {
return callback(err);
@@ -187,7 +187,7 @@ apiController.getCategoryData = function (cid, uid, callback) {
},
category: function (next) {
categories.getCategoryData(cid, next);
- }
+ },
}, function (err, results) {
if (err || !results.category) {
return callback(err);
@@ -205,7 +205,7 @@ apiController.getObject = function (req, res, next) {
var methods = {
post: apiController.getPostData,
topic: apiController.getTopicData,
- category: apiController.getCategoryData
+ category: apiController.getCategoryData,
};
var method = methods[req.params.type];
if (!method) {
@@ -230,7 +230,7 @@ apiController.getCurrentUser = function (req, res, next) {
},
function (userslug, next) {
accountHelpers.getUserDataByUserSlug(userslug, req.uid, next);
- }
+ },
], function (err, userData) {
if (err) {
return next(err);
@@ -278,7 +278,7 @@ apiController.getUserDataByField = function (callerUid, field, fieldValue, callb
return next();
}
apiController.getUserDataByUID(callerUid, uid, next);
- }
+ },
], callback);
};
@@ -293,7 +293,7 @@ apiController.getUserDataByUID = function (callerUid, uid, callback) {
async.parallel({
userData: async.apply(user.getUserData, uid),
- settings: async.apply(user.getSettings, uid)
+ settings: async.apply(user.getSettings, uid),
}, function (err, results) {
if (err || !results.userData) {
return callback(err || new Error('[[error:no-user]]'));
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index 90a1715cbb..289b43055e 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -82,7 +82,7 @@ authenticationController.register = function (req, res, next) {
} else {
registerAndLoginUser(req, res, userData, next);
}
- }
+ },
], function (err, data) {
if (err) {
return res.status(400).send(err.message);
@@ -102,7 +102,7 @@ function registerAndLoginUser(req, res, userData, callback) {
function (next) {
plugins.fireHook('filter:register.interstitial', {
userData: userData,
- interstitials: []
+ interstitials: [],
}, function (err, data) {
if (err) {
return next(err);
@@ -134,7 +134,7 @@ function registerAndLoginUser(req, res, userData, callback) {
function (next) {
user.deleteInvitationKey(userData.email);
plugins.fireHook('filter:register.complete', {uid: uid, referrer: req.body.referrer || nconf.get('relative_path') + '/'}, next);
- }
+ },
], callback);
}
@@ -146,7 +146,7 @@ function addToApprovalQueue(req, userData, callback) {
},
function (next) {
next(null, {message: '[[register:registration-added-to-queue]]'});
- }
+ },
], callback);
}
@@ -154,7 +154,7 @@ authenticationController.registerComplete = function (req, res, next) {
// For the interstitials that respond, execute the callback with the form body
plugins.fireHook('filter:register.interstitial', {
userData: req.session.registration,
- interstitials: []
+ interstitials: [],
}, function (err, data) {
if (err) {
return next(err);
@@ -310,7 +310,7 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) {
datetime: Date.now(),
platform: req.useragent.platform,
browser: req.useragent.browser,
- version: req.useragent.version
+ version: req.useragent.version,
});
// Associate login session with user
@@ -323,7 +323,7 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) {
},
function (next) {
user.updateLastOnlineTime(uid, next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -369,7 +369,7 @@ authenticationController.localLogin = function (req, username, password, next) {
},
banned: function (next) {
user.isBanned(uid, next);
- }
+ },
}, next);
},
function (result, next) {
@@ -408,7 +408,7 @@ authenticationController.localLogin = function (req, username, password, next) {
}
user.auth.clearLoginAttempts(uid);
next(null, userData, '[[success:authentication-successful]]');
- }
+ },
], next);
};
diff --git a/src/controllers/categories.js b/src/controllers/categories.js
index 9a18e7f1dd..7fbc26d474 100644
--- a/src/controllers/categories.js
+++ b/src/controllers/categories.js
@@ -13,16 +13,16 @@ var categoriesController = {};
categoriesController.list = function (req, res, next) {
res.locals.metaTags = [{
name: "title",
- content: validator.escape(String(meta.config.title || 'NodeBB'))
+ content: validator.escape(String(meta.config.title || 'NodeBB')),
}, {
name: "description",
- content: validator.escape(String(meta.config.description || ''))
+ content: validator.escape(String(meta.config.description || '')),
}, {
property: 'og:title',
- content: '[[pages:categories]]'
+ content: '[[pages:categories]]',
}, {
property: 'og:type',
- content: 'website'
+ content: 'website',
}];
var ogImage = meta.config['og:image'] || meta.config['brand:logo'] || '';
@@ -32,7 +32,7 @@ categoriesController.list = function (req, res, next) {
}
res.locals.metaTags.push({
property: 'og:image',
- content: ogImage
+ content: ogImage,
});
}
@@ -48,7 +48,7 @@ categoriesController.list = function (req, res, next) {
categories.flattenCategories(allCategories, categoryData);
categories.getRecentTopicReplies(allCategories, req.uid, next);
- }
+ },
], function (err) {
if (err) {
return next(err);
@@ -56,7 +56,7 @@ categoriesController.list = function (req, res, next) {
var data = {
title: '[[pages:categories]]',
- categories: categoryData
+ categories: categoryData,
};
if (req.path.startsWith('/api/categories') || req.path.startsWith('/categories')) {
@@ -68,7 +68,7 @@ categoriesController.list = function (req, res, next) {
category.teaser = {
url: nconf.get('relative_path') + '/topic/' + category.posts[0].topic.slug + '/' + category.posts[0].index,
timestampISO: category.posts[0].timestampISO,
- pid: category.posts[0].pid
+ pid: category.posts[0].pid,
};
}
});
diff --git a/src/controllers/category.js b/src/controllers/category.js
index 3570f279ee..70e167b9c7 100644
--- a/src/controllers/category.js
+++ b/src/controllers/category.js
@@ -37,7 +37,7 @@ categoryController.get = function (req, res, callback) {
},
userSettings: function (next) {
user.getSettings(req.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -97,7 +97,7 @@ categoryController.get = function (req, res, callback) {
start: start,
stop: stop,
uid: req.uid,
- settings: settings
+ settings: settings,
};
async.waterfall([
@@ -120,7 +120,7 @@ categoryController.get = function (req, res, callback) {
}
}
categories.getCategoryById(payload, next);
- }
+ },
], next);
},
function (categoryData, next) {
@@ -135,8 +135,8 @@ categoryController.get = function (req, res, callback) {
var breadcrumbs = [
{
text: categoryData.name,
- url: nconf.get('relative_path') + '/category/' + categoryData.slug
- }
+ url: nconf.get('relative_path') + '/category/' + categoryData.slug,
+ },
];
helpers.buildCategoryBreadcrumbs(categoryData.parentCid, function (err, crumbs) {
if (err) {
@@ -155,7 +155,7 @@ categoryController.get = function (req, res, callback) {
categories.getRecentTopicReplies(allCategories, req.uid, function (err) {
next(err, categoryData);
});
- }
+ },
], function (err, categoryData) {
if (err) {
return callback(err);
@@ -167,26 +167,26 @@ categoryController.get = function (req, res, callback) {
res.locals.metaTags = [
{
name: 'title',
- content: categoryData.name
+ content: categoryData.name,
},
{
property: 'og:title',
- content: categoryData.name
+ content: categoryData.name,
},
{
name: 'description',
- content: categoryData.description
+ content: categoryData.description,
},
{
property: "og:type",
- content: 'website'
- }
+ content: 'website',
+ },
];
if (categoryData.backgroundImage) {
res.locals.metaTags.push({
name: 'og:image',
- content: categoryData.backgroundImage
+ content: categoryData.backgroundImage,
});
}
@@ -194,12 +194,12 @@ categoryController.get = function (req, res, callback) {
{
rel: 'alternate',
type: 'application/rss+xml',
- href: nconf.get('url') + '/category/' + cid + '.rss'
+ href: nconf.get('url') + '/category/' + cid + '.rss',
},
{
rel: 'up',
- href: nconf.get('url')
- }
+ href: nconf.get('url'),
+ },
];
if (parseInt(req.uid, 10)) {
diff --git a/src/controllers/groups.js b/src/controllers/groups.js
index 2cbbcc7c76..442c764d46 100644
--- a/src/controllers/groups.js
+++ b/src/controllers/groups.js
@@ -40,7 +40,7 @@ groupsController.getGroupsFromSet = function (uid, sort, start, stop, callback)
callback(null, {
groups: groups,
allowGroupCreation: parseInt(meta.config.allowGroupCreation, 10) === 1,
- nextStart: stop + 1
+ nextStart: stop + 1,
});
});
};
@@ -58,7 +58,7 @@ groupsController.details = function (req, res, callback) {
}
async.parallel({
exists: async.apply(groups.exists, groupName),
- hidden: async.apply(groups.isHidden, groupName)
+ hidden: async.apply(groups.isHidden, groupName),
}, next);
},
function (results, next) {
@@ -70,7 +70,7 @@ groupsController.details = function (req, res, callback) {
}
async.parallel({
isMember: async.apply(groups.isMember, req.uid, groupName),
- isInvited: async.apply(groups.isInvited, req.uid, groupName)
+ isInvited: async.apply(groups.isInvited, req.uid, groupName),
}, function (err, checks) {
if (err || checks.isMember || checks.isInvited) {
return next(err);
@@ -84,7 +84,7 @@ groupsController.details = function (req, res, callback) {
groups.get(groupName, {
uid: req.uid,
truncateUserList: true,
- userListCount: 20
+ userListCount: 20,
}, next);
},
posts: function (next) {
@@ -95,9 +95,9 @@ groupsController.details = function (req, res, callback) {
},
isGlobalMod: function (next) {
user.isGlobalModerator(req.uid, next);
- }
+ },
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -129,7 +129,7 @@ groupsController.members = function (req, res, callback) {
async.parallel({
isAdminOrGlobalMod: async.apply(user.isAdminOrGlobalMod, req.uid),
isMember: async.apply(groups.isMember, req.uid, groupName),
- isHidden: async.apply(groups.isHidden, groupName)
+ isHidden: async.apply(groups.isHidden, groupName),
}, next);
},
function (results, next) {
@@ -147,14 +147,14 @@ groupsController.members = function (req, res, callback) {
var breadcrumbs = helpers.buildBreadcrumbs([
{text: '[[pages:groups]]', url: '/groups' },
{text: validator.escape(String(groupName)), url: '/groups/' + req.params.slug},
- {text: '[[groups:details.members]]'}
+ {text: '[[groups:details.members]]'},
]);
res.render('groups/members', {
users: users,
nextStart: 50,
loadmore_display: users.length > 50 ? 'block' : 'hide',
- breadcrumbs: breadcrumbs
+ breadcrumbs: breadcrumbs,
});
});
};
@@ -173,9 +173,9 @@ groupsController.uploadCover = function (req, res, next) {
groups.updateCover(req.uid, {
file: req.files.files[0].path,
- groupName: params.groupName
+ groupName: params.groupName,
}, next);
- }
+ },
], function (err, image) {
if (err) {
return next(err);
diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js
index 488ac6507c..3500ac9158 100644
--- a/src/controllers/helpers.js
+++ b/src/controllers/helpers.js
@@ -17,7 +17,7 @@ helpers.notAllowed = function (req, res, error) {
plugins.fireHook('filter:helpers.notAllowed', {
req: req,
res: res,
- error: error
+ error: error,
}, function (err, data) {
if (err) {
return winston.error(err);
@@ -28,14 +28,14 @@ helpers.notAllowed = function (req, res, error) {
path: req.path.replace(/^\/api/, ''),
loggedIn: !!req.uid,
error: error,
- title: '[[global:403.title]]'
+ title: '[[global:403.title]]',
});
} else {
res.status(403).render('403', {
path: req.path,
loggedIn: !!req.uid,
error: error,
- title: '[[global:403.title]]'
+ title: '[[global:403.title]]',
});
}
} else {
@@ -72,7 +72,7 @@ helpers.buildCategoryBreadcrumbs = function (cid, callback) {
if (!parseInt(data.disabled, 10)) {
breadcrumbs.unshift({
text: validator.escape(String(data.name)),
- url: nconf.get('relative_path') + '/category/' + data.slug
+ url: nconf.get('relative_path') + '/category/' + data.slug,
});
}
@@ -87,13 +87,13 @@ helpers.buildCategoryBreadcrumbs = function (cid, callback) {
if (!meta.config.homePageRoute && meta.config.homePageCustom) {
breadcrumbs.unshift({
text: '[[global:header.categories]]',
- url: nconf.get('relative_path') + '/categories'
+ url: nconf.get('relative_path') + '/categories',
});
}
breadcrumbs.unshift({
text: '[[global:home]]',
- url: nconf.get('relative_path') + '/'
+ url: nconf.get('relative_path') + '/',
});
callback(null, breadcrumbs);
@@ -104,8 +104,8 @@ helpers.buildBreadcrumbs = function (crumbs) {
var breadcrumbs = [
{
text: '[[global:home]]',
- url: nconf.get('relative_path') + '/'
- }
+ url: nconf.get('relative_path') + '/',
+ },
];
crumbs.forEach(function (crumb) {
@@ -165,7 +165,7 @@ helpers.getWatchedCategories = function (uid, selectedCid, callback) {
});
next(null, {categories: categoriesData, selectedCategory: selectedCategory});
- }
+ },
], callback);
};
diff --git a/src/controllers/index.js b/src/controllers/index.js
index 800559db4b..7ce1730dd6 100644
--- a/src/controllers/index.js
+++ b/src/controllers/index.js
@@ -28,7 +28,7 @@ var Controllers = {
admin: require('./admin'),
globalMods: require('./globalmods'),
mods: require('./mods'),
- sitemap: require('./sitemap')
+ sitemap: require('./sitemap'),
};
@@ -84,7 +84,7 @@ Controllers.reset = function (req, res, next) {
code: req.params.code,
minimumPasswordLength: parseInt(meta.config.minimumPasswordLength, 10),
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[reset_password:reset_password]]', url: '/reset'}, {text: '[[reset_password:update_password]]'}]),
- title: '[[pages:reset]]'
+ title: '[[pages:reset]]',
});
delete req.session.passwordExpired;
@@ -93,7 +93,7 @@ Controllers.reset = function (req, res, next) {
res.render('reset', {
code: null,
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[reset_password:reset_password]]'}]),
- title: '[[pages:reset]]'
+ title: '[[pages:reset]]',
});
}
};
@@ -129,7 +129,7 @@ Controllers.login = function (req, res, next) {
if (!data.allowLocalLogin && !data.allowRegistration && data.alternate_logins && data.authentication.length === 1) {
if (res.locals.isAPI) {
return helpers.redirect(res, {
- external: data.authentication[0].url
+ external: data.authentication[0].url,
});
} else {
return res.redirect(nconf.get('relative_path') + data.authentication[0].url);
@@ -172,7 +172,7 @@ Controllers.register = function (req, res, next) {
},
function (next) {
plugins.fireHook('filter:parse.post', {postData: {content: meta.config.termsOfUse || ''}}, next);
- }
+ },
], function (err, termsOfUse) {
if (err) {
return next(err);
@@ -180,7 +180,7 @@ Controllers.register = function (req, res, next) {
var loginStrategies = require('../routes/authentication').getLoginStrategies();
var data = {
'register_window:spansize': loginStrategies.length ? 'col-md-6' : 'col-md-12',
- 'alternate_logins': !!loginStrategies.length
+ 'alternate_logins': !!loginStrategies.length,
};
data.authentication = loginStrategies;
@@ -205,7 +205,7 @@ Controllers.registerInterstitial = function (req, res, next) {
plugins.fireHook('filter:register.interstitial', {
userData: req.session.registration,
- interstitials: []
+ interstitials: [],
}, function (err, data) {
if (err) {
return next(err);
@@ -230,7 +230,7 @@ Controllers.registerInterstitial = function (req, res, next) {
res.render('registerComplete', {
title: '[[pages:registration-complete]]',
errors: errors,
- sections: sections
+ sections: sections,
});
});
});
@@ -241,7 +241,7 @@ Controllers.compose = function (req, res, next) {
req: req,
res: res,
next: next,
- templateData: {}
+ templateData: {},
}, function (err, data) {
if (err) {
return next(err);
@@ -249,7 +249,7 @@ Controllers.compose = function (req, res, next) {
if (data.templateData.disabled) {
res.render('', {
- title: '[[modules:composer.compose]]'
+ title: '[[modules:composer.compose]]',
});
} else {
data.templateData.title = '[[modules:composer.compose]]';
@@ -285,7 +285,7 @@ Controllers.manifest = function (req, res) {
start_url: nconf.get('relative_path') + '/',
display: 'standalone',
orientation: 'portrait',
- icons: []
+ icons: [],
};
if (meta.config['brand:touchIcon']) {
@@ -293,32 +293,32 @@ Controllers.manifest = function (req, res) {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-36.png',
sizes: '36x36',
type: 'image/png',
- density: 0.75
+ density: 0.75,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-48.png',
sizes: '48x48',
type: 'image/png',
- density: 1.0
+ density: 1.0,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-72.png',
sizes: '72x72',
type: 'image/png',
- density: 1.5
+ density: 1.5,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-96.png',
sizes: '96x96',
type: 'image/png',
- density: 2.0
+ density: 2.0,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-144.png',
sizes: '144x144',
type: 'image/png',
- density: 3.0
+ density: 3.0,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-192.png',
sizes: '192x192',
type: 'image/png',
- density: 4.0
+ density: 4.0,
});
}
@@ -330,7 +330,7 @@ Controllers.outgoing = function (req, res) {
var data = {
outgoing: validator.escape(String(url)),
title: meta.config.title,
- breadcrumbs: helpers.buildBreadcrumbs([{text: '[[notifications:outgoing_link]]'}])
+ breadcrumbs: helpers.buildBreadcrumbs([{text: '[[notifications:outgoing_link]]'}]),
};
if (url) {
@@ -359,7 +359,7 @@ Controllers.handle404 = function (req, res) {
return plugins.fireHook('action:meta.override404', {
req: req,
res: res,
- error: {}
+ error: {},
});
}
@@ -404,7 +404,7 @@ Controllers.handleURIErrors = function (err, req, res, next) {
winston.warn('[controller] Bad request: ' + req.path);
if (res.locals.isAPI) {
res.status(400).json({
- error: '[[global:400.title]]'
+ error: '[[global:400.title]]',
});
} else {
var middleware = require('../middleware');
diff --git a/src/controllers/mods.js b/src/controllers/mods.js
index 0079412f87..4581d7d645 100644
--- a/src/controllers/mods.js
+++ b/src/controllers/mods.js
@@ -10,7 +10,7 @@ var modsController = {};
modsController.flagged = function (req, res, next) {
async.parallel({
isAdminOrGlobalMod: async.apply(user.isAdminOrGlobalMod, req.uid),
- moderatedCids: async.apply(user.getModeratedCids, req.uid)
+ moderatedCids: async.apply(user.getModeratedCids, req.uid),
}, function (err, results) {
if (err || !(results.isAdminOrGlobalMod || !!results.moderatedCids.length)) {
return next(err);
diff --git a/src/controllers/popular.js b/src/controllers/popular.js
index f38edd594c..62e25435bc 100644
--- a/src/controllers/popular.js
+++ b/src/controllers/popular.js
@@ -14,7 +14,7 @@ var lastUpdateTime = 0;
var terms = {
daily: 'day',
weekly: 'week',
- monthly: 'month'
+ monthly: 'month',
};
popularController.get = function (req, res, next) {
@@ -30,7 +30,7 @@ popularController.get = function (req, res, next) {
day: '[[recent:day]]',
week: '[[recent:week]]',
month: '[[recent:month]]',
- alltime: '[[global:header.popular]]'
+ alltime: '[[global:header.popular]]',
};
if (!req.uid) {
@@ -49,7 +49,7 @@ popularController.get = function (req, res, next) {
'feeds:disableRSS': parseInt(meta.config['feeds:disableRSS'], 10) === 1,
rssFeedUrl: nconf.get('relative_path') + '/popular/' + (req.params.term || 'daily') + '.rss',
title: '[[pages:popular-' + term + ']]',
- term: term
+ term: term,
};
if (req.path.startsWith('/api/popular') || req.path.startsWith('/popular')) {
diff --git a/src/controllers/recent.js b/src/controllers/recent.js
index 2da6e7d09c..a8abd92d28 100644
--- a/src/controllers/recent.js
+++ b/src/controllers/recent.js
@@ -35,7 +35,7 @@ recentController.get = function (req, res, next) {
},
watchedCategories: function (next) {
helpers.getWatchedCategories(req.uid, cid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -46,7 +46,7 @@ recentController.get = function (req, res, next) {
stop = start + settings.topicsPerPage - 1;
topics.getRecentTopics(cid, req.uid, start, stop, filter, next);
- }
+ },
], function (err, data) {
if (err) {
return next(err);
@@ -63,17 +63,17 @@ recentController.get = function (req, res, next) {
name: '[[unread:all-topics]]',
url: 'recent',
selected: filter === '',
- filter: ''
+ filter: '',
}, {
name: '[[unread:new-topics]]',
url: 'recent/new',
selected: filter === 'new',
- filter: 'new'
+ filter: 'new',
}, {
name: '[[unread:watched-topics]]',
url: 'recent/watched',
selected: filter === 'watched',
- filter: 'watched'
+ filter: 'watched',
}];
data.selectedFilter = data.filters.find(function (filter) {
diff --git a/src/controllers/search.js b/src/controllers/search.js
index 2261e4f3b7..f91577190b 100644
--- a/src/controllers/search.js
+++ b/src/controllers/search.js
@@ -42,12 +42,12 @@ searchController.search = function (req, res, next) {
sortDirection: req.query.sortDirection,
page: page,
uid: req.uid,
- qs: req.query
+ qs: req.query,
};
async.parallel({
categories: async.apply(categories.buildForSelect, req.uid),
- search: async.apply(search.search, data)
+ search: async.apply(search.search, data),
}, function (err, results) {
if (err) {
return next(err);
@@ -55,7 +55,7 @@ searchController.search = function (req, res, next) {
var categoriesData = [
{value: 'all', text: '[[unread:all_categories]]'},
- {value: 'watched', text: '[[category:watched-categories]]'}
+ {value: 'watched', text: '[[category:watched-categories]]'},
].concat(results.categories);
var searchData = results.search;
diff --git a/src/controllers/tags.js b/src/controllers/tags.js
index a433694220..1be03d603e 100644
--- a/src/controllers/tags.js
+++ b/src/controllers/tags.js
@@ -20,7 +20,7 @@ tagsController.getTag = function (req, res, next) {
topics: [],
tag: tag,
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[tags:tags]]', url: '/tags'}, {text: tag}]),
- title: '[[pages:tag, ' + tag + ']]'
+ title: '[[pages:tag, ' + tag + ']]',
};
var settings;
var topicCount = 0;
@@ -39,7 +39,7 @@ tagsController.getTag = function (req, res, next) {
},
tids: function (next) {
topics.getTagTids(req.params.tag, start, stop, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -48,7 +48,7 @@ tagsController.getTag = function (req, res, next) {
}
topicCount = results.topicCount;
topics.getTopics(results.tids, req.uid, next);
- }
+ },
], function (err, topics) {
if (err) {
return next(err);
@@ -57,16 +57,16 @@ tagsController.getTag = function (req, res, next) {
res.locals.metaTags = [
{
name: 'title',
- content: tag
+ content: tag,
},
{
property: 'og:title',
- content: tag
+ content: tag,
},
{
property: 'og:url',
- content: nconf.get('url') + '/tags/' + tag
- }
+ content: nconf.get('url') + '/tags/' + tag,
+ },
];
templateData.topics = topics;
@@ -87,7 +87,7 @@ tagsController.getTags = function (req, res, next) {
tags: tags,
nextStart: 100,
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[tags:tags]]'}]),
- title: '[[pages:tags]]'
+ title: '[[pages:tags]]',
};
res.render('tags', data);
});
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index 1224de5bcd..5db311a8ad 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -39,7 +39,7 @@ topicsController.get = function (req, res, callback) {
},
topic: function (next) {
topics.getTopicData(tid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -132,11 +132,11 @@ topicsController.get = function (req, res, callback) {
var breadcrumbs = [
{
text: data.topicData.category.name,
- url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug
+ url: nconf.get('relative_path') + '/category/' + data.topicData.category.slug,
},
{
- text: data.topicData.title
- }
+ text: data.topicData.title,
+ },
];
helpers.buildCategoryBreadcrumbs(data.topicData.category.parentCid, function (err, crumbs) {
@@ -188,70 +188,70 @@ topicsController.get = function (req, res, callback) {
res.locals.metaTags = [
{
name: "title",
- content: topicData.titleRaw
+ content: topicData.titleRaw,
},
{
name: "description",
- content: description
+ content: description,
},
{
property: 'og:title',
- content: topicData.titleRaw
+ content: topicData.titleRaw,
},
{
property: 'og:description',
- content: description
+ content: description,
},
{
property: "og:type",
- content: 'article'
+ content: 'article',
},
{
property: "og:url",
content: nconf.get('url') + '/topic/' + topicData.slug + (req.params.post_index ? ('/' + req.params.post_index) : ''),
- noEscape: true
+ noEscape: true,
},
{
property: 'og:image',
content: ogImageUrl,
- noEscape: true
+ noEscape: true,
},
{
property: "og:image:url",
content: ogImageUrl,
- noEscape: true
+ noEscape: true,
},
{
property: "article:published_time",
- content: utils.toISOString(topicData.timestamp)
+ content: utils.toISOString(topicData.timestamp),
},
{
property: 'article:modified_time',
- content: utils.toISOString(topicData.lastposttime)
+ content: utils.toISOString(topicData.lastposttime),
},
{
property: 'article:section',
- content: topicData.category ? topicData.category.name : ''
- }
+ content: topicData.category ? topicData.category.name : '',
+ },
];
res.locals.linkTags = [
{
rel: 'alternate',
type: 'application/rss+xml',
- href: nconf.get('url') + '/topic/' + tid + '.rss'
- }
+ href: nconf.get('url') + '/topic/' + tid + '.rss',
+ },
];
if (topicData.category) {
res.locals.linkTags.push({
rel: 'up',
- href: nconf.get('url') + '/category/' + topicData.category.slug
+ href: nconf.get('url') + '/category/' + topicData.category.slug,
});
}
next(null, topicData);
- }
+ },
], function (err, data) {
if (err) {
return callback(err);
@@ -317,7 +317,7 @@ topicsController.teaser = function (req, res, next) {
return res.status(404).json('not-found');
}
posts.getPostSummaryByPids([pid], req.uid, {stripTags: false}, next);
- }
+ },
], function (err, posts) {
if (err) {
return next(err);
@@ -341,7 +341,7 @@ topicsController.pagination = function (req, res, callback) {
async.parallel({
privileges: async.apply(privileges.topics.get, tid, req.uid),
settings: async.apply(user.getSettings, req.uid),
- topic: async.apply(topics.getTopicData, tid)
+ topic: async.apply(topics.getTopicData, tid),
}, function (err, results) {
if (err || !results.topic) {
return callback(err);
diff --git a/src/controllers/unread.js b/src/controllers/unread.js
index 83de85a67e..ef390ba7e0 100644
--- a/src/controllers/unread.js
+++ b/src/controllers/unread.js
@@ -32,7 +32,7 @@ unreadController.get = function (req, res, next) {
},
settings: function (next) {
user.getSettings(req.uid, next);
- }
+ },
}, next);
},
function (_results, next) {
@@ -41,7 +41,7 @@ unreadController.get = function (req, res, next) {
var start = Math.max(0, (page - 1) * settings.topicsPerPage);
var stop = start + settings.topicsPerPage - 1;
topics.getUnreadTopics(cid, req.uid, start, stop, filter, next);
- }
+ },
], function (err, data) {
if (err) {
return next(err);
@@ -67,17 +67,17 @@ unreadController.get = function (req, res, next) {
name: '[[unread:all-topics]]',
url: 'unread',
selected: filter === '',
- filter: ''
+ filter: '',
}, {
name: '[[unread:new-topics]]',
url: 'unread/new',
selected: filter === 'new',
- filter: 'new'
+ filter: 'new',
}, {
name: '[[unread:watched-topics]]',
url: 'unread/watched',
selected: filter === 'watched',
- filter: 'watched'
+ filter: 'watched',
}];
data.selectedFilter = data.filters.find(function (filter) {
diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js
index 18b0b63dda..6f98dabdf2 100644
--- a/src/controllers/uploads.js
+++ b/src/controllers/uploads.js
@@ -72,7 +72,7 @@ function uploadAsImage(req, uploadedFile, callback) {
}
resizeImage(fileObj, next);
- }
+ },
], callback);
}
@@ -89,7 +89,7 @@ function uploadAsFile(req, uploadedFile, callback) {
return next(new Error('[[error:uploads-are-disabled]]'));
}
uploadFile(req.uid, uploadedFile, next);
- }
+ },
], callback);
}
@@ -111,7 +111,7 @@ function resizeImage(fileObj, callback) {
path: fileObj.path,
target: path.join(dirname, basename + '-resized' + extname),
extension: extname,
- width: parseInt(meta.config.maximumImageWidth, 10) || 760
+ width: parseInt(meta.config.maximumImageWidth, 10) || 760,
}, next);
},
function (next) {
@@ -124,7 +124,7 @@ function resizeImage(fileObj, callback) {
fileObj.url = path.join(dirname, basename + '-resized' + extname);
next(null, fileObj);
- }
+ },
], callback);
}
@@ -149,7 +149,7 @@ uploadsController.uploadThumb = function (req, res, next) {
path: uploadedFile.path,
extension: path.extname(uploadedFile.name),
width: size,
- height: size
+ height: size,
}, function (err) {
if (err) {
return next(err);
@@ -223,7 +223,7 @@ function saveFileToLocal(uploadedFile, callback) {
callback(null, {
url: nconf.get('relative_path') + upload.url,
path: upload.path,
- name: uploadedFile.name
+ name: uploadedFile.name,
});
});
}
diff --git a/src/controllers/users.js b/src/controllers/users.js
index baf18a5b64..78a9f8beb1 100644
--- a/src/controllers/users.js
+++ b/src/controllers/users.js
@@ -20,7 +20,7 @@ usersController.index = function (req, res, next) {
'sort-posts': usersController.getUsersSortedByPosts,
'sort-reputation': usersController.getUsersSortedByReputation,
banned: usersController.getBannedUsers,
- flagged: usersController.getFlaggedUsers
+ flagged: usersController.getFlaggedUsers,
};
if (req.query.term) {
@@ -42,12 +42,12 @@ usersController.search = function (req, res, next) {
sortBy: req.query.sortBy,
onlineOnly: req.query.onlineOnly === 'true',
bannedOnly: req.query.bannedOnly === 'true',
- flaggedOnly: req.query.flaggedOnly === 'true'
+ flaggedOnly: req.query.flaggedOnly === 'true',
}, next);
},
isAdminOrGlobalMod: function (next) {
user.isAdminOrGlobalMod(req.uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -69,7 +69,7 @@ usersController.getOnlineUsers = function (req, res, next) {
},
guests: function (next) {
require('../socket.io/admin/rooms').getTotalGuestCount(next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -175,7 +175,7 @@ usersController.getUsers = function (set, uid, query, callback) {
},
usersData: function (next) {
usersController.getUsersAndCount(set, uid, start, stop, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -188,7 +188,7 @@ usersController.getUsers = function (set, uid, query, callback) {
userCount: results.usersData.count,
title: setToData[set].title || '[[pages:users/latest]]',
breadcrumbs: helpers.buildBreadcrumbs(breadcrumbs),
- isAdminOrGlobalMod: results.isAdminOrGlobalMod
+ isAdminOrGlobalMod: results.isAdminOrGlobalMod,
};
userData['section_' + (query.section || 'joindate')] = true;
callback(null, userData);
@@ -211,7 +211,7 @@ usersController.getUsersAndCount = function (set, uid, start, stop, callback) {
} else {
db.getObjectField('global', 'userCount', next);
}
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/database/mongo.js b/src/database/mongo.js
index 3a3331e900..61128f9916 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -17,30 +17,30 @@
{
name: 'mongo:host',
description: 'Host IP or address of your MongoDB instance',
- 'default': nconf.get('mongo:host') || '127.0.0.1'
+ 'default': nconf.get('mongo:host') || '127.0.0.1',
},
{
name: 'mongo:port',
description: 'Host port of your MongoDB instance',
- 'default': nconf.get('mongo:port') || 27017
+ 'default': nconf.get('mongo:port') || 27017,
},
{
name: 'mongo:username',
description: 'MongoDB username',
- 'default': nconf.get('mongo:username') || ''
+ 'default': nconf.get('mongo:username') || '',
},
{
name: 'mongo:password',
description: 'Password of your MongoDB database',
hidden: true,
default: nconf.get('mongo:password') || '',
- before: function (value) { value = value || nconf.get('mongo:password') || ''; return value; }
+ before: function (value) { value = value || nconf.get('mongo:password') || ''; return value; },
},
{
name: "mongo:database",
description: "MongoDB database name",
- 'default': nconf.get('mongo:database') || 'nodebb'
- }
+ 'default': nconf.get('mongo:database') || 'nodebb',
+ },
];
module.helpers = module.helpers || {};
@@ -84,8 +84,8 @@
var connOptions = {
server: {
- poolSize: parseInt(nconf.get('mongo:poolSize'), 10) || 10
- }
+ poolSize: parseInt(nconf.get('mongo:poolSize'), 10) || 10,
+ },
};
connOptions = _.deepExtend((nconf.get('mongo:options') || {}), connOptions);
@@ -135,13 +135,13 @@
module.sessionStore = new sessionStore({
client: rdb.client,
- ttl: ttl
+ ttl: ttl,
});
} else if (nconf.get('mongo')) {
sessionStore = require('connect-mongo')(session);
module.sessionStore = new sessionStore({
db: db,
- ttl: ttl
+ ttl: ttl,
});
}
@@ -162,7 +162,7 @@
async.series([
async.apply(createIndex, 'objects', { _key: 1, score: -1 }, { background: true }),
async.apply(createIndex, 'objects', { _key: 1, value: -1 }, { background: true, unique: true, sparse: true }),
- async.apply(createIndex, 'objects', { expireAt: 1 }, { expireAfterSeconds: 0, background: true })
+ async.apply(createIndex, 'objects', { expireAt: 1 }, { expireAfterSeconds: 0, background: true }),
], function (err) {
if (err) {
winston.error('Error creating index ' + err.message);
@@ -203,7 +203,7 @@
db.collection(collection.name).stats(next);
}, next);
});
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -219,7 +219,7 @@
avgObjSize: collectionInfo.avgObjSize,
storageSize: collectionInfo.storageSize,
totalIndexSize: collectionInfo.totalIndexSize,
- indexSizes: collectionInfo.indexSizes
+ indexSizes: collectionInfo.indexSizes,
};
});
diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js
index 4951b44529..e48b3959f8 100644
--- a/src/database/mongo/hash.js
+++ b/src/database/mongo/hash.js
@@ -58,7 +58,7 @@ module.exports = function (db, module) {
}
field = helpers.fieldToString(field);
var _fields = {
- _id: 0
+ _id: 0,
};
_fields[field] = 1;
db.collection('objects').findOne({_key: key}, {fields: _fields}, function (err, item) {
@@ -75,7 +75,7 @@ module.exports = function (db, module) {
return callback();
}
var _fields = {
- _id: 0
+ _id: 0,
};
for(var i = 0; i < fields.length; ++i) {
@@ -101,7 +101,7 @@ module.exports = function (db, module) {
}
var _fields = {
_id: 0,
- _key: 1
+ _key: 1,
};
for(var i = 0; i < fields.length; ++i) {
diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.js
index 0a035a3398..1c3c53739c 100644
--- a/src/database/mongo/sets.js
+++ b/src/database/mongo/sets.js
@@ -14,16 +14,16 @@ module.exports = function (db, module) {
});
db.collection('objects').update({
- _key: key
+ _key: key,
}, {
$addToSet: {
members: {
- $each: value
- }
- }
+ $each: value,
+ },
+ },
}, {
upsert: true,
- w: 1
+ w: 1,
}, function (err, res) {
callback(err);
});
@@ -49,8 +49,8 @@ module.exports = function (db, module) {
for(var i = 0; i < keys.length; ++i) {
bulk.find({_key: keys[i]}).upsert().updateOne({ $addToSet: {
members: {
- $each: value
- }
+ $each: value,
+ },
}});
}
@@ -85,7 +85,7 @@ module.exports = function (db, module) {
for(var i = 0; i < keys.length; ++i) {
bulk.find({_key: keys[i]}).updateOne({$pull: {
- members: value
+ members: value,
}});
}
diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js
index b9d511d94d..214d796ddd 100644
--- a/src/database/mongo/sorted.js
+++ b/src/database/mongo/sorted.js
@@ -159,7 +159,7 @@ module.exports = function (db, module) {
var pipeline = [
{ $match : { _key : { $in: keys } } } ,
{ $group: { _id: {_key: '$_key'}, count: { $sum: 1 } } },
- { $project: { _id: 1, count: '$count' } }
+ { $project: { _id: 1, count: '$count' } },
];
db.collection('objects').aggregate(pipeline, function (err, results) {
if (err) {
@@ -500,7 +500,7 @@ module.exports = function (db, module) {
});
});
},
- callback
+ callback,
);
};
diff --git a/src/database/mongo/sorted/intersect.js b/src/database/mongo/sorted/intersect.js
index ed8ade3fb3..2aa51ef8e8 100644
--- a/src/database/mongo/sorted/intersect.js
+++ b/src/database/mongo/sorted/intersect.js
@@ -11,7 +11,7 @@ module.exports = function (db, module) {
{ $match: { _key: {$in: keys}} },
{ $group: { _id: {value: '$value'}, count: {$sum: 1}} },
{ $match: { count: keys.length} },
- { $group: { _id: null, count: { $sum: 1 } } }
+ { $group: { _id: null, count: { $sum: 1 } } },
];
db.collection('objects').aggregate(pipeline, function (err, data) {
@@ -56,9 +56,9 @@ module.exports = function (db, module) {
$project: {
value: 1,
score: {
- $cond: { if: { $eq: [ "$_key", sets[index] ] }, then: { $multiply: [ '$score', weight ] }, else: '$score' }
- }
- }
+ $cond: { if: { $eq: [ "$_key", sets[index] ] }, then: { $multiply: [ '$score', weight ] }, else: '$score' },
+ },
+ },
});
}
});
diff --git a/src/database/mongo/sorted/union.js b/src/database/mongo/sorted/union.js
index 49669bd830..74eb452fe0 100644
--- a/src/database/mongo/sorted/union.js
+++ b/src/database/mongo/sorted/union.js
@@ -10,7 +10,7 @@ module.exports = function (db, module) {
var pipeline = [
{ $match: { _key: {$in: keys} } },
{ $group: { _id: {value: '$value' } } },
- { $group: { _id: null, count: { $sum: 1 } } }
+ { $group: { _id: null, count: { $sum: 1 } } },
];
var project = { _id: 0, count: '$count' };
@@ -50,7 +50,7 @@ module.exports = function (db, module) {
var pipeline = [
{ $match: { _key: {$in: params.sets}} },
{ $group: { _id: {value: '$value'}, totalScore: aggregate} },
- { $sort: { totalScore: params.sort} }
+ { $sort: { totalScore: params.sort} },
];
if (params.start) {
diff --git a/src/database/redis.js b/src/database/redis.js
index 8519b57bae..e34d626473 100644
--- a/src/database/redis.js
+++ b/src/database/redis.js
@@ -14,25 +14,25 @@
{
name: 'redis:host',
description: 'Host IP or address of your Redis instance',
- 'default': nconf.get('redis:host') || '127.0.0.1'
+ 'default': nconf.get('redis:host') || '127.0.0.1',
},
{
name: 'redis:port',
description: 'Host port of your Redis instance',
- 'default': nconf.get('redis:port') || 6379
+ 'default': nconf.get('redis:port') || 6379,
},
{
name: 'redis:password',
description: 'Password of your Redis database',
hidden: true,
default: nconf.get('redis:password') || '',
- before: function (value) { value = value || nconf.get('redis:password') || ''; return value; }
+ before: function (value) { value = value || nconf.get('redis:password') || ''; return value; },
},
{
name: "redis:database",
description: "Which database to use (0..n)",
- 'default': nconf.get('redis:database') || 0
- }
+ 'default': nconf.get('redis:database') || 0,
+ },
];
module.init = function (callback) {
@@ -68,7 +68,7 @@
module.sessionStore = new sessionStore({
client: module.client,
- ttl: ttl
+ ttl: ttl,
});
if (typeof callback === 'function') {
diff --git a/src/emailer.js b/src/emailer.js
index 4ccd35ed99..e9e529c58f 100644
--- a/src/emailer.js
+++ b/src/emailer.js
@@ -17,7 +17,7 @@ var translator = require('../public/src/modules/translator');
var transports = {
sendmail: nodemailer.createTransport(sendmailTransport()),
- gmail: undefined
+ gmail: undefined,
};
var app;
@@ -35,8 +35,8 @@ var fallbackTransport;
secure: true,
auth: {
user: meta.config['email:GmailTransport:user'],
- pass: meta.config['email:GmailTransport:pass']
- }
+ pass: meta.config['email:GmailTransport:pass'],
+ },
}));
} else {
fallbackTransport = transports.sendmail;
@@ -56,7 +56,7 @@ var fallbackTransport;
function (next) {
async.parallel({
email: async.apply(User.getUserField, uid, 'email'),
- settings: async.apply(User.getSettings, uid)
+ settings: async.apply(User.getSettings, uid),
}, next);
},
function (results, next) {
@@ -66,7 +66,7 @@ var fallbackTransport;
}
params.uid = uid;
Emailer.sendToEmail(template, results.email, results.settings.userLang, params, next);
- }
+ },
], callback);
};
@@ -85,7 +85,7 @@ var fallbackTransport;
translator.translate(params.subject, lang, function (translated) {
next(null, translated);
});
- }
+ },
}, next);
},
function (results, next) {
@@ -97,12 +97,12 @@ var fallbackTransport;
subject: results.subject,
html: results.html,
plaintext: htmlToText.fromString(results.html, {
- ignoreImage: true
+ ignoreImage: true,
}),
template: template,
uid: params.uid,
pid: params.pid,
- fromUid: params.fromUid
+ fromUid: params.fromUid,
};
Plugins.fireHook('filter:email.modify', data, next);
},
@@ -112,7 +112,7 @@ var fallbackTransport;
} else {
Emailer.sendViaFallback(data, next);
}
- }
+ },
], function (err) {
if (err && err.code === 'ENOENT') {
callback(new Error('[[error:sendmail-not-found]]'));
diff --git a/src/events.js b/src/events.js
index 3f061566b9..832daf7170 100644
--- a/src/events.js
+++ b/src/events.js
@@ -27,9 +27,9 @@ var utils = require('../public/src/utils');
},
function (next) {
db.setObject('event:' + eid, data, next);
- }
+ },
], next);
- }
+ },
], function (err, result) {
callback(err);
});
@@ -66,7 +66,7 @@ var utils = require('../public/src/utils');
event.timestampISO = new Date(parseInt(event.timestamp, 10)).toUTCString();
});
next(null, eventsData);
- }
+ },
], callback);
};
@@ -87,7 +87,7 @@ var utils = require('../public/src/utils');
},
userData: function (next) {
user.getUsersFields(uids, ['username', 'userslug', 'picture'], next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -121,7 +121,7 @@ var utils = require('../public/src/utils');
},
function (next) {
db.sortedSetRemove('events:time', eids, next);
- }
+ },
], callback);
};
diff --git a/src/file.js b/src/file.js
index 5e13c5b2a9..b9ecee378e 100644
--- a/src/file.js
+++ b/src/file.js
@@ -34,7 +34,7 @@ file.saveFileToLocal = function (filename, folder, tempPath, callback) {
is.on('end', function () {
callback(null, {
url: '/assets/uploads/' + folder + '/' + filename,
- path: uploadPath
+ path: uploadPath,
});
});
@@ -48,7 +48,7 @@ file.base64ToLocal = function (imageData, uploadPath, callback) {
uploadPath = path.join(nconf.get('upload_path'), uploadPath);
fs.writeFile(uploadPath, buffer, {
- encoding: 'base64'
+ encoding: 'base64',
}, function (err) {
callback(err, uploadPath);
});
diff --git a/src/groups.js b/src/groups.js
index 51c1d97dc8..5f8102a807 100644
--- a/src/groups.js
+++ b/src/groups.js
@@ -30,7 +30,7 @@ var utils = require('../public/src/utils');
description: '',
deleted: '0',
hidden: '0',
- system: '1'
+ system: '1',
};
},
removeEphemeralGroups: function (groups) {
@@ -42,7 +42,7 @@ var utils = require('../public/src/utils');
}
return groups;
- }
+ },
};
Groups.internals = internals;
@@ -73,7 +73,7 @@ var utils = require('../public/src/utils');
}
Groups.getGroupsAndMembers(groupNames, next);
- }
+ },
], callback);
};
@@ -88,7 +88,7 @@ var utils = require('../public/src/utils');
},
members: function (next) {
Groups.getMemberUsers(groupNames, 0, 3, next);
- }
+ },
}, function (err, data) {
if (err) {
return callback(err);
@@ -132,7 +132,7 @@ var utils = require('../public/src/utils');
},
function (uids, next) {
user.getUsersData(uids, next);
- }
+ },
], next);
},
invited: function (next) {
@@ -142,13 +142,13 @@ var utils = require('../public/src/utils');
},
function (uids, next) {
user.getUsersData(uids, next);
- }
+ },
], next);
},
isMember: async.apply(Groups.isMember, options.uid, groupName),
isPending: async.apply(Groups.isPending, options.uid, groupName),
isInvited: async.apply(Groups.isInvited, options.uid, groupName),
- isOwner: async.apply(Groups.ownership.isOwner, options.uid, groupName)
+ isOwner: async.apply(Groups.ownership.isOwner, options.uid, groupName),
}, function (err, results) {
if (err) {
return callback(err);
@@ -206,12 +206,12 @@ var utils = require('../public/src/utils');
},
function (uids, next) {
user.getUsers(uids, uid, next);
- }
+ },
], next);
},
members: function (next) {
user.getUsersFromSet('group:' + groupName + ':members', uid, start, stop, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -312,7 +312,7 @@ var utils = require('../public/src/utils');
return ephemeralGroups.indexOf(slug) !== -1;
}));
},
- async.apply(db.isSortedSetMembers, 'groups:createtime', name)
+ async.apply(db.isSortedSetMembers, 'groups:createtime', name),
], function (err, results) {
if (err) {
return callback(err);
@@ -327,7 +327,7 @@ var utils = require('../public/src/utils');
function (next) {
next(null, ephemeralGroups.indexOf(slug) !== -1);
},
- async.apply(db.isSortedSetMember, 'groups:createtime', name)
+ async.apply(db.isSortedSetMember, 'groups:createtime', name),
], function (err, results) {
callback(err, !err ? (results[0] || results[1]) : null);
});
@@ -361,7 +361,7 @@ var utils = require('../public/src/utils');
},
function (pids, next) {
posts.getPostSummaryByPids(pids, uid, {stripTags: false}, next);
- }
+ },
], callback);
};
@@ -452,7 +452,7 @@ var utils = require('../public/src/utils');
Groups.getGroupsData(memberOf, next);
});
}, next);
- }
+ },
], callback);
};
diff --git a/src/groups/cover.js b/src/groups/cover.js
index 3512a235d5..7356ee2347 100644
--- a/src/groups/cover.js
+++ b/src/groups/cover.js
@@ -44,7 +44,7 @@ module.exports = function (Groups) {
uploadsController.uploadGroupCover(uid, {
name: 'groupCover',
path: tempPath,
- type: type
+ type: type,
}, next);
},
function (uploadData, next) {
@@ -58,7 +58,7 @@ module.exports = function (Groups) {
uploadsController.uploadGroupCover(uid, {
name: 'groupCoverThumb',
path: tempPath,
- type: type
+ type: type,
}, next);
},
function (uploadData, next) {
@@ -70,7 +70,7 @@ module.exports = function (Groups) {
} else {
next(null);
}
- }
+ },
], function (err) {
fs.unlink(tempPath, function (unlinkErr) {
if (unlinkErr) {
@@ -91,7 +91,7 @@ module.exports = function (Groups) {
},
function (image, next) {
image.write(path, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -109,7 +109,7 @@ module.exports = function (Groups) {
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
fs.writeFile(tempPath, buffer, {
- encoding: 'base64'
+ encoding: 'base64',
}, function (err) {
callback(err, tempPath);
});
diff --git a/src/groups/create.js b/src/groups/create.js
index a59567afe6..3fba2851a4 100644
--- a/src/groups/create.js
+++ b/src/groups/create.js
@@ -42,14 +42,14 @@ module.exports = function (Groups) {
hidden: parseInt(data.hidden, 10) === 1 ? 1 : 0,
system: system ? 1 : 0,
private: isPrivate,
- disableJoinRequests: disableJoinRequests
+ disableJoinRequests: disableJoinRequests,
};
plugins.fireHook('filter:group.create', {group: groupData, data: data}, next);
},
function (results, next) {
var tasks = [
async.apply(db.sortedSetAdd, 'groups:createtime', groupData.createtime, groupData.name),
- async.apply(db.setObject, 'group:' + groupData.name, groupData)
+ async.apply(db.setObject, 'group:' + groupData.name, groupData),
];
if (data.hasOwnProperty('ownerUid')) {
@@ -72,7 +72,7 @@ module.exports = function (Groups) {
function (results, next) {
plugins.fireHook('action:group.create', groupData);
next(null, groupData);
- }
+ },
], callback);
};
diff --git a/src/groups/delete.js b/src/groups/delete.js
index 0838dd2407..431dd510c2 100644
--- a/src/groups/delete.js
+++ b/src/groups/delete.js
@@ -39,7 +39,7 @@ module.exports = function (Groups) {
db.sortedSetRemove('group:' + group + ':members', groupName, next);
}, next);
});
- }
+ },
], function (err) {
if (err) {
return callback(err);
diff --git a/src/groups/membership.js b/src/groups/membership.js
index e57847a61c..6eec4b24a2 100644
--- a/src/groups/membership.js
+++ b/src/groups/membership.js
@@ -15,7 +15,7 @@ var LRU = require('lru-cache');
var cache = LRU({
max: 40000,
- maxAge: 1000 * 60 * 60
+ maxAge: 1000 * 60 * 60,
});
module.exports = function (Groups) {
@@ -46,7 +46,7 @@ module.exports = function (Groups) {
Groups.create({
name: groupName,
description: '',
- hidden: 1
+ hidden: 1,
}, function (err) {
if (err && err.message !== '[[error:group-already-exists]]') {
winston.error('[groups.join] Could not create new hidden group: ' + err.message);
@@ -62,13 +62,13 @@ module.exports = function (Groups) {
},
isHidden: function (next) {
Groups.isHidden(groupName, next);
- }
+ },
}, next);
},
function (results, next) {
var tasks = [
async.apply(db.sortedSetAdd, 'group:' + groupName + ':members', Date.now(), uid),
- async.apply(db.incrObjectField, 'group:' + groupName, 'memberCount')
+ async.apply(db.incrObjectField, 'group:' + groupName, 'memberCount'),
];
if (results.isAdmin) {
tasks.push(async.apply(db.setAdd, 'group:' + groupName + ':owners', uid));
@@ -85,10 +85,10 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook('action:group.join', {
groupName: groupName,
- uid: uid
+ uid: uid,
});
next();
- }
+ },
], callback);
};
@@ -120,12 +120,12 @@ module.exports = function (Groups) {
bodyLong: '[[groups:request.notification_text, ' + username + ', ' + groupName + ']]',
nid: 'group:' + groupName + ':uid:' + uid + ':request',
path: '/groups/' + utils.slugify(groupName),
- from: uid
+ from: uid,
}, next);
},
owners: function (next) {
Groups.getOwners(groupName, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -133,7 +133,7 @@ module.exports = function (Groups) {
return next();
}
notifications.push(results.notification, results.owners, next);
- }
+ },
], callback);
};
@@ -142,7 +142,7 @@ module.exports = function (Groups) {
async.waterfall([
async.apply(db.setRemove, 'group:' + groupName + ':pending', uid),
async.apply(db.setRemove, 'group:' + groupName + ':invited', uid),
- async.apply(Groups.join, groupName, uid)
+ async.apply(Groups.join, groupName, uid),
], callback);
};
@@ -150,7 +150,7 @@ module.exports = function (Groups) {
// Note: For simplicity, this method intentially doesn't check the caller uid for ownership!
async.parallel([
async.apply(db.setRemove, 'group:' + groupName + ':pending', uid),
- async.apply(db.setRemove, 'group:' + groupName + ':invited', uid)
+ async.apply(db.setRemove, 'group:' + groupName + ':invited', uid),
], callback);
};
@@ -161,11 +161,11 @@ module.exports = function (Groups) {
bodyShort: '[[groups:invited.notification_title, ' + groupName + ']]',
bodyLong: '',
nid: 'group:' + groupName + ':uid:' + uid + ':invite',
- path: '/groups/' + utils.slugify(groupName)
+ path: '/groups/' + utils.slugify(groupName),
}),
function (notification, next) {
notifications.push(notification, [uid], next);
- }
+ },
], callback);
};
@@ -182,7 +182,7 @@ module.exports = function (Groups) {
exists: async.apply(Groups.exists, groupName),
isMember: async.apply(Groups.isMember, uid, groupName),
isPending: async.apply(Groups.isPending, uid, groupName),
- isInvited: async.apply(Groups.isInvited, uid, groupName)
+ isInvited: async.apply(Groups.isInvited, uid, groupName),
}, next);
},
function (checks, next) {
@@ -201,10 +201,10 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook(hookName, {
groupName: groupName,
- uid: uid
+ uid: uid,
});
next();
- }
+ },
], callback);
}
@@ -229,7 +229,7 @@ module.exports = function (Groups) {
async.parallel([
async.apply(db.sortedSetRemove, 'group:' + groupName + ':members', uid),
async.apply(db.setRemove, 'group:' + groupName + ':owners', uid),
- async.apply(db.decrObjectField, 'group:' + groupName, 'memberCount')
+ async.apply(db.decrObjectField, 'group:' + groupName, 'memberCount'),
], next);
},
function (results, next) {
@@ -253,10 +253,10 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook('action:group.leave', {
groupName: groupName,
- uid: uid
+ uid: uid,
});
next();
- }
+ },
], callback);
};
@@ -279,10 +279,10 @@ module.exports = function (Groups) {
},
function (next) {
Groups.rejectMembership(groupName, uid, next);
- }
+ },
], next);
}, next);
- }
+ },
], callback);
};
@@ -343,7 +343,7 @@ module.exports = function (Groups) {
function (isMember, next) {
cache.set(cacheKey, isMember);
next(null, isMember);
- }
+ },
], callback);
};
@@ -376,7 +376,7 @@ module.exports = function (Groups) {
});
getFromCache(next);
- }
+ },
], callback);
};
@@ -413,7 +413,7 @@ module.exports = function (Groups) {
});
getFromCache(next);
- }
+ },
], callback);
};
@@ -551,7 +551,7 @@ module.exports = function (Groups) {
return next(new Error('[[error:group-needs-owner]]'));
}
Groups.leave(groupName, uid, next);
- }
+ },
], callback);
} else {
Groups.leave(groupName, uid, callback);
diff --git a/src/groups/ownership.js b/src/groups/ownership.js
index f397abe5e7..7edaf19659 100644
--- a/src/groups/ownership.js
+++ b/src/groups/ownership.js
@@ -32,7 +32,7 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook('action:group.grantOwnership', {uid: toUid, groupName: groupName});
next();
- }
+ },
], callback);
};
@@ -53,7 +53,7 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook('action:group.rescindOwnership', {uid: toUid, groupName: groupName});
next();
- }
+ },
], callback);
};
};
diff --git a/src/groups/search.js b/src/groups/search.js
index 3b6bfab9cd..c13c14262c 100644
--- a/src/groups/search.js
+++ b/src/groups/search.js
@@ -33,7 +33,7 @@ module.exports = function (Groups) {
}
Groups.sort(options.sort, groupsData, next);
- }
+ },
], callback);
};
@@ -84,7 +84,7 @@ module.exports = function (Groups) {
}
}
next(null, uids);
- }
+ },
], callback);
}
@@ -129,7 +129,7 @@ module.exports = function (Groups) {
}
});
next(null, results);
- }
+ },
], callback);
};
};
diff --git a/src/groups/update.js b/src/groups/update.js
index 4dfe760a96..49d722692b 100644
--- a/src/groups/update.js
+++ b/src/groups/update.js
@@ -23,7 +23,7 @@ module.exports = function (Groups) {
}
plugins.fireHook('filter:group.update', {
groupName: groupName,
- values: values
+ values: values,
}, next);
},
function (result, next) {
@@ -32,7 +32,7 @@ module.exports = function (Groups) {
var payload = {
description: values.description || '',
icon: values.icon || '',
- labelColor: values.labelColor || '#000000'
+ labelColor: values.labelColor || '#000000',
};
if (values.hasOwnProperty('userTitle')) {
@@ -71,16 +71,16 @@ module.exports = function (Groups) {
}
},
async.apply(db.setObject, 'group:' + groupName, payload),
- async.apply(renameGroup, groupName, values.name)
+ async.apply(renameGroup, groupName, values.name),
], next);
},
function (result, next) {
plugins.fireHook('action:group.update', {
name: groupName,
- values: values
+ values: values,
});
next();
- }
+ },
], callback);
};
@@ -118,7 +118,7 @@ module.exports = function (Groups) {
callback = callback || function () {};
async.parallel([
async.apply(db.setObjectField, 'group:' + groupName, 'hidden', hidden ? 1 : 0),
- async.apply(updateVisibility, groupName, hidden)
+ async.apply(updateVisibility, groupName, hidden),
], function (err) {
callback(err);
});
@@ -146,9 +146,9 @@ module.exports = function (Groups) {
winston.verbose('[groups.update] Group is now public, automatically adding ' + uids.length + ' new members, who were pending prior.');
async.series([
async.apply(db.sortedSetAdd, 'group:' + groupName + ':members', scores, uids),
- async.apply(db.delete, 'group:' + groupName + ':pending')
+ async.apply(db.delete, 'group:' + groupName + ':pending'),
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -218,11 +218,11 @@ module.exports = function (Groups) {
function (next) {
plugins.fireHook('action:group.rename', {
old: oldName,
- new: newName
+ new: newName,
});
next();
- }
+ },
], callback);
});
});
@@ -244,7 +244,7 @@ module.exports = function (Groups) {
},
function (next) {
db.sortedSetAdd(group, score, newName, next);
- }
+ },
], callback);
});
}
diff --git a/src/image.js b/src/image.js
index 0ab68e5a23..4ecb49387a 100644
--- a/src/image.js
+++ b/src/image.js
@@ -14,7 +14,7 @@ image.resizeImage = function (data, callback) {
target: data.target,
extension: data.extension,
width: data.width,
- height: data.height
+ height: data.height,
}, function (err) {
callback(err);
});
@@ -69,7 +69,7 @@ image.resizeImage = function (data, callback) {
return next();
}
image.write(data.target || data.path, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -81,7 +81,7 @@ image.normalise = function (path, extension, callback) {
if (plugins.hasListeners('filter:image.normalise')) {
plugins.fireHook('filter:image.normalise', {
path: path,
- extension: extension
+ extension: extension,
}, function (err) {
callback(err);
});
diff --git a/src/install.js b/src/install.js
index 8c14302d80..8e9b32fee7 100644
--- a/src/install.js
+++ b/src/install.js
@@ -25,20 +25,20 @@ questions.main = [
{
name: 'secret',
description: 'Please enter a NodeBB secret',
- 'default': nconf.get('secret') || utils.generateUUID()
+ 'default': nconf.get('secret') || utils.generateUUID(),
},
{
name: 'database',
description: 'Which database to use',
- 'default': nconf.get('database') || 'mongo'
- }
+ 'default': nconf.get('database') || 'mongo',
+ },
];
questions.optional = [
{
name: 'port',
- default: nconf.get('port') || 4567
- }
+ default: nconf.get('port') || 4567,
+ },
];
function checkSetupFlag(next) {
@@ -75,7 +75,7 @@ function checkSetupFlag(next) {
}
} else if (nconf.get('database')) {
install.values = {
- database: nconf.get('database')
+ database: nconf.get('database'),
};
next();
} else {
@@ -145,7 +145,7 @@ function setupConfig(next) {
},
function (config, next) {
completeConfigSetup(config, next);
- }
+ },
], next);
}
@@ -169,7 +169,7 @@ function completeConfigSetup(config, next) {
},
function (next) {
require('./database').createIndices(next);
- }
+ },
], next);
}
@@ -199,7 +199,7 @@ function enableDefaultTheme(next) {
process.stdout.write('Enabling default theme: ' + defaultTheme + '\n');
meta.themes.set({
type: 'local',
- id: defaultTheme
+ id: defaultTheme,
}, next);
});
}
@@ -231,25 +231,25 @@ function createAdmin(callback) {
name: 'username',
description: 'Administrator username',
required: true,
- type: 'string'
+ type: 'string',
}, {
name: 'email',
description: 'Administrator email address',
pattern: /.+@.+/,
- required: true
+ required: true,
}],
passwordQuestions = [{
name: 'password',
description: 'Password',
required: true,
hidden: true,
- type: 'string'
+ type: 'string',
}, {
name: 'password:confirm',
description: 'Confirm Password',
required: true,
hidden: true,
- type: 'string'
+ type: 'string',
}],
success = function (err, results) {
if (err) {
@@ -283,7 +283,7 @@ function createAdmin(callback) {
},
function (next) {
Groups.ownership.grant(adminUid, 'administrators', next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -323,7 +323,7 @@ function createAdmin(callback) {
username: install.values['admin:username'] || nconf.get('admin:username') || 'admin',
email: install.values['admin:email'] || nconf.get('admin:email') || '',
password: install.values['admin:password'] || nconf.get('admin:password') || password,
- 'password:confirm': install.values['admin:password:confirm'] || nconf.get('admin:password') || password
+ 'password:confirm': install.values['admin:password:confirm'] || nconf.get('admin:password') || password,
};
success(null, results);
@@ -347,12 +347,12 @@ function createGlobalModeratorsGroup(next) {
description: 'Forum wide moderators',
hidden: 0,
private: 1,
- disableJoinRequests: 1
+ disableJoinRequests: 1,
}, next);
},
function (groupData, next) {
groups.show('Global Moderators', next);
- }
+ },
], next);
}
@@ -406,7 +406,7 @@ function createWelcomePost(next) {
},
function (next) {
db.getObjectField('global', 'topicCount', next);
- }
+ },
], function (err, results) {
if (err) {
return next(err);
@@ -421,7 +421,7 @@ function createWelcomePost(next) {
uid: 1,
cid: 2,
title: 'Welcome to your NodeBB!',
- content: content.toString()
+ content: content.toString(),
}, next);
} else {
next();
@@ -441,7 +441,7 @@ function enableDefaultPlugins(next) {
'nodebb-rewards-essentials',
'nodebb-plugin-soundpack-default',
'nodebb-plugin-emoji-extended',
- 'nodebb-plugin-emoji-one'
+ 'nodebb-plugin-emoji-one',
],
customDefaults = nconf.get('defaultPlugins');
@@ -478,7 +478,7 @@ function setCopyrightWidget(next) {
},
footer: function (next) {
db.getObjectField('widgets:global', 'footer', next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -516,7 +516,7 @@ install.setup = function (callback) {
if (!uptodate) { upgrade.upgrade(next); }
else { next(); }
});
- }
+ },
], function (err, results) {
if (err) {
winston.warn('NodeBB Setup Aborted.\n ' + err.stack);
@@ -549,7 +549,7 @@ install.save = function (server_conf, callback) {
process.stdout.write('Configuration Saved OK\n');
nconf.file({
- file: path.join(__dirname, '..', 'config.json')
+ file: path.join(__dirname, '..', 'config.json'),
});
callback();
diff --git a/src/logger.js b/src/logger.js
index 4d6b8f717c..f098ef7289 100644
--- a/src/logger.js
+++ b/src/logger.js
@@ -24,7 +24,7 @@ var opts = {
},
streams : {
log : { f : process.stdout },
- }
+ },
};
diff --git a/src/messaging.js b/src/messaging.js
index a37503e3e3..dd4e288f04 100644
--- a/src/messaging.js
+++ b/src/messaging.js
@@ -57,7 +57,7 @@ Messaging.getMessages = function (params, callback) {
messageData.index = indices[messageData.messageId.toString()];
});
next(null, messageData);
- }
+ },
], callback);
};
@@ -65,7 +65,7 @@ function canGet(hook, callerUid, uid, callback) {
plugins.fireHook(hook, {
callerUid: callerUid,
uid: uid,
- canGet: parseInt(callerUid, 10) === parseInt(uid, 10)
+ canGet: parseInt(callerUid, 10) === parseInt(uid, 10),
}, function (err, data) {
callback(err, data ? data.canGet : false);
});
@@ -84,7 +84,7 @@ Messaging.parse = function (message, fromuid, uid, roomId, isNew, callback) {
uid: uid,
roomId: roomId,
isNew: isNew,
- parsedMessage: parsed
+ parsedMessage: parsed,
};
plugins.fireHook('filter:messaging.parse', messageData, function (err, messageData) {
@@ -106,7 +106,7 @@ Messaging.isNewSet = function (uid, roomId, timestamp, callback) {
} else {
next(null, true);
}
- }
+ },
], callback);
};
@@ -147,7 +147,7 @@ Messaging.getRecentChats = function (callerUid, uid, start, stop, callback) {
async.map(roomIds, function (roomId, next) {
Messaging.getTeaser(uid, roomId, next);
}, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -171,7 +171,7 @@ Messaging.getRecentChats = function (callerUid, uid, start, stop, callback) {
});
next(null, {rooms: results.roomData, nextStart: stop + 1});
- }
+ },
], callback);
};
@@ -213,7 +213,7 @@ Messaging.getTeaser = function (uid, roomId, callback) {
plugins.fireHook('filter:messaging.getTeaser', { teaser: teaser }, function (err, data) {
next(err, data.teaser);
});
- }
+ },
], callback);
};
@@ -248,7 +248,7 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
async.parallel({
settings: async.apply(user.getSettings, toUid),
isAdmin: async.apply(user.isAdministrator, uid),
- isFollowing: async.apply(user.isFollowing, toUid, uid)
+ isFollowing: async.apply(user.isFollowing, toUid, uid),
}, next);
},
function (results, next) {
@@ -257,7 +257,7 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
}
next(new Error('[[error:chat-restricted]]'));
- }
+ },
], callback);
};
@@ -294,7 +294,7 @@ Messaging.canMessageRoom = function (uid, roomId, callback) {
}
next();
- }
+ },
], callback);
};
@@ -306,7 +306,7 @@ Messaging.hasPrivateChat = function (uid, withUid, callback) {
function (next) {
async.parallel({
myRooms: async.apply(db.getSortedSetRevRange, 'uid:' + uid + ':chat:rooms', 0, -1),
- theirRooms: async.apply(db.getSortedSetRevRange, 'uid:' + withUid + ':chat:rooms', 0, -1)
+ theirRooms: async.apply(db.getSortedSetRevRange, 'uid:' + withUid + ':chat:rooms', 0, -1),
}, next);
},
function (results, next) {
@@ -338,6 +338,6 @@ Messaging.hasPrivateChat = function (uid, withUid, callback) {
}, function (err) {
next(err, roomId);
});
- }
+ },
], callback);
};
diff --git a/src/messaging/create.js b/src/messaging/create.js
index face15f589..45876f5502 100644
--- a/src/messaging/create.js
+++ b/src/messaging/create.js
@@ -23,7 +23,7 @@ module.exports = function (Messaging) {
}
Messaging.addMessage(uid, roomId, content, timestamp, next);
- }
+ },
], callback);
};
@@ -56,7 +56,7 @@ module.exports = function (Messaging) {
content: content,
timestamp: timestamp,
fromuid: fromuid,
- roomId: roomId
+ roomId: roomId,
};
plugins.fireHook('filter:messaging.save', message, next);
@@ -76,13 +76,13 @@ module.exports = function (Messaging) {
async.apply(Messaging.addRoomToUsers, roomId, uids, timestamp),
async.apply(Messaging.addMessageToUsers, roomId, uids, mid, timestamp),
async.apply(Messaging.markUnread, uids, roomId),
- async.apply(Messaging.addUsersToRoom, fromuid, [fromuid], roomId)
+ async.apply(Messaging.addUsersToRoom, fromuid, [fromuid], roomId),
], next);
},
function (results, next) {
async.parallel({
markRead: async.apply(Messaging.markRead, fromuid, roomId),
- messages: async.apply(Messaging.getMessagesData, [mid], fromuid, roomId, true)
+ messages: async.apply(Messaging.getMessagesData, [mid], fromuid, roomId, true),
}, next);
},
function (results, next) {
@@ -94,7 +94,7 @@ module.exports = function (Messaging) {
results.messages[0].mid = mid;
results.messages[0].roomId = roomId;
next(null, results.messages[0]);
- }
+ },
], callback);
};
diff --git a/src/messaging/data.js b/src/messaging/data.js
index d1a00bd8f4..ce7b0a7e38 100644
--- a/src/messaging/data.js
+++ b/src/messaging/data.js
@@ -110,7 +110,7 @@ module.exports = function (Messaging) {
},
function (mid, next) {
Messaging.getMessageFields(mid, ['fromuid', 'timestamp'], next);
- }
+ },
], function (err, fields) {
if (err) {
return next(err);
@@ -129,7 +129,7 @@ module.exports = function (Messaging) {
} else {
next(null, []);
}
- }
+ },
], callback);
};
diff --git a/src/messaging/delete.js b/src/messaging/delete.js
index e9f48232d1..3d019f5bdb 100644
--- a/src/messaging/delete.js
+++ b/src/messaging/delete.js
@@ -21,7 +21,7 @@ module.exports = function (Messaging) {
},
function (next) {
db.delete('message:' + mid, next);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/messaging/edit.js b/src/messaging/edit.js
index b472aea261..5cbc95c513 100644
--- a/src/messaging/edit.js
+++ b/src/messaging/edit.js
@@ -23,7 +23,7 @@ module.exports = function (Messaging) {
Messaging.setMessageFields(mid, {
content: content,
- edited: Date.now()
+ edited: Date.now(),
}, next);
},
function (next) {
@@ -36,11 +36,11 @@ module.exports = function (Messaging) {
function (messages, next) {
uids.forEach(function (uid) {
sockets.in('uid_' + uid).emit('event:chats.edit', {
- messages: messages
+ messages: messages,
});
});
next();
- }
+ },
], callback);
};
@@ -75,7 +75,7 @@ module.exports = function (Messaging) {
},
function (isAdmin, next) {
next(null, isAdmin);
- }
+ },
], callback);
};
diff --git a/src/messaging/notifications.js b/src/messaging/notifications.js
index 6d9500c4ba..920df36aea 100644
--- a/src/messaging/notifications.js
+++ b/src/messaging/notifications.js
@@ -23,7 +23,7 @@ module.exports = function (Messaging) {
var data = {
roomId: roomId,
fromUid: fromUid,
- message: messageObj
+ message: messageObj,
};
uids.forEach(function (uid) {
data.self = parseInt(uid, 10) === parseInt(fromUid) ? 1 : 0;
@@ -38,7 +38,7 @@ module.exports = function (Messaging) {
clearTimeout(queueObj.timeout);
} else {
queueObj = Messaging.notifyQueue[fromUid + ':' + roomId] = {
- message: messageObj
+ message: messageObj,
};
}
@@ -71,7 +71,7 @@ module.exports = function (Messaging) {
bodyLong: messageObj.content,
nid: 'chat_' + fromuid + '_' + roomId,
from: fromuid,
- path: '/chats/' + messageObj.roomId
+ path: '/chats/' + messageObj.roomId,
}, function (err, notification) {
if (!err && notification) {
notifications.push(notification, uids, callback);
@@ -93,7 +93,7 @@ module.exports = function (Messaging) {
},
userSettings: function (next) {
user.getMultipleUserSettings(uids, next);
- }
+ },
}, function (err, results) {
if (err) {
return winston.error(err);
@@ -112,7 +112,7 @@ module.exports = function (Messaging) {
url: nconf.get('url'),
roomId: messageObj.roomId,
username: userData.username,
- userslug: userData.userslug
+ userslug: userData.userslug,
}, next);
}, function (err) {
if (err) {
diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js
index bea909946a..0410726af6 100644
--- a/src/messaging/rooms.js
+++ b/src/messaging/rooms.js
@@ -55,7 +55,7 @@ module.exports = function (Messaging) {
roomId = _roomId;
var room = {
owner: uid,
- roomId: roomId
+ roomId: roomId,
};
db.setObject('chat:room:' + roomId, room, next);
},
@@ -70,7 +70,7 @@ module.exports = function (Messaging) {
},
function (next) {
next(null, roomId);
- }
+ },
], callback);
};
@@ -84,7 +84,7 @@ module.exports = function (Messaging) {
},
function (data, next) {
next(null, data.inRoom);
- }
+ },
], callback);
};
@@ -124,7 +124,7 @@ module.exports = function (Messaging) {
function (next) {
async.parallel({
userCount: async.apply(db.sortedSetCard, 'chat:room:' + roomId + ':uids'),
- roomData: async.apply(db.getObject, 'chat:room:' + roomId)
+ roomData: async.apply(db.getObject, 'chat:room:' + roomId),
}, next);
},
function (results, next) {
@@ -132,7 +132,7 @@ module.exports = function (Messaging) {
return db.setObjectField('chat:room:' + roomId, 'groupChat', 1, next);
}
next();
- }
+ },
], callback);
};
@@ -141,7 +141,7 @@ module.exports = function (Messaging) {
function (next) {
async.parallel({
isOwner: async.apply(Messaging.isRoomOwner, uid, roomId),
- userCount: async.apply(Messaging.getUserCountInRoom, roomId)
+ userCount: async.apply(Messaging.getUserCountInRoom, roomId),
}, next);
},
function (results, next) {
@@ -152,7 +152,7 @@ module.exports = function (Messaging) {
return next(new Error('[[error:cant-remove-last-user]]'));
}
Messaging.leaveRoom(uids, roomId, next);
- }
+ },
], callback);
};
@@ -169,7 +169,7 @@ module.exports = function (Messaging) {
return 'uid:' + uid + ':chat:rooms:unread';
}));
db.sortedSetsRemove(keys, roomId, next);
- }
+ },
], callback);
};
@@ -184,7 +184,7 @@ module.exports = function (Messaging) {
},
function (uids, next) {
user.getUsersFields(uids, ['uid', 'username', 'picture', 'status'], next);
- }
+ },
], callback);
};
@@ -205,7 +205,7 @@ module.exports = function (Messaging) {
return next(new Error('[[error:no-privileges]]'));
}
db.setObjectField('chat:room:' + roomId, 'roomName', newName, next);
- }
+ },
], callback);
};
@@ -219,7 +219,7 @@ module.exports = function (Messaging) {
},
function (data, next) {
next(null, data.canReply);
- }
+ },
], callback);
};
diff --git a/src/messaging/unread.js b/src/messaging/unread.js
index 91c9a364ac..ffea6b52fd 100644
--- a/src/messaging/unread.js
+++ b/src/messaging/unread.js
@@ -48,7 +48,7 @@ module.exports = function (Messaging) {
});
db.sortedSetsAdd(keys, Date.now(), roomId, next);
- }
+ },
], callback);
};
diff --git a/src/meta.js b/src/meta.js
index 2333e54d89..2db2f09ea0 100644
--- a/src/meta.js
+++ b/src/meta.js
@@ -32,7 +32,7 @@ var utils = require('../public/src/utils');
slug = utils.slugify(slug);
async.parallel([
async.apply(user.existsBySlug, slug),
- async.apply(groups.existsBySlug, slug)
+ async.apply(groups.existsBySlug, slug),
], function (err, results) {
callback(err, results ? results.some(function (result) { return result; }) : false);
});
@@ -62,7 +62,7 @@ var utils = require('../public/src/utils');
function restart() {
if (process.send) {
process.send({
- action: 'restart'
+ action: 'restart',
});
} else {
winston.error('[meta.restart] Could not restart, are you sure NodeBB was started with `./nodebb start`?');
diff --git a/src/meta/blacklist.js b/src/meta/blacklist.js
index 679dc3cec9..97f6b5b974 100644
--- a/src/meta/blacklist.js
+++ b/src/meta/blacklist.js
@@ -6,13 +6,13 @@ var async = require('async');
var db = require('../database');
var Blacklist = {
- _rules: []
+ _rules: [],
};
Blacklist.load = function (callback) {
async.waterfall([
async.apply(db.get, 'ip-blacklist-rules'),
- async.apply(Blacklist.validate)
+ async.apply(Blacklist.validate),
], function (err, rules) {
if (err) {
return callback(err);
@@ -26,7 +26,7 @@ Blacklist.load = function (callback) {
Blacklist._rules = {
ipv4: rules.ipv4,
ipv6: rules.ipv6,
- cidr: rules.cidr
+ cidr: rules.cidr,
};
callback();
@@ -119,7 +119,7 @@ Blacklist.validate = function (rules, callback) {
ipv6: ipv6,
cidr: cidr,
valid: rules,
- invalid: invalid
+ invalid: invalid,
});
};
diff --git a/src/meta/build.js b/src/meta/build.js
index 3f2feb8a2a..56aa624ffb 100644
--- a/src/meta/build.js
+++ b/src/meta/build.js
@@ -31,7 +31,7 @@ exports.build = function build(targets, callback) {
async.series([
async.apply(db.init),
async.apply(meta.themes.setupPaths),
- async.apply(plugins.prepareForBuild)
+ async.apply(plugins.prepareForBuild),
], function (err) {
if (err) {
winston.error('[build] Encountered error preparing for build: ' + err.message);
@@ -74,7 +74,7 @@ exports.buildTargets = function (targets, callback) {
meta.js.linkModules,
meta.js.linkStatics,
async.apply(meta.js.minify, 'nodebb.min.js'),
- async.apply(meta.js.minify, 'acp.min.js')
+ async.apply(meta.js.minify, 'acp.min.js'),
], step.bind(this, startTime, 'js', next));
} else {
setImmediate(next);
@@ -117,7 +117,7 @@ exports.buildTargets = function (targets, callback) {
break;
}
}, next);
- }
+ },
], function (err) {
if (err) {
winston.error('[build] Encountered error during build step: ' + err.message);
diff --git a/src/meta/configs.js b/src/meta/configs.js
index 907e0ef477..d21b36c6dc 100644
--- a/src/meta/configs.js
+++ b/src/meta/configs.js
@@ -31,7 +31,7 @@ module.exports = function (Meta) {
Meta.config = config;
next();
});
- }
+ },
], callback);
};
@@ -75,7 +75,7 @@ module.exports = function (Meta) {
function (next) {
updateConfig(data);
setImmediate(next);
- }
+ },
], callback);
};
@@ -91,13 +91,13 @@ module.exports = function (Meta) {
async.waterfall([
function (next) {
less.render(data.customCSS, {
- compress: true
+ compress: true,
}, next);
},
function (lessObject, next) {
data.renderedCustomCSS = lessObject.css;
setImmediate(next);
- }
+ },
], callback);
}
@@ -133,7 +133,7 @@ module.exports = function (Meta) {
} else {
setImmediate(next);
}
- }
+ },
], callback);
};
diff --git a/src/meta/css.js b/src/meta/css.js
index 53388da57b..fd3c526e48 100644
--- a/src/meta/css.js
+++ b/src/meta/css.js
@@ -60,7 +60,7 @@ module.exports = function (Meta) {
var paths = [
baseThemePath,
path.join(__dirname, '../../node_modules'),
- path.join(__dirname, '../../public/vendor/fontawesome/less')
+ path.join(__dirname, '../../public/vendor/fontawesome/less'),
];
var source = '';
@@ -78,7 +78,7 @@ module.exports = function (Meta) {
function (src, next) {
source += src;
next();
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -136,7 +136,7 @@ module.exports = function (Meta) {
function minify(source, paths, target, callback) {
callback = callback || function () {};
less.render(source, {
- paths: paths
+ paths: paths,
}, function (err, lessOutput) {
if (err) {
winston.error('[meta/css] Could not minify LESS/CSS: ' + err.message);
@@ -146,7 +146,7 @@ module.exports = function (Meta) {
postcss(global.env === 'development' ? [ autoprefixer ] : [
autoprefixer,
clean({
- processImportFrom: ['local']
+ processImportFrom: ['local'],
}),
]).process(lessOutput.css).then(function (result) {
result.warnings().forEach(function (warn) {
diff --git a/src/meta/dependencies.js b/src/meta/dependencies.js
index 3f892c37ab..9c68cc7727 100644
--- a/src/meta/dependencies.js
+++ b/src/meta/dependencies.js
@@ -21,7 +21,7 @@ module.exports = function (Meta) {
async.every(modules, function (module, next) {
fs.readFile(path.join(__dirname, '../../node_modules/', module, 'package.json'), {
- encoding: 'utf-8'
+ encoding: 'utf-8',
}, function (err, pkgData) {
// If a bundled plugin/theme is not present, skip the dep check (#3384)
if (err && err.code === 'ENOENT' && (module === 'nodebb-rewards-essentials' || module.startsWith('nodebb-plugin') || module.startsWith('nodebb-theme'))) {
diff --git a/src/meta/js.js b/src/meta/js.js
index b6b6e61ee6..a9adbead9e 100644
--- a/src/meta/js.js
+++ b/src/meta/js.js
@@ -40,7 +40,7 @@ module.exports = function (Meta) {
'public/src/ajaxify.js',
'public/src/overrides.js',
'public/src/widgets.js',
- "./node_modules/promise-polyfill/promise.js"
+ "./node_modules/promise-polyfill/promise.js",
],
// files listed below are only available client-side, or are bundled in to reduce # of network requests on cold load
@@ -76,7 +76,7 @@ module.exports = function (Meta) {
'public/src/modules/taskbar.js',
'public/src/modules/helpers.js',
'public/src/modules/sounds.js',
- 'public/src/modules/string.js'
+ 'public/src/modules/string.js',
],
// modules listed below are routed through express (/src/modules) so they can be defined anonymously
@@ -85,9 +85,9 @@ module.exports = function (Meta) {
"mousetrap.js": './node_modules/mousetrap/mousetrap.min.js',
"jqueryui.js": 'public/vendor/jquery/js/jquery-ui.js',
"buzz.js": 'public/vendor/buzz/buzz.js',
- "cropper.js": './node_modules/cropperjs/dist/cropper.min.js'
- }
- }
+ "cropper.js": './node_modules/cropperjs/dist/cropper.min.js',
+ },
+ },
};
Meta.js.linkModules = function (callback) {
@@ -145,7 +145,7 @@ module.exports = function (Meta) {
minifier.send({
action: 'js',
minify: global.env !== 'development',
- scripts: Meta.js.target[target].scripts
+ scripts: Meta.js.target[target].scripts,
});
});
diff --git a/src/meta/logs.js b/src/meta/logs.js
index 32f6d7a141..e8be88d48d 100644
--- a/src/meta/logs.js
+++ b/src/meta/logs.js
@@ -7,12 +7,12 @@ var winston = require('winston');
module.exports = function (Meta) {
Meta.logs = {
- path: path.join(nconf.get('base_dir'), 'logs', 'output.log')
+ path: path.join(nconf.get('base_dir'), 'logs', 'output.log'),
};
Meta.logs.get = function (callback) {
fs.readFile(Meta.logs.path, {
- encoding: 'utf-8'
+ encoding: 'utf-8',
}, function (err, logs) {
if (err) {
winston.error('[meta/logs] Could not retrieve logs: ' + err.message);
diff --git a/src/meta/settings.js b/src/meta/settings.js
index 785d22961f..53a00c80f3 100644
--- a/src/meta/settings.js
+++ b/src/meta/settings.js
@@ -27,12 +27,12 @@ module.exports = function (Meta) {
function (next) {
plugins.fireHook('action:settings.set', {
plugin: hash,
- settings: values
+ settings: values,
});
Meta.reloadRequired = true;
next();
- }
+ },
], callback);
};
@@ -59,7 +59,7 @@ module.exports = function (Meta) {
} else {
next();
}
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/meta/sounds.js b/src/meta/sounds.js
index d237a51273..895787e81b 100644
--- a/src/meta/sounds.js
+++ b/src/meta/sounds.js
@@ -41,7 +41,7 @@ module.exports = function (Meta) {
}
next(null, sounds.concat(uploaded));
});
- }
+ },
], function (err, files) {
if (err) {
winston.error('Could not get local sound files:' + err.message);
@@ -73,7 +73,7 @@ module.exports = function (Meta) {
},
userSettings: function (next) {
user.getSettings(uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -130,7 +130,7 @@ module.exports = function (Meta) {
},
function (next) {
mkdirp(soundsPath, next);
- }
+ },
], function (err) {
if (err) {
winston.error('Could not initialise sound files:' + err.message);
@@ -153,7 +153,7 @@ module.exports = function (Meta) {
});
});
});
- }
+ },
], callback);
}
};
\ No newline at end of file
diff --git a/src/meta/tags.js b/src/meta/tags.js
index 0cd680a70a..27a4e1e7ec 100644
--- a/src/meta/tags.js
+++ b/src/meta/tags.js
@@ -14,30 +14,30 @@ module.exports = function (Meta) {
tags: function (next) {
var defaultTags = [{
name: 'viewport',
- content: 'width=device-width, initial-scale=1.0'
+ content: 'width=device-width, initial-scale=1.0',
}, {
name: 'content-type',
content: 'text/html; charset=UTF-8',
- noEscape: true
+ noEscape: true,
}, {
name: 'apple-mobile-web-app-capable',
- content: 'yes'
+ content: 'yes',
}, {
name: 'mobile-web-app-capable',
- content: 'yes'
+ content: 'yes',
}, {
property: 'og:site_name',
- content: Meta.config.title || 'NodeBB'
+ content: Meta.config.title || 'NodeBB',
}, {
name: 'msapplication-badge',
content: 'frequency=30; polling-uri=' + nconf.get('url') + '/sitemap.xml',
- noEscape: true
+ noEscape: true,
}];
if (Meta.config.keywords) {
defaultTags.push({
name: 'keywords',
- content: Meta.config.keywords
+ content: Meta.config.keywords,
});
}
@@ -45,7 +45,7 @@ module.exports = function (Meta) {
defaultTags.push({
name: 'msapplication-square150x150logo',
content: Meta.config['brand:logo'],
- noEscape: true
+ noEscape: true,
});
}
@@ -55,45 +55,45 @@ module.exports = function (Meta) {
var defaultLinks = [{
rel: "icon",
type: "image/x-icon",
- href: nconf.get('relative_path') + '/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : '')
+ href: nconf.get('relative_path') + '/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : ''),
}, {
rel: "manifest",
- href: nconf.get('relative_path') + '/manifest.json'
+ href: nconf.get('relative_path') + '/manifest.json',
}];
// Touch icons for mobile-devices
if (Meta.config['brand:touchIcon']) {
defaultLinks.push({
rel: 'apple-touch-icon',
- href: nconf.get('relative_path') + '/apple-touch-icon'
+ href: nconf.get('relative_path') + '/apple-touch-icon',
}, {
rel: 'icon',
sizes: '36x36',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-36.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-36.png',
}, {
rel: 'icon',
sizes: '48x48',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-48.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-48.png',
}, {
rel: 'icon',
sizes: '72x72',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-72.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-72.png',
}, {
rel: 'icon',
sizes: '96x96',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-96.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-96.png',
}, {
rel: 'icon',
sizes: '144x144',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-144.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-144.png',
}, {
rel: 'icon',
sizes: '192x192',
- href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-192.png'
+ href: nconf.get('relative_path') + '/assets/uploads/system/touchicon-192.png',
});
}
plugins.fireHook('filter:meta.getLinkTags', defaultLinks, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -118,7 +118,7 @@ module.exports = function (Meta) {
callback(null, {
meta: meta,
- link: link
+ link: link,
});
});
};
@@ -134,7 +134,7 @@ module.exports = function (Meta) {
if (!hasDescription) {
meta.push({
name: 'description',
- content: validator.escape(String(Meta.config.description || ''))
+ content: validator.escape(String(Meta.config.description || '')),
});
}
}
diff --git a/src/meta/templates.js b/src/meta/templates.js
index fd5c1f71e1..f15efd0fa9 100644
--- a/src/meta/templates.js
+++ b/src/meta/templates.js
@@ -51,7 +51,7 @@ function preparePaths(baseTemplatesPaths, callback) {
},
function (next) {
plugins.getTemplates(next);
- }
+ },
], function (err, pluginTemplates) {
if (err) {
return callback(err);
@@ -69,14 +69,14 @@ function preparePaths(baseTemplatesPaths, callback) {
paths = paths.map(function (tpl) {
return {
base: baseTemplatePath,
- path: tpl.replace(baseTemplatePath, '')
+ path: tpl.replace(baseTemplatePath, ''),
};
});
next(err, paths);
});
}, next);
- }
+ },
}, function (err, data) {
var baseThemes = data.baseThemes,
coreTpls = data.coreTpls,
diff --git a/src/meta/themes.js b/src/meta/themes.js
index e19dcdbf4c..0a21dc32b1 100644
--- a/src/meta/themes.js
+++ b/src/meta/themes.js
@@ -75,7 +75,7 @@ module.exports = function (Meta) {
'theme:id': data.id,
'theme:staticDir': '',
'theme:templates': '',
- 'theme:src': ''
+ 'theme:src': '',
};
switch(data.type) {
@@ -85,7 +85,7 @@ module.exports = function (Meta) {
function (current, next) {
async.series([
async.apply(db.sortedSetRemove, 'plugins:active', current),
- async.apply(db.sortedSetAdd, 'plugins:active', 0, data.id)
+ async.apply(db.sortedSetAdd, 'plugins:active', 0, data.id),
], function (err) {
next(err);
});
@@ -109,7 +109,7 @@ module.exports = function (Meta) {
// Re-set the themes path (for when NodeBB is reloaded)
Meta.themes.setPath(config);
- }
+ },
], callback);
Meta.reloadRequired = true;
@@ -126,7 +126,7 @@ module.exports = function (Meta) {
themesData: Meta.themes.get,
currentThemeId: function (next) {
db.getObjectField('config', 'theme:id', next);
- }
+ },
}, function (err, data) {
if (err) {
return callback(err);
diff --git a/src/middleware/admin.js b/src/middleware/admin.js
index 9d4b43bf25..0665ff4415 100644
--- a/src/middleware/admin.js
+++ b/src/middleware/admin.js
@@ -8,7 +8,7 @@ var plugins = require('../plugins');
var controllers = {
api: require('../controllers/api'),
- helpers: require('../controllers/helpers')
+ helpers: require('../controllers/helpers'),
};
module.exports = function (middleware) {
@@ -45,7 +45,7 @@ module.exports = function (middleware) {
middleware.admin.renderHeader = function (req, res, data, next) {
var custom_header = {
'plugins': [],
- 'authentication': []
+ 'authentication': [],
};
user.getUserFields(req.uid, ['username', 'userslug', 'email', 'picture', 'email:confirmed'], function (err, userData) {
@@ -78,7 +78,7 @@ module.exports = function (middleware) {
},
configs: function (next) {
meta.configs.list(next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -104,7 +104,7 @@ module.exports = function (middleware) {
'cache-buster': meta.config['cache-buster'] || '',
env: process.env.NODE_ENV ? true : false,
title: (acpPath || 'Dashboard') + ' | NodeBB Admin Control Panel',
- bodyClass: data.bodyClass
+ bodyClass: data.bodyClass,
};
templateValues.template = {name: res.locals.template};
diff --git a/src/middleware/header.js b/src/middleware/header.js
index 5e78416a0a..167b784672 100644
--- a/src/middleware/header.js
+++ b/src/middleware/header.js
@@ -11,7 +11,7 @@ var navigation = require('../navigation');
var controllers = {
api: require('../controllers/api'),
- helpers: require('../controllers/helpers')
+ helpers: require('../controllers/helpers'),
};
module.exports = function (middleware) {
@@ -30,13 +30,13 @@ module.exports = function (middleware) {
},
plugins: function (next) {
plugins.fireHook('filter:middleware.buildHeader', {req: req, locals: res.locals}, next);
- }
+ },
}, next);
},
function (results, next) {
res.locals.config = results.config;
next();
- }
+ },
], next);
};
@@ -55,7 +55,7 @@ module.exports = function (middleware) {
searchEnabled: plugins.hasListeners('filter:search.query'),
config: res.locals.config,
relative_path: nconf.get('relative_path'),
- bodyClass: data.bodyClass
+ bodyClass: data.bodyClass,
};
templateValues.configJSON = JSON.stringify(res.locals.config);
@@ -82,7 +82,7 @@ module.exports = function (middleware) {
picture: meta.config.defaultAvatar,
status: 'offline',
reputation: 0,
- 'email:confirmed': false
+ 'email:confirmed': false,
};
if (req.uid) {
user.getUserFields(req.uid, Object.keys(userData), next);
@@ -99,7 +99,7 @@ module.exports = function (middleware) {
navigation: async.apply(navigation.get),
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
banned: async.apply(user.isBanned, req.uid),
- banReason: async.apply(user.getBannedReason, req.uid)
+ banReason: async.apply(user.getBannedReason, req.uid),
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/middleware/headers.js b/src/middleware/headers.js
index 66f0603b0d..5e3a436013 100644
--- a/src/middleware/headers.js
+++ b/src/middleware/headers.js
@@ -10,7 +10,7 @@ module.exports = function (middleware) {
'X-Frame-Options': meta.config['allow-from-uri'] ? 'ALLOW-FROM ' + encodeURI(meta.config['allow-from-uri']) : 'SAMEORIGIN',
'Access-Control-Allow-Origin': encodeURI(meta.config['access-control-allow-origin'] || 'null'),
'Access-Control-Allow-Methods': encodeURI(meta.config['access-control-allow-methods'] || ''),
- 'Access-Control-Allow-Headers': encodeURI(meta.config['access-control-allow-headers'] || '')
+ 'Access-Control-Allow-Headers': encodeURI(meta.config['access-control-allow-headers'] || ''),
};
for (var key in headers) {
diff --git a/src/middleware/index.js b/src/middleware/index.js
index 105142d15e..7f01ea06a2 100644
--- a/src/middleware/index.js
+++ b/src/middleware/index.js
@@ -19,7 +19,7 @@ var analytics = require('../analytics');
var controllers = {
api: require('./../controllers/api'),
- helpers: require('../controllers/helpers')
+ helpers: require('../controllers/helpers'),
};
var middleware = {};
@@ -42,7 +42,7 @@ middleware.authenticate = function (req, res, next) {
return plugins.fireHook('action:middleware.authenticate', {
req: req,
res: res,
- next: next
+ next: next,
});
}
@@ -77,7 +77,7 @@ middleware.pageView = function (req, res, next) {
analytics.pageView({
ip: req.ip,
path: req.path,
- uid: req.uid
+ uid: req.uid,
});
plugins.fireHook('action:middleware.pageView', {req: req});
@@ -123,7 +123,7 @@ middleware.routeTouchIcon = function (req, res) {
return res.redirect(meta.config['brand:touchIcon']);
} else {
return res.sendFile(path.join(__dirname, '../../public', meta.config['brand:touchIcon'] || '/logo.png'), {
- maxAge: req.app.enabled('cache') ? 5184000000 : 0
+ maxAge: req.app.enabled('cache') ? 5184000000 : 0,
});
}
};
@@ -196,11 +196,11 @@ middleware.processTimeagoLocales = function (req, res, next) {
if (exists) {
res.status(200).sendFile(localPath, {
- maxAge: req.app.enabled('cache') ? 5184000000 : 0
+ maxAge: req.app.enabled('cache') ? 5184000000 : 0,
});
} else {
res.status(200).sendFile(path.join(__dirname, '../../public/vendor/jquery/timeago/locales', fallback), {
- maxAge: req.app.enabled('cache') ? 5184000000 : 0
+ maxAge: req.app.enabled('cache') ? 5184000000 : 0,
});
}
};
diff --git a/src/middleware/maintenance.js b/src/middleware/maintenance.js
index 3193e820fa..655e92b4cf 100644
--- a/src/middleware/maintenance.js
+++ b/src/middleware/maintenance.js
@@ -24,7 +24,7 @@ module.exports = function (middleware) {
res.status(503);
var data = {
site_title: meta.config.title || 'NodeBB',
- message: meta.config.maintenanceModeMessage
+ message: meta.config.maintenanceModeMessage,
};
if (res.locals.isAPI) {
diff --git a/src/middleware/render.js b/src/middleware/render.js
index ecd0ce8a5d..8d2c96a4ee 100644
--- a/src/middleware/render.js
+++ b/src/middleware/render.js
@@ -72,7 +72,7 @@ module.exports = function (middleware) {
},
footer: function (next) {
renderHeaderFooter('renderFooter', req, res, options, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -89,7 +89,7 @@ module.exports = function (middleware) {
return '';
});
next(null, translated);
- }
+ },
], fn);
};
diff --git a/src/middleware/user.js b/src/middleware/user.js
index c2c3bd9dd6..cdfbe1e548 100644
--- a/src/middleware/user.js
+++ b/src/middleware/user.js
@@ -8,7 +8,7 @@ var user = require('../user');
var privileges = require('../privileges');
var controllers = {
- helpers: require('../controllers/helpers')
+ helpers: require('../controllers/helpers'),
};
module.exports = function (middleware) {
@@ -44,7 +44,7 @@ module.exports = function (middleware) {
} else {
next(null, false);
}
- }
+ },
], function (err, allowed) {
if (err || allowed) {
return next(err);
diff --git a/src/navigation/admin.js b/src/navigation/admin.js
index 39258e6702..1261b2c822 100644
--- a/src/navigation/admin.js
+++ b/src/navigation/admin.js
@@ -38,14 +38,14 @@ admin.save = function (data, callback) {
},
function (next) {
db.sortedSetAdd('navigation:enabled', order, items, next);
- }
+ },
], callback);
};
admin.getAdmin = function (callback) {
async.parallel({
enabled: admin.get,
- available: getAvailable
+ available: getAvailable,
}, callback);
};
diff --git a/src/notifications.js b/src/notifications.js
index b99700be01..9faf5a3bfa 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -143,7 +143,7 @@ var utils = require('../public/src/utils');
},
function (next) {
db.setObject('notifications:' + data.nid, data, next);
- }
+ },
], function (err) {
callback(err, data);
});
@@ -221,7 +221,7 @@ var utils = require('../public/src/utils');
plugins.fireHook('action:notification.pushed', {notification: notification, uids: uids});
next();
- }
+ },
], callback);
}
@@ -254,7 +254,7 @@ var utils = require('../public/src/utils');
async.parallel([
async.apply(db.sortedSetRemove, 'notifications', nid),
- async.apply(db.delete, 'notifications:' + nid)
+ async.apply(db.delete, 'notifications:' + nid),
], function (err) {
if (err) {
winston.error('Encountered error rescinding notification (' + nid + '): ' + err.message);
@@ -288,7 +288,7 @@ var utils = require('../public/src/utils');
async.parallel([
async.apply(db.sortedSetRemove, 'uid:' + uid + ':notifications:read', nid),
- async.apply(db.sortedSetAdd, 'uid:' + uid + ':notifications:unread', notification.datetime, nid)
+ async.apply(db.sortedSetAdd, 'uid:' + uid + ':notifications:unread', notification.datetime, nid),
], callback);
});
};
@@ -325,7 +325,7 @@ var utils = require('../public/src/utils');
});
db.getObjectsFields(notificationKeys, ['nid', 'datetime'], next);
- }
+ },
], function (err, notificationData) {
if (err) {
return callback(err);
@@ -351,7 +351,7 @@ var utils = require('../public/src/utils');
},
function (next) {
db.sortedSetAdd('uid:' + uid + ':notifications:read', datetimes, nids, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -399,7 +399,7 @@ var utils = require('../public/src/utils');
},
function (next) {
db.deleteAll(keys, next);
- }
+ },
], function (err) {
if (err) {
return winston.error('Encountered error pruning notifications: ' + err.message);
@@ -415,7 +415,7 @@ var utils = require('../public/src/utils');
'notifications:user_started_following_you',
'notifications:user_posted_to',
'notifications:user_flagged_post_in',
- 'new_register'
+ 'new_register',
],
isolated, differentiators, differentiator, modifyIndex, set;
@@ -501,7 +501,7 @@ var utils = require('../public/src/utils');
}, notifications);
plugins.fireHook('filter:notifications.merge', {
- notifications: notifications
+ notifications: notifications,
}, function (err, data) {
callback(err, data.notifications);
});
diff --git a/src/pagination.js b/src/pagination.js
index ba7dbc8436..d6006c0c9d 100644
--- a/src/pagination.js
+++ b/src/pagination.js
@@ -12,7 +12,7 @@ pagination.create = function (currentPage, pageCount, queryObj) {
rel: [],
pages: [],
currentPage: 1,
- pageCount: 1
+ pageCount: 1,
};
}
pageCount = parseInt(pageCount, 10);
@@ -62,14 +62,14 @@ pagination.create = function (currentPage, pageCount, queryObj) {
if (currentPage < pageCount) {
data.rel.push({
rel: 'next',
- href: '?page=' + next
+ href: '?page=' + next,
});
}
if (currentPage > 1) {
data.rel.push({
rel: 'prev',
- href: '?page=' + previous
+ href: '?page=' + previous,
});
}
return data;
diff --git a/src/plugins.js b/src/plugins.js
index 789c92b72c..84a9e148f7 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -121,7 +121,7 @@ var middleware;
});
next();
- }
+ },
], callback);
};
@@ -165,7 +165,7 @@ var middleware;
},
function (paths, next) {
async.map(paths, Plugins.loadPluginInfo, next);
- }
+ },
], function (err, plugins) {
if (err) {
return callback(err);
@@ -213,7 +213,7 @@ var middleware;
var url = (nconf.get('registry') || 'https://packages.nodebb.org') + '/api/v1/plugins/' + id;
require('request')(url, {
- json: true
+ json: true,
}, function (err, res, body) {
if (res.statusCode === 404 || !body.payload) {
return callback(err, {});
@@ -237,7 +237,7 @@ var middleware;
var url = (nconf.get('registry') || 'https://packages.nodebb.org') + '/api/v1/plugins' + (matching !== false ? '?version=' + version : '');
require('request')(url, {
- json: true
+ json: true,
}, function (err, res, body) {
if (err) {
winston.error('Error parsing plugins : ' + err.message);
@@ -372,7 +372,7 @@ var middleware;
pluginData.error = false;
next(null, pluginData);
});
- }
+ },
], function (err, pluginData) {
if (err) {
return next(); // Silently fail
@@ -384,7 +384,7 @@ var middleware;
}, function (err) {
next(err, plugins);
});
- }
+ },
], callback);
};
diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js
index b8e5af0e46..be0fb4cf8f 100644
--- a/src/plugins/hooks.js
+++ b/src/plugins/hooks.js
@@ -7,7 +7,7 @@ module.exports = function (Plugins) {
Plugins.deprecatedHooks = {
'filter:user.custom_fields': null, // remove in v1.1.0
'filter:post.save': 'filter:post.create',
- 'filter:user.profileLinks': 'filter:user.profileMenu'
+ 'filter:user.profileLinks': 'filter:user.profileMenu',
};
/*
`data` is an object consisting of (* is required):
@@ -36,7 +36,7 @@ module.exports = function (Plugins) {
(Plugins.deprecatedHooks[data.hook] ?
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
'there is no alternative.'
- )
+ ),
);
} else {
// handle hook's startsWith, i.e. action:homepage.get
diff --git a/src/plugins/install.js b/src/plugins/install.js
index 840d46008a..9fc771dec2 100644
--- a/src/plugins/install.js
+++ b/src/plugins/install.js
@@ -52,7 +52,7 @@ module.exports = function (Plugins) {
meta.reloadRequired = true;
Plugins.fireHook(isActive ? 'action:plugin.deactivate' : 'action:plugin.activate', id);
next();
- }
+ },
], function (err) {
if (err) {
winston.warn('[plugins] Could not toggle active state on plugin \'' + id + '\'');
@@ -97,7 +97,7 @@ module.exports = function (Plugins) {
function (pluginData, next) {
Plugins.fireHook('action:plugin.' + type, id);
next(null, pluginData);
- }
+ },
], callback);
}
@@ -126,7 +126,7 @@ module.exports = function (Plugins) {
function (isActive, next) {
meta.reloadRequired = isActive;
next(null, isActive);
- }
+ },
], callback);
}
diff --git a/src/plugins/load.js b/src/plugins/load.js
index 01dedc4e45..4147260d9a 100644
--- a/src/plugins/load.js
+++ b/src/plugins/load.js
@@ -59,7 +59,7 @@ module.exports = function (Plugins) {
async.apply(mapStaticDirectories, pluginData, pluginData.path),
], next);
}, next);
- }
+ },
], callback);
};
@@ -283,7 +283,7 @@ module.exports = function (Plugins) {
},
plugin: function (next) {
fs.readFile(path.join(pluginPath, 'plugin.json'), next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/posts.js b/src/posts.js
index 3a7d2d7e19..539be5f8a6 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -74,7 +74,7 @@ var plugins = require('./plugins');
}
data.posts = data.posts.filter(Boolean);
next(null, data.posts);
- }
+ },
], callback);
};
@@ -91,7 +91,7 @@ var plugins = require('./plugins');
},
function (posts, next) {
next(null, {posts: posts, nextStart: stop + 1});
- }
+ },
], callback);
};
@@ -154,7 +154,7 @@ var plugins = require('./plugins');
return callback(err);
}
var data = {
- pid: pid
+ pid: pid,
};
data[field] = value;
plugins.fireHook('action:post.setFields', data);
@@ -217,7 +217,7 @@ var plugins = require('./plugins');
}
next(null, indices);
- }
+ },
], callback);
};
@@ -247,12 +247,12 @@ var plugins = require('./plugins');
return next();
}
db.sortedSetAdd('tid:' + postData.tid + ':posts:votes', postData.votes, postData.pid, next);
- }
+ },
], next);
},
function (next) {
Posts.setPostFields(postData.pid, {upvotes: postData.upvotes, downvotes: postData.downvotes}, next);
- }
+ },
], function (err) {
callback(err);
});
diff --git a/src/posts/bookmarks.js b/src/posts/bookmarks.js
index b60da91c77..27ead2ddb3 100644
--- a/src/posts/bookmarks.js
+++ b/src/posts/bookmarks.js
@@ -30,7 +30,7 @@ module.exports = function (Posts) {
},
hasBookmarked: function (next) {
Posts.hasBookmarked(pid, uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -61,7 +61,7 @@ module.exports = function (Posts) {
function (count, next) {
results.postData.bookmarks = count;
Posts.setPostField(pid, 'bookmarks', count, next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -73,12 +73,12 @@ module.exports = function (Posts) {
pid: pid,
uid: uid,
owner: results.owner,
- current: current
+ current: current,
});
callback(null, {
post: results.postData,
- isBookmarked: isBookmarking
+ isBookmarked: isBookmarking,
});
});
});
diff --git a/src/posts/cache.js b/src/posts/cache.js
index 62277c46e3..a9050c8a73 100644
--- a/src/posts/cache.js
+++ b/src/posts/cache.js
@@ -4,7 +4,7 @@ var meta = require('../meta');
var cache = LRU({
max: parseInt(meta.config.postCacheSize, 10) || 1048576,
length: function (n) { return n.length; },
- maxAge: 1000 * 60 * 60
+ maxAge: 1000 * 60 * 60,
});
module.exports = cache;
\ No newline at end of file
diff --git a/src/posts/category.js b/src/posts/category.js
index 9c877d91dd..dbbe71dadb 100644
--- a/src/posts/category.js
+++ b/src/posts/category.js
@@ -16,7 +16,7 @@ module.exports = function (Posts) {
},
function (tid, next) {
topics.getTopicField(tid, 'cid', next);
- }
+ },
], callback);
};
@@ -49,7 +49,7 @@ module.exports = function (Posts) {
return map[post.tid];
});
next(null, cids);
- }
+ },
], callback);
};
diff --git a/src/posts/create.js b/src/posts/create.js
index 3484bc424e..429289ea78 100644
--- a/src/posts/create.js
+++ b/src/posts/create.js
@@ -43,7 +43,7 @@ module.exports = function (Posts) {
'tid': tid,
'content': content,
'timestamp': timestamp,
- 'deleted': 0
+ 'deleted': 0,
};
if (data.toPid) {
@@ -93,12 +93,12 @@ module.exports = function (Posts) {
}
async.parallel([
async.apply(db.sortedSetAdd, 'pid:' + postData.toPid + ':replies', timestamp, postData.pid),
- async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies')
+ async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies'),
], next);
},
function (next) {
db.incrObjectField('global', 'postCount', next);
- }
+ },
], function (err) {
if (err) {
return next(err);
@@ -110,7 +110,7 @@ module.exports = function (Posts) {
postData.isMain = isMain;
plugins.fireHook('action:post.save', _.clone(postData));
next(null, postData);
- }
+ },
], callback);
};
};
diff --git a/src/posts/delete.js b/src/posts/delete.js
index 7a1d3d0cc8..b4dd13cc99 100644
--- a/src/posts/delete.js
+++ b/src/posts/delete.js
@@ -37,13 +37,13 @@ module.exports = function (Posts) {
},
function (next) {
topics.updateTeaser(postData.tid, next);
- }
+ },
], next);
},
function (results, next) {
plugins.fireHook('action:post.delete', pid);
next(null, postData);
- }
+ },
], callback);
};
@@ -74,13 +74,13 @@ module.exports = function (Posts) {
},
function (next) {
topics.updateTeaser(postData.tid, next);
- }
+ },
], next);
},
function (results, next) {
plugins.fireHook('action:post.restore', _.clone(postData));
next(null, postData);
- }
+ },
], callback);
};
@@ -109,7 +109,7 @@ module.exports = function (Posts) {
} else {
next();
}
- }
+ },
], callback);
}
@@ -146,7 +146,7 @@ module.exports = function (Posts) {
},
function (next) {
Posts.dismissFlag(pid, next);
- }
+ },
], function (err) {
if (err) {
return next(err);
@@ -154,7 +154,7 @@ module.exports = function (Posts) {
plugins.fireHook('action:post.purge', pid);
db.delete('post:' + pid, next);
});
- }
+ },
], callback);
};
@@ -169,7 +169,7 @@ module.exports = function (Posts) {
db.sortedSetsRemove([
'tid:' + postData.tid + ':posts',
'tid:' + postData.tid + ':posts:votes',
- 'uid:' + postData.uid + ':posts'
+ 'uid:' + postData.uid + ':posts',
], pid, next);
},
function (next) {
@@ -203,9 +203,9 @@ module.exports = function (Posts) {
},
function (next) {
notifications.rescind('new_post:tid:' + postData.tid + ':pid:' + pid + ':uid:' + postData.uid, next);
- }
+ },
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -252,7 +252,7 @@ module.exports = function (Posts) {
},
downvoters: function (next) {
db.getSetMembers('pid:' + pid + ':downvote', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -275,7 +275,7 @@ module.exports = function (Posts) {
},
function (next) {
db.deleteAll(['pid:' + pid + ':upvote', 'pid:' + pid + ':downvote'], next);
- }
+ },
], callback);
});
}
@@ -290,7 +290,7 @@ module.exports = function (Posts) {
}
async.parallel([
async.apply(db.sortedSetRemove, 'pid:' + toPid + ':replies', pid),
- async.apply(db.decrObjectField, 'post:' + toPid, 'replies')
+ async.apply(db.decrObjectField, 'post:' + toPid, 'replies'),
], callback);
});
}
diff --git a/src/posts/edit.js b/src/posts/edit.js
index b989b24f8f..2e0ba7a4a3 100644
--- a/src/posts/edit.js
+++ b/src/posts/edit.js
@@ -58,7 +58,7 @@ module.exports = function (Posts) {
},
topic: function (next) {
editMainPost(data, postData, next);
- }
+ },
}, next);
},
function (_results, next) {
@@ -76,7 +76,7 @@ module.exports = function (Posts) {
function (postData, next) {
results.post = postData;
next(null, results);
- }
+ },
], callback);
};
@@ -90,7 +90,7 @@ module.exports = function (Posts) {
},
isMain: function (next) {
Posts.isMain(data.pid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -101,7 +101,7 @@ module.exports = function (Posts) {
tid: tid,
cid: results.topic.cid,
isMainPost: false,
- renamed: false
+ renamed: false,
});
}
@@ -109,7 +109,7 @@ module.exports = function (Posts) {
tid: tid,
cid: results.topic.cid,
uid: postData.uid,
- mainPid: data.pid
+ mainPid: data.pid,
};
if (title) {
@@ -147,9 +147,9 @@ module.exports = function (Posts) {
slug: topicData.slug,
isMainPost: true,
renamed: title !== results.topic.title,
- tags: tags
+ tags: tags,
});
- }
+ },
], callback);
});
}
diff --git a/src/posts/flags.js b/src/posts/flags.js
index e81da20f95..a1d40a6729 100644
--- a/src/posts/flags.js
+++ b/src/posts/flags.js
@@ -19,7 +19,7 @@ module.exports = function (Posts) {
function (next) {
async.parallel({
hasFlagged: async.apply(Posts.isFlaggedByUser, post.pid, uid),
- exists: async.apply(Posts.exists, post.pid)
+ exists: async.apply(Posts.exists, post.pid),
}, next);
},
function (results, next) {
@@ -53,17 +53,17 @@ module.exports = function (Posts) {
async.parallel([
async.apply(db.sortedSetIncrBy, 'users:flags', 1, post.uid),
async.apply(db.incrObjectField, 'user:' + post.uid, 'flags'),
- async.apply(db.sortedSetAdd, 'uid:' + post.uid + ':flag:pids', now, post.pid)
+ async.apply(db.sortedSetAdd, 'uid:' + post.uid + ':flag:pids', now, post.pid),
], next);
} else {
next();
}
- }
+ },
], next);
},
function (data, next) {
openNewFlag(post.pid, uid, next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -80,7 +80,7 @@ module.exports = function (Posts) {
}
if (count === 1) { // Only update state on new flag
Posts.updateFlagData(uid, pid, {
- state: 'open'
+ state: 'open',
}, callback);
} else {
callback();
@@ -107,7 +107,7 @@ module.exports = function (Posts) {
if (parseInt(postData.flags, 10) > 0) {
async.parallel([
async.apply(db.sortedSetIncrBy, 'users:flags', -postData.flags, postData.uid),
- async.apply(db.incrObjectFieldBy, 'user:' + postData.uid, 'flags', -postData.flags)
+ async.apply(db.incrObjectFieldBy, 'user:' + postData.uid, 'flags', -postData.flags),
], next);
} else {
next();
@@ -120,7 +120,7 @@ module.exports = function (Posts) {
db.sortedSetsRemove([
'posts:flagged',
'posts:flags:count',
- 'uid:' + postData.uid + ':flag:pids'
+ 'uid:' + postData.uid + ':flag:pids',
], pid, next);
},
function (next) {
@@ -135,22 +135,22 @@ module.exports = function (Posts) {
var nid = 'post_flag:' + pid + ':uid:' + uid;
async.parallel([
async.apply(db.delete, 'notifications:' + nid),
- async.apply(db.sortedSetRemove, 'notifications', 'post_flag:' + pid + ':uid:' + uid)
+ async.apply(db.sortedSetRemove, 'notifications', 'post_flag:' + pid + ':uid:' + uid),
], next);
}, next);
});
},
- async.apply(db.delete, 'pid:' + pid + ':flag:uids')
+ async.apply(db.delete, 'pid:' + pid + ':flag:uids'),
], next);
},
async.apply(db.deleteObjectField, 'post:' + pid, 'flags'),
async.apply(db.delete, 'pid:' + pid + ':flag:uid:reason'),
- async.apply(db.deleteObjectFields, 'post:' + pid, ['flag:state', 'flag:assignee', 'flag:notes', 'flag:history'])
+ async.apply(db.deleteObjectFields, 'post:' + pid, ['flag:state', 'flag:assignee', 'flag:notes', 'flag:history']),
], next);
},
function (results, next) {
db.sortedSetsRemoveRangeByScore(['users:flags'], '-inf', 0, next);
- }
+ },
], callback);
};
@@ -195,7 +195,7 @@ module.exports = function (Posts) {
var count = posts.length;
var end = stop - start + 1;
next(null, {posts: posts.slice(0, stop === -1 ? undefined : end), count: count});
- }
+ },
], callback);
};
@@ -210,7 +210,7 @@ module.exports = function (Posts) {
},
posts: function (next) {
Posts.getPostSummaryByPids(pids, uid, {stripTags: false, extraFields: ['flags', 'flag:assignee', 'flag:state', 'flag:notes', 'flag:history']}, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -280,7 +280,7 @@ module.exports = function (Posts) {
setImmediate(next.bind(null, null, postObj));
}
}, next);
- }
+ },
], callback);
}
@@ -331,7 +331,7 @@ module.exports = function (Posts) {
uid: uid,
type: property,
value: flagObj[property],
- timestamp: Date.now()
+ timestamp: Date.now(),
});
break;
@@ -339,7 +339,7 @@ module.exports = function (Posts) {
history.unshift({
uid: uid,
type: property,
- timestamp: Date.now()
+ timestamp: Date.now(),
});
}
});
@@ -400,7 +400,7 @@ module.exports = function (Posts) {
} else {
setImmediate(next);
}
- }
+ },
], function (err) {
next(err, event);
});
diff --git a/src/posts/recent.js b/src/posts/recent.js
index 5cc5cd1fae..1c4cfd6b15 100644
--- a/src/posts/recent.js
+++ b/src/posts/recent.js
@@ -9,7 +9,7 @@ module.exports = function (Posts) {
var terms = {
day: 86400000,
week: 604800000,
- month: 2592000000
+ month: 2592000000,
};
Posts.getRecentPosts = function (uid, start, stop, term, callback) {
@@ -29,7 +29,7 @@ module.exports = function (Posts) {
},
function (pids, next) {
Posts.getPostSummaryByPids(pids, uid, {stripTags: true}, next);
- }
+ },
], callback);
};
@@ -48,7 +48,7 @@ module.exports = function (Posts) {
return uid && array.indexOf(uid) === index;
});
next(null, uids);
- }
+ },
], callback);
};
};
diff --git a/src/posts/summary.js b/src/posts/summary.js
index 2173057e3a..8a27ec9050 100644
--- a/src/posts/summary.js
+++ b/src/posts/summary.js
@@ -50,7 +50,7 @@ module.exports = function (Posts) {
},
topicsAndCategories: function (next) {
getTopicAndCategories(topicKeys, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -85,7 +85,7 @@ module.exports = function (Posts) {
},
function (data, next) {
next(null, data.posts);
- }
+ },
], callback);
};
diff --git a/src/posts/tools.js b/src/posts/tools.js
index 82d55b1192..ab47632931 100644
--- a/src/posts/tools.js
+++ b/src/posts/tools.js
@@ -52,7 +52,7 @@ module.exports = function (Posts) {
Posts.parsePost(postData, next);
});
}
- }
+ },
], callback);
}
@@ -67,7 +67,7 @@ module.exports = function (Posts) {
}
cache.del(pid);
Posts.purge(pid, uid, next);
- }
+ },
], callback);
};
diff --git a/src/posts/topics.js b/src/posts/topics.js
index 0653c880e6..d0b9318e81 100644
--- a/src/posts/topics.js
+++ b/src/posts/topics.js
@@ -15,7 +15,7 @@ module.exports = function (Posts) {
},
function (pids, next) {
Posts.getPostsByPids(pids, uid, next);
- }
+ },
], callback);
};
@@ -29,7 +29,7 @@ module.exports = function (Posts) {
},
function (mainPid, next) {
next(null, parseInt(pid, 10) === parseInt(mainPid, 10));
- }
+ },
], callback);
};
@@ -40,7 +40,7 @@ module.exports = function (Posts) {
},
function (tid, next) {
topics.getTopicFields(tid, fields, next);
- }
+ },
], callback);
};
@@ -66,7 +66,7 @@ module.exports = function (Posts) {
});
topics.getTopicsFields(tids, ['slug'], next);
- }
+ },
}, next);
},
function (results, next) {
@@ -81,7 +81,7 @@ module.exports = function (Posts) {
});
next(null, paths);
- }
+ },
], callback);
};
diff --git a/src/posts/user.js b/src/posts/user.js
index 7f387ef894..933b972759 100644
--- a/src/posts/user.js
+++ b/src/posts/user.js
@@ -25,7 +25,7 @@ module.exports = function (Posts) {
return groupTitle && array.indexOf(groupTitle) === index;
});
groups.getGroupsData(groupTitles, next);
- }
+ },
], function (err, groupsData) {
if (err) {
return callback(err);
@@ -38,7 +38,7 @@ module.exports = function (Posts) {
slug: group.slug,
labelColor: group.labelColor,
icon: group.icon,
- userTitle: group.userTitle
+ userTitle: group.userTitle,
};
}
});
@@ -73,7 +73,7 @@ module.exports = function (Posts) {
},
customProfileInfo: function (next) {
plugins.fireHook('filter:posts.custom_profile_info', {profile: [], uid: userData.uid}, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
diff --git a/src/posts/votes.js b/src/posts/votes.js
index 428685257a..d13acf3736 100644
--- a/src/posts/votes.js
+++ b/src/posts/votes.js
@@ -95,7 +95,7 @@ module.exports = function (Posts) {
},
downvotes: function (next) {
db.isMemberOfSets(downvoteSets, uid, next);
- }
+ },
}, callback);
};
@@ -144,7 +144,7 @@ module.exports = function (Posts) {
},
reputation: function (next) {
user.getUserField(uid, 'reputation', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -175,7 +175,7 @@ module.exports = function (Posts) {
pid: pid,
uid: uid,
owner: results.owner,
- current: current
+ current: current,
});
if (!voteStatus || (!voteStatus.upvoted && !voteStatus.downvoted)) {
@@ -224,11 +224,11 @@ module.exports = function (Posts) {
adjustPostVotes(postData, uid, type, unvote, function (err) {
callback(err, {
user: {
- reputation: newreputation
+ reputation: newreputation,
},
post: postData,
upvote: type === 'upvote' && !unvote,
- downvote: type === 'downvote' && !unvote
+ downvote: type === 'downvote' && !unvote,
});
});
});
@@ -248,7 +248,7 @@ module.exports = function (Posts) {
},
function (next) {
db.setRemove('pid:' + postData.pid + ':' + notType, uid, next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -260,7 +260,7 @@ module.exports = function (Posts) {
},
downvotes: function (next) {
db.setCount('pid:' + postData.pid + ':downvote', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/privileges.js b/src/privileges.js
index d933d72877..8fe7a6c503 100644
--- a/src/privileges.js
+++ b/src/privileges.js
@@ -14,7 +14,7 @@ privileges.userPrivilegeList = [
'upload:post:image',
'upload:post:file',
'purge',
- 'mods'
+ 'mods',
];
privileges.groupPrivilegeList = [
@@ -29,7 +29,7 @@ privileges.groupPrivilegeList = [
'groups:upload:post:image',
'groups:upload:post:file',
'groups:purge',
- 'groups:moderate'
+ 'groups:moderate',
];
privileges.privilegeList = privileges.userPrivilegeList.concat(privileges.groupPrivilegeList);
diff --git a/src/privileges/categories.js b/src/privileges/categories.js
index 67b004e19e..5761b2b23a 100644
--- a/src/privileges/categories.js
+++ b/src/privileges/categories.js
@@ -29,14 +29,14 @@ module.exports = function (privileges) {
{name: 'Upload Images'},
{name: 'Upload Files'},
{name: 'Purge'},
- {name: 'Moderate'}
+ {name: 'Moderate'},
];
async.parallel({
labels: function (next) {
async.parallel({
users: async.apply(plugins.fireHook, 'filter:privileges.list_human', privilegeLabels),
- groups: async.apply(plugins.fireHook, 'filter:privileges.groups.list_human', privilegeLabels)
+ groups: async.apply(plugins.fireHook, 'filter:privileges.groups.list_human', privilegeLabels),
}, next);
},
users: function (next) {
@@ -73,7 +73,7 @@ module.exports = function (privileges) {
next(null, memberData);
});
- }
+ },
], next);
},
groups: function (next) {
@@ -141,9 +141,9 @@ module.exports = function (privileges) {
next(null, member);
});
}, next);
- }
+ },
], next);
- }
+ },
}, function (err, payload) {
if (err) {
return callback(err);
@@ -167,7 +167,7 @@ module.exports = function (privileges) {
},
isModerator: function (next) {
user.isModerator(uid, cid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -183,7 +183,7 @@ module.exports = function (privileges) {
uid: uid,
editable: isAdminOrMod,
view_deleted: isAdminOrMod,
- isAdminOrMod: isAdminOrMod
+ isAdminOrMod: isAdminOrMod,
}, callback);
});
};
@@ -198,7 +198,7 @@ module.exports = function (privileges) {
},
function (next) {
user.isAdministrator(uid, next);
- }
+ },
], callback);
};
@@ -236,7 +236,7 @@ module.exports = function (privileges) {
},
function (next) {
user.isAdministrator(uid, next);
- }
+ },
], callback);
});
};
@@ -277,7 +277,7 @@ module.exports = function (privileges) {
},
isAdmin: function (next) {
user.isAdministrator(uid, next);
- }
+ },
}, callback);
};
@@ -299,7 +299,7 @@ module.exports = function (privileges) {
},
isAdmin: function (next) {
user.isAdministrator(uids, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -336,7 +336,7 @@ module.exports = function (privileges) {
},
moderatorOfTarget: function (next) {
user.isModerator(uid, targetCid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -372,7 +372,7 @@ module.exports = function (privileges) {
},
mods: function (next) {
user.isModerator(uid, cid, next);
- }
+ },
}, callback);
};
@@ -399,7 +399,7 @@ module.exports = function (privileges) {
},
'groups:topics:read': function (next) {
groups.isMember(groupName, 'cid:' + cid + ':privileges:groups:topics:read', next);
- }
+ },
}, callback);
};
diff --git a/src/privileges/helpers.js b/src/privileges/helpers.js
index 9df9d8cd7b..22d8795c7c 100644
--- a/src/privileges/helpers.js
+++ b/src/privileges/helpers.js
@@ -43,7 +43,7 @@ function isUserAllowedToCids(privilege, uid, cids, callback) {
},
hasGroupPrivilege: function (next) {
groups.isMemberOfGroupsList(uid, groupKeys, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -75,7 +75,7 @@ function isUserAllowedToPrivileges(privileges, uid, cid, callback) {
},
hasGroupPrivilege: function (next) {
groups.isMemberOfGroupsList(uid, groupKeys, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -98,7 +98,7 @@ helpers.isUsersAllowedTo = function (privilege, uids, cid, callback) {
},
hasGroupPrivilege: function (next) {
groups.isMembersOfGroupList(uids, 'cid:' + cid + ':privileges:groups:' + privilege, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/privileges/posts.js b/src/privileges/posts.js
index d68edc6e14..e24ca168aa 100644
--- a/src/privileges/posts.js
+++ b/src/privileges/posts.js
@@ -32,7 +32,7 @@ module.exports = function (privileges) {
read: async.apply(helpers.isUserAllowedTo, 'read', uid, cids),
'posts:edit': async.apply(helpers.isUserAllowedTo, 'posts:edit', uid, cids),
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -50,7 +50,7 @@ module.exports = function (privileges) {
move: isAdminOrMod,
isAdminOrMod: isAdminOrMod,
'topics:read': results['topics:read'][i] || isAdminOrMod,
- read: results.read[i] || isAdminOrMod
+ read: results.read[i] || isAdminOrMod,
});
}
@@ -130,18 +130,18 @@ module.exports = function (privileges) {
plugins.fireHook('filter:privileges.posts.filter', {
privilege: privilege,
uid: uid,
- pids: pids
+ pids: pids,
}, function (err, data) {
next(err, data ? data.pids : null);
});
- }
+ },
], callback);
};
privileges.posts.canEdit = function (pid, uid, callback) {
async.parallel({
isEditable: async.apply(isPostEditable, pid, uid),
- isAdminOrMod: async.apply(isAdminOrMod, pid, uid)
+ isAdminOrMod: async.apply(isAdminOrMod, pid, uid),
}, function (err, results) {
if (err) {
return callback(err);
@@ -166,9 +166,9 @@ module.exports = function (privileges) {
isAdminOrMod: async.apply(isAdminOrMod, pid, uid),
isLocked: async.apply(topics.isLocked, postData.tid),
isOwner: async.apply(posts.isOwner, pid, uid),
- 'posts:delete': async.apply(privileges.posts.can, 'posts:delete', pid, uid)
+ 'posts:delete': async.apply(privileges.posts.can, 'posts:delete', pid, uid),
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -214,12 +214,12 @@ module.exports = function (privileges) {
async.parallel({
purge: async.apply(privileges.categories.isUserAllowedTo, 'purge', cid, uid),
owner: async.apply(posts.isOwner, pid, uid),
- isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, cid, uid)
+ isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, cid, uid),
}, next);
},
function (results, next) {
next(null, results.isAdminOrMod || (results.purge && results.owner));
- }
+ },
], callback);
};
@@ -244,12 +244,12 @@ module.exports = function (privileges) {
async.parallel({
owner: async.apply(posts.isOwner, pid, uid),
- edit: async.apply(privileges.posts.can, 'posts:edit', pid, uid)
+ edit: async.apply(privileges.posts.can, 'posts:edit', pid, uid),
}, next);
},
function (result, next) {
next(null, {flag: result.owner && result.edit, message: '[[error:no-privileges]]'});
- }
+ },
], callback);
}
@@ -266,7 +266,7 @@ module.exports = function (privileges) {
},
function (next) {
user.isAdministrator(uid, next);
- }
+ },
], callback);
}
};
\ No newline at end of file
diff --git a/src/privileges/topics.js b/src/privileges/topics.js
index 39ad054462..611086f622 100644
--- a/src/privileges/topics.js
+++ b/src/privileges/topics.js
@@ -26,9 +26,9 @@ module.exports = function (privileges) {
privileges: async.apply(helpers.isUserAllowedTo, privs, uid, topic.cid),
isAdministrator: async.apply(user.isAdministrator, uid),
isModerator: async.apply(user.isModerator, uid, topic.cid),
- disabled: async.apply(categories.getCategoryField, topic.cid, 'disabled')
+ disabled: async.apply(categories.getCategoryField, topic.cid, 'disabled'),
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -57,7 +57,7 @@ module.exports = function (privileges) {
isAdminOrMod: isAdminOrMod,
disabled: disabled,
tid: tid,
- uid: uid
+ uid: uid,
}, callback);
});
};
@@ -111,11 +111,11 @@ module.exports = function (privileges) {
plugins.fireHook('filter:privileges.topics.filter', {
privilege: privilege,
uid: uid,
- tids: tids
+ tids: tids,
}, function (err, data) {
next(err, data ? data.tids : null);
});
- }
+ },
], callback);
};
@@ -145,7 +145,7 @@ module.exports = function (privileges) {
},
isAdmins: function (next) {
user.isAdministrator(uids, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -158,7 +158,7 @@ module.exports = function (privileges) {
next(null, uids);
});
- }
+ },
], callback);
};
@@ -171,12 +171,12 @@ module.exports = function (privileges) {
async.parallel({
purge: async.apply(privileges.categories.isUserAllowedTo, 'purge', cid, uid),
owner: async.apply(topics.isOwner, tid, uid),
- isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, cid, uid)
+ isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, cid, uid),
}, next);
},
function (results, next) {
next(null, results.isAdminOrMod || (results.purge && results.owner));
- }
+ },
], callback);
};
@@ -192,9 +192,9 @@ module.exports = function (privileges) {
isModerator: async.apply(user.isModerator, uid, topicData.cid),
isAdministrator: async.apply(user.isAdministrator, uid),
isOwner: async.apply(topics.isOwner, tid, uid),
- 'topics:delete': async.apply(helpers.isUserAllowedTo, 'topics:delete', uid, [topicData.cid])
+ 'topics:delete': async.apply(helpers.isUserAllowedTo, 'topics:delete', uid, [topicData.cid]),
}, next);
- }
+ },
], function (err, results) {
if (err) {
return callback(err);
@@ -231,7 +231,7 @@ module.exports = function (privileges) {
},
function (next) {
privileges.topics.isAdminOrMod(tid, uid, next);
- }
+ },
], callback);
};
@@ -248,7 +248,7 @@ module.exports = function (privileges) {
},
function (next) {
user.isAdministrator(uid, next);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/privileges/users.js b/src/privileges/users.js
index 82553647a4..7bdac2df14 100644
--- a/src/privileges/users.js
+++ b/src/privileges/users.js
@@ -66,7 +66,7 @@ module.exports = function (privileges) {
async.parallel({
user: async.apply(groups.isMemberOfGroups, uid, groupNames),
- group: async.apply(groups.isMemberOfGroupsList, uid, groupListNames)
+ group: async.apply(groups.isMemberOfGroupsList, uid, groupListNames),
}, function (err, checks) {
if (err) {
return callback(err);
@@ -94,7 +94,7 @@ module.exports = function (privileges) {
async.parallel([
async.apply(privileges.users.isGlobalModerator, uids),
async.apply(groups.isMembers, uids, 'cid:' + cid + ':privileges:mods'),
- async.apply(groups.isMembersOfGroupList, uids, 'cid:' + cid + ':privileges:groups:moderate')
+ async.apply(groups.isMembersOfGroupList, uids, 'cid:' + cid + ':privileges:groups:moderate'),
], function (err, checks) {
if (err) {
return callback(err);
@@ -112,7 +112,7 @@ module.exports = function (privileges) {
async.parallel([
async.apply(privileges.users.isGlobalModerator, uid),
async.apply(groups.isMember, uid, 'cid:' + cid + ':privileges:mods'),
- async.apply(groups.isMemberOfGroupList, uid, 'cid:' + cid + ':privileges:groups:moderate')
+ async.apply(groups.isMemberOfGroupList, uid, 'cid:' + cid + ':privileges:groups:moderate'),
], function (err, checks) {
if (err) {
return callback(err);
@@ -150,7 +150,7 @@ module.exports = function (privileges) {
},
isTargetAdmin: function (next) {
privileges.users.isAdministrator(uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/reset.js b/src/reset.js
index d237059f8e..43bf8b61b2 100644
--- a/src/reset.js
+++ b/src/reset.js
@@ -90,7 +90,7 @@ function resetTheme(themeId, callback) {
} else {
meta.themes.set({
type: 'local',
- id: themeId
+ id: themeId,
}, function (err) {
if (err) {
winston.warn('[reset] Failed to reset theme to ' + themeId);
@@ -109,7 +109,7 @@ function resetThemes(callback) {
meta.themes.set({
type: 'local',
- id: 'nodebb-theme-persona'
+ id: 'nodebb-theme-persona',
}, function (err) {
winston.info('[reset] Theme reset to Persona');
callback(err);
@@ -129,7 +129,7 @@ function resetPlugin(pluginId, callback) {
} else {
next();
}
- }
+ },
], function (err) {
if (err) {
winston.error('[reset] Could not disable plugin: %s encountered error %s', pluginId, err.message);
diff --git a/src/rewards/admin.js b/src/rewards/admin.js
index ec5a26d5aa..d54c5b9f2e 100644
--- a/src/rewards/admin.js
+++ b/src/rewards/admin.js
@@ -41,9 +41,9 @@ rewards.save = function (data, callback) {
},
function (next) {
db.setObject('rewards:id:' + data.id + ':rewards', rewardsData, next);
- }
+ },
], next);
- }
+ },
], next);
}, function (err) {
@@ -65,7 +65,7 @@ rewards.delete = function (data, callback) {
},
function (next) {
db.delete('rewards:id:' + data.id + ':rewards', next);
- }
+ },
], callback);
};
@@ -80,7 +80,7 @@ rewards.get = function (callback) {
},
rewards: function (next) {
plugins.fireHook('filter:rewards.rewards', [], next);
- }
+ },
}, callback);
};
@@ -105,7 +105,7 @@ function saveConditions(data, callback) {
async.each(Object.keys(rewardsPerCondition), function (condition, next) {
db.setAdd('condition:' + condition + ':rewards', rewardsPerCondition[condition], next);
}, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -121,7 +121,7 @@ function getActiveRewards(callback) {
},
rewards: function (next) {
db.getObject('rewards:id:' + id + ':rewards', next);
- }
+ },
}, function (err, data) {
if (data.main) {
data.main.disabled = data.main.disabled === 'true';
diff --git a/src/rewards/index.js b/src/rewards/index.js
index e2bc024f13..ed8f00d54f 100644
--- a/src/rewards/index.js
+++ b/src/rewards/index.js
@@ -44,7 +44,7 @@ rewards.checkConditionAndRewardUser = function (uid, condition, method, callback
giveRewards(uid, eligible, next);
});
- }
+ },
], callback);
};
diff --git a/src/routes/authentication.js b/src/routes/authentication.js
index c6f1359fc2..b0de9b9024 100644
--- a/src/routes/authentication.js
+++ b/src/routes/authentication.js
@@ -53,13 +53,13 @@
if (strategy.url) {
router.get(strategy.url, passport.authenticate(strategy.name, {
scope: strategy.scope,
- prompt: strategy.prompt || undefined
+ prompt: strategy.prompt || undefined,
}));
}
router.get(strategy.callbackURL, passport.authenticate(strategy.name, {
successReturnToOrRedirect: nconf.get('relative_path') + (strategy.successUrl !== undefined ? strategy.successUrl : '/'),
- failureRedirect: nconf.get('relative_path') + (strategy.failureUrl !== undefined ? strategy.failureUrl : '/login')
+ failureRedirect: nconf.get('relative_path') + (strategy.failureUrl !== undefined ? strategy.failureUrl : '/login'),
}));
});
@@ -82,7 +82,7 @@
passport.deserializeUser(function (uid, done) {
done(null, {
- uid: uid
+ uid: uid,
});
});
diff --git a/src/routes/debug.js b/src/routes/debug.js
index 9c5efe6c93..175f1ce489 100644
--- a/src/routes/debug.js
+++ b/src/routes/debug.js
@@ -26,7 +26,7 @@ module.exports = function (app, middleware, controllers) {
res.send(data);
} else {
res.status(404).json({
- error: "User doesn't exist!"
+ error: "User doesn't exist!",
});
}
});
diff --git a/src/routes/feeds.js b/src/routes/feeds.js
index 9521e65ce8..2b8ed242c5 100644
--- a/src/routes/feeds.js
+++ b/src/routes/feeds.js
@@ -41,7 +41,7 @@ function generateForTopic(req, res, callback) {
},
topic: function (next) {
topics.getTopicData(tid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -56,7 +56,7 @@ function generateForTopic(req, res, callback) {
}
userPrivileges = results.privileges;
topics.getTopicWithPosts(results.topic, 'tid:' + tid + ':posts', req.uid, 0, 25, false, next);
- }
+ },
], function (err, topicData) {
if (err) {
return callback(err);
@@ -75,7 +75,7 @@ function generateForTopic(req, res, callback) {
site_url: nconf.get('url') + '/topic/' + topicData.slug,
image_url: image_url,
author: author,
- ttl: 60
+ ttl: 60,
});
var dateStamp;
@@ -92,7 +92,7 @@ function generateForTopic(req, res, callback) {
description: postData.content,
url: nconf.get('url') + '/post/' + postData.pid,
author: postData.user ? postData.user.username : '',
- date: dateStamp
+ date: dateStamp,
});
}
});
@@ -117,7 +117,7 @@ function generateForUserTopics(req, res, callback) {
return callback();
}
user.getUserFields(uid, ['uid', 'username'], next);
- }
+ },
], function (err, userData) {
if (err) {
return callback(err);
@@ -128,7 +128,7 @@ function generateForUserTopics(req, res, callback) {
title: 'Topics by ' + userData.username,
description: 'A list of topics that are posted by ' + userData.username,
feed_url: '/user/' + userslug + '/topics.rss',
- site_url: '/user/' + userslug + '/topics'
+ site_url: '/user/' + userslug + '/topics',
}, 'uid:' + userData.uid + ':topics', req, res, callback);
});
}
@@ -152,9 +152,9 @@ function generateForCategory(req, res, next) {
reverse: true,
start: 0,
stop: 25,
- uid: req.uid
+ uid: req.uid,
}, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -168,7 +168,7 @@ function generateForCategory(req, res, next) {
feed_url: '/category/' + cid + '.rss',
site_url: '/category/' + results.category.cid,
}, results.category.topics, next);
- }
+ },
], function (err, feed) {
if (err) {
return next(err);
@@ -186,7 +186,7 @@ function generateForRecent(req, res, next) {
title: 'Recently Active Topics',
description: 'A list of topics that have been active within the past 24 hours',
feed_url: '/recent.rss',
- site_url: '/recent'
+ site_url: '/recent',
}, 'topics:recent', req, res, next);
}
@@ -198,7 +198,7 @@ function generateForPopular(req, res, next) {
daily: 'day',
weekly: 'week',
monthly: 'month',
- alltime: 'alltime'
+ alltime: 'alltime',
};
var term = terms[req.params.term] || 'day';
@@ -212,9 +212,9 @@ function generateForPopular(req, res, next) {
title: 'Popular Topics',
description: 'A list of topics that are sorted by post count',
feed_url: '/popular/' + (req.params.term || 'daily') + '.rss',
- site_url: '/popular/' + (req.params.term || 'daily')
+ site_url: '/popular/' + (req.params.term || 'daily'),
}, topics, next);
- }
+ },
], function (err, feed) {
if (err) {
return next(err);
@@ -232,7 +232,7 @@ function generateForTopics(options, set, req, res, next) {
},
function (data, next) {
generateTopicsFeed(options, data.topics, next);
- }
+ },
], function (err, feed) {
if (err) {
return next(err);
@@ -259,7 +259,7 @@ function generateTopicsFeed(feedOptions, feedTopics, callback) {
var feedItem = {
title: topicData.title,
url: nconf.get('url') + '/topic/' + topicData.slug,
- date: new Date(parseInt(topicData.lastposttime, 10)).toUTCString()
+ date: new Date(parseInt(topicData.lastposttime, 10)).toUTCString(),
};
if (topicData.teaser && topicData.teaser.user) {
@@ -306,7 +306,7 @@ function generateForRecentPosts(req, res, next) {
title: 'Recent Posts',
description: 'A list of recent posts',
feed_url: '/recentposts.rss',
- site_url: '/recentposts'
+ site_url: '/recentposts',
}, posts);
sendFeed(feed, res);
@@ -328,7 +328,7 @@ function generateForCategoryRecentPosts(req, res, next) {
},
posts: function (next) {
categories.getRecentReplies(cid, req.uid, 20, next);
- }
+ },
}, function (err, results) {
if (err) {
return next(err);
@@ -345,7 +345,7 @@ function generateForCategoryRecentPosts(req, res, next) {
title: results.category.name + ' Recent Posts',
description: 'A list of recent posts from ' + results.category.name,
feed_url: '/category/' + cid + '/recentposts.rss',
- site_url: '/category/' + cid + '/recentposts'
+ site_url: '/category/' + cid + '/recentposts',
}, results.posts);
sendFeed(feed, res);
@@ -369,7 +369,7 @@ function generateForPostsFeed(feedOptions, posts) {
description: postData.content,
url: nconf.get('url') + '/post/' + postData.pid,
author: postData.user ? postData.user.username : '',
- date: new Date(parseInt(postData.timestamp, 10)).toUTCString()
+ date: new Date(parseInt(postData.timestamp, 10)).toUTCString(),
});
});
@@ -392,7 +392,7 @@ function generateForTag(req, res, next) {
feed_url: '/tags/' + tag + '.rss',
site_url: '/tags/' + tag,
start: start,
- stop: stop
+ stop: stop,
}, 'tag:' + tag + ':topics', req, res, next);
}
diff --git a/src/routes/index.js b/src/routes/index.js
index b49a429420..196f9f3ed4 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -89,7 +89,7 @@ module.exports = function (app, middleware, hotswapIds) {
var routers = [
express.Router(), // plugin router
express.Router(), // main app router
- express.Router() // auth router
+ express.Router(), // auth router
];
var router = routers[1];
var pluginRouter = routers[0];
@@ -203,7 +203,7 @@ module.exports = function (app, middleware, hotswapIds) {
async.series([
async.apply(plugins.reloadRoutes),
async.apply(authRoutes.reloadRoutes),
- async.apply(user.addInterstitials)
+ async.apply(user.addInterstitials),
], function (err) {
if (err) {
return winston.error(err);
diff --git a/src/search.js b/src/search.js
index d77b1f58f0..551685818c 100644
--- a/src/search.js
+++ b/src/search.js
@@ -37,7 +37,7 @@ search.search = function (data, callback) {
result.search_query = validator.escape(String(data.query || ''));
result.time = (process.elapsedTimeSince(start) / 1000).toFixed(2);
next(null, result);
- }
+ },
], callback);
};
@@ -49,7 +49,7 @@ function searchInContent(data, callback) {
},
searchUids: function (next) {
getSearchUids(data, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -69,7 +69,7 @@ function searchInContent(data, callback) {
} else {
next(null, []);
}
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -107,7 +107,7 @@ function searchInContent(data, callback) {
},
function (posts, next) {
next(null, {posts: posts, matchCount: matchCount, pageCount: Math.max(1, Math.ceil(parseInt(matchCount, 10) / 10))});
- }
+ },
], callback);
});
});
@@ -227,9 +227,9 @@ function getMatchedPosts(pids, data, callback) {
} else {
setImmediate(next);
}
- }
+ },
}, next);
- }
+ },
], function (err, results) {
if (err) {
return next(err);
@@ -249,7 +249,7 @@ function getMatchedPosts(pids, data, callback) {
next(null, topicsData);
});
- }
+ },
}, next);
},
function (results, next) {
@@ -275,7 +275,7 @@ function getMatchedPosts(pids, data, callback) {
});
next(null, posts);
- }
+ },
], callback);
}
@@ -380,7 +380,7 @@ function getSearchCids(data, callback) {
},
function (cids, next) {
privileges.categories.filterCids('read', cids, data.uid, next);
- }
+ },
], callback);
return;
}
@@ -399,7 +399,7 @@ function getSearchCids(data, callback) {
} else {
next(null, []);
}
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -446,7 +446,7 @@ search.searchQuery = function (index, content, cids, uids, callback) {
index: index,
content: content,
cid: cids,
- uid: uids
+ uid: uids,
}, callback);
};
diff --git a/src/settings.js b/src/settings.js
index 6f6cad2854..a50c1ff51f 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -165,7 +165,7 @@ Settings.prototype.getWrapper = function () {
Settings.prototype.createWrapper = function (version, settings) {
return {
v: version,
- _: settings
+ _: settings,
};
};
diff --git a/src/sitemap.js b/src/sitemap.js
index ec068d71d3..7bb4c45a35 100644
--- a/src/sitemap.js
+++ b/src/sitemap.js
@@ -14,15 +14,15 @@ var utils = require('../public/src/utils');
var sitemap = {
maps: {
- topics: []
- }
+ topics: [],
+ },
};
sitemap.render = function (callback) {
var numTopics = parseInt(meta.config.sitemapTopics, 10) || 500;
var returnData = {
url: nconf.get('url'),
- topics: []
+ topics: [],
};
var numPages;
@@ -30,7 +30,7 @@ sitemap.render = function (callback) {
async.apply(db.getSortedSetRange, 'topics:recent', 0, -1),
function (tids, next) {
privileges.topics.filterTids('read', tids, 0, next);
- }
+ },
], function (err, tids) {
if (err) {
numPages = 1;
@@ -57,19 +57,19 @@ sitemap.getPages = function (callback) {
var urls = [{
url: '',
changefreq: 'weekly',
- priority: 0.6
+ priority: 0.6,
}, {
url: '/recent',
changefreq: 'daily',
- priority: 0.4
+ priority: 0.4,
}, {
url: '/users',
changefreq: 'daily',
- priority: 0.4
+ priority: 0.4,
}, {
url: '/groups',
changefreq: 'daily',
- priority: 0.4
+ priority: 0.4,
}];
plugins.fireHook('filter:sitemap.getPages', {urls: urls}, function (err, data) {
@@ -79,7 +79,7 @@ sitemap.getPages = function (callback) {
sitemap.maps.pages = sm.createSitemap({
hostname: nconf.get('url'),
cacheTime: 1000 * 60 * 60 * 24, // Cached for 24 hours
- urls: data.urls
+ urls: data.urls,
});
sitemap.maps.pages.toXML(callback);
@@ -105,7 +105,7 @@ sitemap.getCategories = function (callback) {
categoryUrls.push({
url: '/category/' + category.slug,
changefreq: 'weekly',
- priority: 0.4
+ priority: 0.4,
});
}
});
@@ -113,7 +113,7 @@ sitemap.getCategories = function (callback) {
sitemap.maps.categories = sm.createSitemap({
hostname: nconf.get('url'),
cacheTime: 1000 * 60 * 60 * 24, // Cached for 24 hours
- urls: categoryUrls
+ urls: categoryUrls,
});
sitemap.maps.categories.toXML(callback);
@@ -147,7 +147,7 @@ sitemap.getTopicPage = function (page, callback) {
},
function (tids, next) {
topics.getTopicsFields(tids, ['tid', 'title', 'slug', 'lastposttime'], next);
- }
+ },
], function (err, topics) {
if (err) {
return callback(err);
@@ -159,7 +159,7 @@ sitemap.getTopicPage = function (page, callback) {
url: '/topic/' + topic.slug,
lastmodISO: utils.toISOString(topic.lastposttime),
changefreq: 'daily',
- priority: 0.6
+ priority: 0.6,
});
}
});
@@ -167,7 +167,7 @@ sitemap.getTopicPage = function (page, callback) {
sitemap.maps.topics[page - 1] = sm.createSitemap({
hostname: nconf.get('url'),
cacheTime: 1000 * 60 * 60, // Cached for 1 hour
- urls: topicUrls
+ urls: topicUrls,
});
sitemap.maps.topics[page - 1].toXML(callback);
diff --git a/src/social.js b/src/social.js
index 0c71daadba..24aa29df2f 100644
--- a/src/social.js
+++ b/src/social.js
@@ -17,18 +17,18 @@ social.getPostSharing = function (callback) {
{
id: "facebook",
name: "Facebook",
- class: "fa-facebook"
+ class: "fa-facebook",
},
{
id: "twitter",
name: "Twitter",
- class: "fa-twitter"
+ class: "fa-twitter",
},
{
id: "google",
name: "Google+",
- class: "fa-google-plus"
- }
+ class: "fa-google-plus",
+ },
];
async.waterfall([
@@ -48,7 +48,7 @@ social.getPostSharing = function (callback) {
social.postSharing = networks;
next(null, networks);
});
- }
+ },
], callback);
};
@@ -78,7 +78,7 @@ social.setActivePostSharingNetworks = function (networkIDs, callback) {
function (next) {
social.postSharing = null;
next();
- }
+ },
], callback);
};
diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js
index 987f607ec9..7a86c725ed 100644
--- a/src/socket.io/admin.js
+++ b/src/socket.io/admin.js
@@ -33,7 +33,7 @@ var SocketAdmin = {
email: {},
analytics: {},
logs: {},
- errors: {}
+ errors: {},
};
SocketAdmin.before = function (socket, method, data, next) {
@@ -50,7 +50,7 @@ SocketAdmin.reload = function (socket, data, callback) {
events.log({
type: 'restart',
uid: socket.uid,
- ip: socket.ip
+ ip: socket.ip,
});
meta.restart();
callback();
@@ -65,13 +65,13 @@ SocketAdmin.restart = function (socket, data, callback) {
events.log({
type: 'build',
uid: socket.uid,
- ip: socket.ip
+ ip: socket.ip,
});
events.log({
type: 'restart',
uid: socket.uid,
- ip: socket.ip
+ ip: socket.ip,
});
meta.restart();
@@ -166,14 +166,14 @@ SocketAdmin.config.setMultiple = function (socket, data, callback) {
if (data.hasOwnProperty(field)) {
setting = {
key: field,
- value: data[field]
+ value: data[field],
};
plugins.fireHook('action:config.set', setting);
logger.monitorConfig({io: index.server}, setting);
}
}
setImmediate(next);
- }
+ },
], callback);
};
@@ -199,7 +199,7 @@ SocketAdmin.email.test = function (socket, data, callback) {
emailer.send(data.template, socket.uid, {
subject: '[' + site_title + '] Test Email',
site_title: site_title,
- url: nconf.get('url')
+ url: nconf.get('url'),
}, callback);
};
@@ -230,7 +230,7 @@ SocketAdmin.analytics.get = function (socket, data, callback) {
},
monthlyPageViews: function (next) {
analytics.getMonthlyPageViews(next);
- }
+ },
}, function (err, data) {
data.pastDay = data.pageviews.reduce(function (a, b) {return parseInt(a, 10) + parseInt(b, 10);});
data.pageviews[data.pageviews.length - 1] = parseInt(data.pageviews[data.pageviews.length - 1], 10) + analytics.getUnwrittenPageviews();
diff --git a/src/socket.io/admin/categories.js b/src/socket.io/admin/categories.js
index e05f6db36e..468564297c 100644
--- a/src/socket.io/admin/categories.js
+++ b/src/socket.io/admin/categories.js
@@ -27,7 +27,7 @@ Categories.getAll = function (socket, data, callback) {
},
function (result, next) {
next(null, categories.getTree(result.categories, 0));
- }
+ },
], function (err, categoriesTree) {
if (err) {
return callback(err);
diff --git a/src/socket.io/admin/groups.js b/src/socket.io/admin/groups.js
index 6b9e404ae1..bb4ab39f4a 100644
--- a/src/socket.io/admin/groups.js
+++ b/src/socket.io/admin/groups.js
@@ -15,7 +15,7 @@ Groups.create = function (socket, data, callback) {
groups.create({
name: data.name,
description: data.description,
- ownerUid: socket.uid
+ ownerUid: socket.uid,
}, callback);
};
@@ -33,7 +33,7 @@ Groups.join = function (socket, data, callback) {
return next(new Error('[[error:group-already-member]]'));
}
groups.join(data.groupName, data.uid, next);
- }
+ },
], callback);
};
@@ -55,7 +55,7 @@ Groups.leave = function (socket, data, callback) {
return next(new Error('[[error:group-not-member]]'));
}
groups.leave(data.groupName, data.uid, next);
- }
+ },
], callback);
};
diff --git a/src/socket.io/admin/rooms.js b/src/socket.io/admin/rooms.js
index 2f6ab50698..1f477559b0 100644
--- a/src/socket.io/admin/rooms.js
+++ b/src/socket.io/admin/rooms.js
@@ -13,7 +13,7 @@ var stats = {};
var totals = {};
var SocketRooms = {
stats: stats,
- totals: totals
+ totals: totals,
};
@@ -66,7 +66,7 @@ SocketRooms.getAll = function (socket, data, callback) {
recent: 0,
unread: 0,
topics: 0,
- category: 0
+ category: 0,
};
for (var instance in stats) {
@@ -109,11 +109,11 @@ SocketRooms.getAll = function (socket, data, callback) {
topTenTopics.forEach(function (topic, index) {
totals.topics[topic.tid] = {
value: topic.count || 0,
- title: validator.escape(String(titles[index].title))
+ title: validator.escape(String(titles[index].title)),
};
});
next(null, totals);
- }
+ },
], callback);
};
@@ -143,9 +143,9 @@ SocketRooms.getLocalStats = function (callback) {
recent: 0,
unread: 0,
topics: 0,
- category: 0
+ category: 0,
},
- topics: {}
+ topics: {},
};
if (io) {
diff --git a/src/socket.io/admin/user.js b/src/socket.io/admin/user.js
index 87a4c2d2ae..59b6261ea1 100644
--- a/src/socket.io/admin/user.js
+++ b/src/socket.io/admin/user.js
@@ -117,7 +117,7 @@ User.sendValidationEmail = function (socket, uids, callback) {
next();
}
}, next);
- }
+ },
], callback);
};
@@ -177,17 +177,17 @@ function deleteUsers(socket, uids, method, callback) {
type: 'user-delete',
uid: socket.uid,
targetUid: uid,
- ip: socket.ip
+ ip: socket.ip,
}, next);
},
function (next) {
plugins.fireHook('action:user.delete', {
callerUid: socket.uid,
uid: uid,
- ip: socket.ip
+ ip: socket.ip,
});
next();
- }
+ },
], next);
}, callback);
}
@@ -220,7 +220,7 @@ User.search = function (socket, data, callback) {
}
});
next(null, searchData);
- }
+ },
], callback);
};
@@ -238,10 +238,10 @@ User.acceptRegistration = function (socket, data, callback) {
type: 'registration-approved',
uid: socket.uid,
ip: socket.ip,
- targetUid: uid
+ targetUid: uid,
});
next(null, uid);
- }
+ },
], callback);
};
@@ -258,7 +258,7 @@ User.rejectRegistration = function (socket, data, callback) {
username: data.username,
});
next();
- }
+ },
], callback);
};
diff --git a/src/socket.io/categories.js b/src/socket.io/categories.js
index 885af43516..ff95fc9f7f 100644
--- a/src/socket.io/categories.js
+++ b/src/socket.io/categories.js
@@ -22,7 +22,7 @@ SocketCategories.get = function (socket, data, callback) {
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
async.apply(categories.getCategoriesData),
], next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -39,7 +39,7 @@ SocketCategories.get = function (socket, data, callback) {
SocketCategories.getWatchedCategories = function (socket, data, callback) {
async.parallel({
categories: async.apply(categories.getCategoriesByPrivilege, 'cid:0:children', socket.uid, 'find'),
- ignoredCids: async.apply(user.getIgnoredCategories, socket.uid)
+ ignoredCids: async.apply(user.getIgnoredCategories, socket.uid),
}, function (err, results) {
if (err) {
return callback(err);
@@ -70,7 +70,7 @@ SocketCategories.loadMore = function (socket, data, callback) {
} else {
next();
}
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -118,7 +118,7 @@ SocketCategories.loadMore = function (socket, data, callback) {
stop: stop,
uid: socket.uid,
targetUid: results.targetUid,
- settings: results.settings
+ settings: results.settings,
}, function (err, data) {
if (err) {
return callback(err);
@@ -129,7 +129,7 @@ SocketCategories.loadMore = function (socket, data, callback) {
data.privileges = results.privileges;
data.template = {
category: true,
- name: 'category'
+ name: 'category',
};
callback(null, data);
@@ -162,9 +162,9 @@ SocketCategories.getMoveCategories = function (socket, data, callback) {
},
function (cids, next) {
categories.getCategories(cids, socket.uid, next);
- }
+ },
], next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -221,7 +221,7 @@ function ignoreOrWatch(fn, socket, cid, callback) {
},
function (next) {
topics.pushUnreadCount(socket.uid, next);
- }
+ },
], callback);
}
diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js
index 5bff7ba944..556739c1df 100644
--- a/src/socket.io/groups.js
+++ b/src/socket.io/groups.js
@@ -42,7 +42,7 @@ SocketGroups.join = function (socket, data, callback) {
async.parallel({
isAdmin: async.apply(user.isAdministrator, socket.uid),
- groupData: async.apply(groups.getGroupData, data.groupName)
+ groupData: async.apply(groups.getGroupData, data.groupName),
}, next);
},
function (results, next) {
@@ -55,7 +55,7 @@ SocketGroups.join = function (socket, data, callback) {
} else {
groups.requestMembership(data.groupName, socket.uid, next);
}
- }
+ },
], callback);
};
@@ -75,7 +75,7 @@ function isOwner(next) {
return function (socket, data, callback) {
async.parallel({
isAdmin: async.apply(user.isAdministrator, socket.uid),
- isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName)
+ isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName),
}, function (err, results) {
if (err || (!isOwner && !results.isAdmin)) {
return callback(err || new Error('[[error:no-privileges]]'));
@@ -129,7 +129,7 @@ function acceptRejectAll(method, socket, data, callback) {
async.each(uids, function (uid, next) {
method(data.groupName, uid, next);
}, next);
- }
+ },
], callback);
}
@@ -213,7 +213,7 @@ SocketGroups.delete = function (socket, data, callback) {
async.parallel({
isOwner: async.apply(groups.ownership.isOwner, socket.uid, data.groupName),
- isAdmin: async.apply(user.isAdministrator, socket.uid)
+ isAdmin: async.apply(user.isAdministrator, socket.uid),
}, function (err, checks) {
if (err) {
return callback(err);
@@ -287,7 +287,7 @@ SocketGroups.cover.update = function (socket, data, callback) {
}
groups.updateCover(socket.uid, data, next);
- }
+ },
], callback);
};
@@ -306,7 +306,7 @@ SocketGroups.cover.remove = function (socket, data, callback) {
}
groups.removeCover(data, next);
- }
+ },
], callback);
};
diff --git a/src/socket.io/helpers.js b/src/socket.io/helpers.js
index 54c8152199..27aeef6392 100644
--- a/src/socket.io/helpers.js
+++ b/src/socket.io/helpers.js
@@ -33,7 +33,7 @@ SocketHelpers.notifyNew = function (uid, type, result) {
},
function (uids, next) {
plugins.fireHook('filter:sockets.sendNewPostToUids', {uidsTo: uids, uidFrom: uid, type: type}, next);
- }
+ },
], function (err, data) {
if (err) {
return winston.error(err.stack);
@@ -64,7 +64,7 @@ function filterTidCidIgnorers(uids, tid, cid, callback) {
},
categoryIgnored: function (next) {
db.sortedSetScores('cid:' + cid + ':ignorers', uids, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -73,7 +73,7 @@ function filterTidCidIgnorers(uids, tid, cid, callback) {
(!results.topicFollowed[index] && !results.topicIgnored[index] && !results.categoryIgnored[index]);
});
next(null, uids);
- }
+ },
], callback);
}
@@ -98,7 +98,7 @@ SocketHelpers.sendNotificationToPostOwner = function (pid, fromuid, command, not
async.parallel({
username: async.apply(user.getUserField, fromuid, 'username'),
topicTitle: async.apply(topics.getTopicField, postData.tid, 'title'),
- postObj: async.apply(posts.parsePost, postData)
+ postObj: async.apply(posts.parsePost, postData),
}, next);
},
function (results, next) {
@@ -113,9 +113,9 @@ SocketHelpers.sendNotificationToPostOwner = function (pid, fromuid, command, not
nid: command + ':post:' + pid + ':uid:' + fromuid,
from: fromuid,
mergeId: notification + '|' + pid,
- topicTitle: results.topicTitle
+ topicTitle: results.topicTitle,
}, next);
- }
+ },
], function (err, notification) {
if (err) {
return winston.error(err);
@@ -154,9 +154,9 @@ SocketHelpers.sendNotificationToTopicOwner = function (tid, fromuid, command, no
bodyShort: '[[' + notification + ', ' + results.username + ', ' + titleEscaped + ']]',
path: '/topic/' + results.topicData.slug,
nid: command + ':tid:' + tid + ':uid:' + fromuid,
- from: fromuid
+ from: fromuid,
}, next);
- }
+ },
], function (err, notification) {
if (err) {
return winston.error(err);
diff --git a/src/socket.io/index.js b/src/socket.io/index.js
index 58e31a78ea..0493b093fd 100644
--- a/src/socket.io/index.js
+++ b/src/socket.io/index.js
@@ -23,7 +23,7 @@ Sockets.init = function (server) {
var SocketIO = require('socket.io');
var socketioWildcard = require('socketio-wildcard')();
io = new SocketIO({
- path: nconf.get('relative_path') + '/socket.io'
+ path: nconf.get('relative_path') + '/socket.io',
});
addRedisAdapter(io);
@@ -34,7 +34,7 @@ Sockets.init = function (server) {
io.on('connection', onConnection);
io.listen(server, {
- transports: nconf.get('socket.io:transports')
+ transports: nconf.get('socket.io:transports'),
});
Sockets.server = io;
@@ -122,7 +122,7 @@ function onMessage(socket, payload) {
},
function (next) {
methodToCall(socket, params, next);
- }
+ },
], function (err, result) {
callback(err ? {message: err.message} : null, result);
});
@@ -130,7 +130,7 @@ function onMessage(socket, payload) {
function requireModules() {
var modules = ['admin', 'categories', 'groups', 'meta', 'modules',
- 'notifications', 'plugins', 'posts', 'topics', 'user', 'blacklist'
+ 'notifications', 'plugins', 'posts', 'topics', 'user', 'blacklist',
];
modules.forEach(function (module) {
@@ -188,7 +188,7 @@ function authorize(socket, callback) {
}
next();
});
- }
+ },
], callback);
}
@@ -240,7 +240,7 @@ Sockets.reqFromSocket = function (socket, payload, event) {
secure: encrypted,
url: referer,
path: referer.substr(referer.indexOf(host) + host.length),
- headers: headers
+ headers: headers,
};
};
diff --git a/src/socket.io/meta.js b/src/socket.io/meta.js
index baa0abc0aa..398bf249f5 100644
--- a/src/socket.io/meta.js
+++ b/src/socket.io/meta.js
@@ -5,7 +5,7 @@ var user = require('../user');
var topics = require('../topics');
var SocketMeta = {
- rooms: {}
+ rooms: {},
};
SocketMeta.reconnected = function (socket, data, callback) {
diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js
index a23e9c64bb..d77cec93b9 100644
--- a/src/socket.io/modules.js
+++ b/src/socket.io/modules.js
@@ -13,7 +13,7 @@ var user = require('../user');
var SocketModules = {
chats: {},
sounds: {},
- settings: {}
+ settings: {},
};
/* Chat */
@@ -31,7 +31,7 @@ SocketModules.chats.getRaw = function (socket, data, callback) {
return next(new Error('[[error:not-allowed]]'));
}
Messaging.getMessageField(data.mid, 'content', next);
- }
+ },
], callback);
};
@@ -66,7 +66,7 @@ SocketModules.chats.send = function (socket, data, callback) {
function (next) {
plugins.fireHook('filter:messaging.send', {
data: data,
- uid: socket.uid
+ uid: socket.uid,
}, function (err, results) {
data = results.data;
next(err);
@@ -82,7 +82,7 @@ SocketModules.chats.send = function (socket, data, callback) {
Messaging.notifyUsersInRoom(socket.uid, data.roomId, message);
user.updateOnlineUsers(socket.uid);
next(null, message);
- }
+ },
], callback);
};
@@ -120,7 +120,7 @@ SocketModules.chats.loadRoom = function (socket, data, callback) {
callerUid: socket.uid,
uid: data.uid || socket.uid,
roomId: data.roomId,
- isNew: false
+ isNew: false,
}),
}, next);
},
@@ -134,7 +134,7 @@ SocketModules.chats.loadRoom = function (socket, data, callback) {
results.roomData.maximumUsersInChatRoom = parseInt(meta.config.maximumUsersInChatRoom, 10) || 0;
results.roomData.showUserInput = !results.roomData.maximumUsersInChatRoom || results.roomData.maximumUsersInChatRoom > 2;
next(null, results.roomData);
- }
+ },
], callback);
};
@@ -168,7 +168,7 @@ SocketModules.chats.addUserToRoom = function (socket, data, callback) {
async.parallel({
settings: async.apply(user.getSettings, uid),
isAdminOrGlobalMod: async.apply(user.isAdminOrGlobalMod, socket.uid),
- isFollowing: async.apply(user.isFollowing, uid, socket.uid)
+ isFollowing: async.apply(user.isFollowing, uid, socket.uid),
}, next);
},
function (results, next) {
@@ -177,7 +177,7 @@ SocketModules.chats.addUserToRoom = function (socket, data, callback) {
}
Messaging.addUsersToRoom(socket.uid, [uid], data.roomId, next);
- }
+ },
], callback);
};
@@ -195,7 +195,7 @@ SocketModules.chats.removeUserFromRoom = function (socket, data, callback) {
}
Messaging.removeUsersFromRoom(socket.uid, [uid], data.roomId, next);
- }
+ },
], callback);
};
@@ -246,7 +246,7 @@ SocketModules.chats.markRead = function (socket, roomId, callback) {
}
async.parallel({
uidsInRoom: async.apply(Messaging.getUidsInRoom, roomId, 0, -1),
- markRead: async.apply(Messaging.markRead, socket.uid, roomId)
+ markRead: async.apply(Messaging.markRead, socket.uid, roomId),
}, function (err, results) {
if (err) {
return callback(err);
@@ -282,7 +282,7 @@ SocketModules.chats.markAllRead = function (socket, data, callback) {
function (next) {
Messaging.pushUnreadCount(socket.uid);
next();
- }
+ },
], callback);
};
@@ -304,7 +304,7 @@ SocketModules.chats.renameRoom = function (socket, data, callback) {
server.in('uid_' + uid).emit('event:chats.roomRename', eventData);
});
next();
- }
+ },
], callback);
};
@@ -334,7 +334,7 @@ SocketModules.chats.getMessages = function (socket, data, callback) {
uid: data.uid,
roomId: data.roomId,
start: parseInt(data.start, 10) || 0,
- count: 50
+ count: 50,
};
Messaging.getMessages(params, callback);
@@ -353,7 +353,7 @@ SocketModules.sounds.getMapping = function (socket, data, callback) {
SocketModules.sounds.getData = function (socket, data, callback) {
async.parallel({
mapping: async.apply(meta.sounds.getMapping, socket.uid),
- files: async.apply(meta.sounds.getFiles)
+ files: async.apply(meta.sounds.getFiles),
}, callback);
};
diff --git a/src/socket.io/notifications.js b/src/socket.io/notifications.js
index cc83b0b80b..9e0c4f4301 100644
--- a/src/socket.io/notifications.js
+++ b/src/socket.io/notifications.js
@@ -30,7 +30,7 @@ SocketNotifs.loadMore = function (socket, data, callback) {
},
function (notifications, next) {
next(null, {notifications: notifications, nextStart: stop});
- }
+ },
], callback);
};
diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js
index fe729a5c11..933a758fb0 100644
--- a/src/socket.io/posts.js
+++ b/src/socket.io/posts.js
@@ -68,7 +68,7 @@ SocketPosts.getRawPost = function (socket, pid, callback) {
return next(new Error('[[error:no-post]]'));
}
next(null, postData.content);
- }
+ },
], callback);
};
@@ -134,7 +134,7 @@ SocketPosts.getReplies = function (socket, pid, callback) {
},
privileges: function (next) {
privileges.posts.get(pids, socket.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -149,7 +149,7 @@ SocketPosts.getReplies = function (socket, pid, callback) {
posts.modifyPostByPrivilege(postData, postPrivileges.isAdminOrMod);
});
next(null, postData);
- }
+ },
], callback);
};
diff --git a/src/socket.io/posts/edit.js b/src/socket.io/posts/edit.js
index 54650961f9..93b4b0cdb4 100644
--- a/src/socket.io/posts/edit.js
+++ b/src/socket.io/posts/edit.js
@@ -47,7 +47,7 @@ module.exports = function (SocketPosts) {
uid: socket.uid,
ip: socket.ip,
oldTitle: validator.escape(String(result.topic.oldTitle)),
- newTitle: validator.escape(String(result.topic.title))
+ newTitle: validator.escape(String(result.topic.title)),
});
}
@@ -60,7 +60,7 @@ module.exports = function (SocketPosts) {
'administrators',
'Global Moderators',
'cid:' + result.topic.cid + ':privileges:mods',
- 'cid:' + result.topic.cid + ':privileges:groups:moderate'
+ 'cid:' + result.topic.cid + ':privileges:groups:moderate',
], next);
},
function (results, next) {
@@ -69,7 +69,7 @@ module.exports = function (SocketPosts) {
websockets.in('uid_' + uid).emit('event:post_edited', editResult);
});
next(null, editResult.post);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/socket.io/posts/flag.js b/src/socket.io/posts/flag.js
index 077b88bfc9..cf2e8c9fce 100644
--- a/src/socket.io/posts/flag.js
+++ b/src/socket.io/posts/flag.js
@@ -48,7 +48,7 @@ module.exports = function (SocketPosts) {
},
userData: function (next) {
user.getUserFields(socket.uid, ['username', 'reputation', 'banned'], next);
- }
+ },
}, next);
},
function (user, next) {
@@ -79,7 +79,7 @@ module.exports = function (SocketPosts) {
},
moderators: function (next) {
groups.getMembers('cid:' + post.topic.cid + ':privileges:mods', 0, -1, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -94,7 +94,7 @@ module.exports = function (SocketPosts) {
nid: 'post_flag:' + data.pid + ':uid:' + socket.uid,
from: socket.uid,
mergeId: 'notifications:user_flagged_post_in|' + data.pid,
- topicTitle: post.topic.title
+ topicTitle: post.topic.title,
}, function (err, notification) {
if (err || !notification) {
return next(err);
@@ -103,7 +103,7 @@ module.exports = function (SocketPosts) {
plugins.fireHook('action:post.flag', {post: post, reason: data.reason, flaggingUser: flaggingUser});
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), next);
});
- }
+ },
], callback);
};
@@ -120,7 +120,7 @@ module.exports = function (SocketPosts) {
return next(new Error('[[no-privileges]]'));
}
posts.dismissFlag(pid, next);
- }
+ },
], callback);
};
@@ -134,7 +134,7 @@ module.exports = function (SocketPosts) {
return next(new Error('[[no-privileges]]'));
}
posts.dismissAllFlags(next);
- }
+ },
], callback);
};
@@ -149,7 +149,7 @@ module.exports = function (SocketPosts) {
function (next) {
async.parallel([
async.apply(user.isAdminOrGlobalMod, socket.uid),
- async.apply(user.isModeratorOfAnyCategory, socket.uid)
+ async.apply(user.isModeratorOfAnyCategory, socket.uid),
], function (err, results) {
next(err, results[0] || results[1]);
});
@@ -166,7 +166,7 @@ module.exports = function (SocketPosts) {
}, payload);
posts.updateFlagData(socket.uid, data.pid, payload, next);
- }
+ },
], callback);
};
};
diff --git a/src/socket.io/posts/helpers.js b/src/socket.io/posts/helpers.js
index 4c04f82afc..d1285a6f53 100644
--- a/src/socket.io/posts/helpers.js
+++ b/src/socket.io/posts/helpers.js
@@ -26,7 +26,7 @@ helpers.postCommand = function (socket, command, eventName, notification, data,
},
deleted: function (next) {
posts.getPostField(data.pid, 'deleted', next);
- }
+ },
}, next);
},
function (results, next) {
@@ -50,7 +50,7 @@ helpers.postCommand = function (socket, command, eventName, notification, data,
},
function (filteredData, next) {
executeCommand(socket, command, eventName, notification, filteredData.data, next);
- }
+ },
], callback);
};
@@ -71,6 +71,6 @@ function executeCommand(socket, command, eventName, notification, data, callback
socketHelpers.rescindUpvoteNotification(data.pid, socket.uid);
}
next(null, result);
- }
+ },
], callback);
}
\ No newline at end of file
diff --git a/src/socket.io/posts/move.js b/src/socket.io/posts/move.js
index 207db2aef5..c6327dbe69 100644
--- a/src/socket.io/posts/move.js
+++ b/src/socket.io/posts/move.js
@@ -30,7 +30,7 @@ module.exports = function (SocketPosts) {
function (next) {
socketHelpers.sendNotificationToPostOwner(data.pid, socket.uid, 'move', 'notifications:moved_your_post');
next();
- }
+ },
], callback);
};
diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js
index 571d84175b..3ef8e01020 100644
--- a/src/socket.io/posts/tools.js
+++ b/src/socket.io/posts/tools.js
@@ -41,7 +41,7 @@ module.exports = function (SocketPosts) {
},
postSharing: function (next) {
social.getActivePostSharing(next);
- }
+ },
}, next);
},
function (results, next) {
@@ -54,7 +54,7 @@ module.exports = function (SocketPosts) {
results.posts.display_moderator_tools = results.posts.display_edit_tools || results.posts.display_delete_tools;
results.posts.display_move_tools = results.isAdminOrMod;
next(null, results);
- }
+ },
], callback);
};
@@ -85,11 +85,11 @@ module.exports = function (SocketPosts) {
type: 'post-delete',
uid: socket.uid,
pid: data.pid,
- ip: socket.ip
+ ip: socket.ip,
});
next();
- }
+ },
], callback);
};
@@ -110,11 +110,11 @@ module.exports = function (SocketPosts) {
type: 'post-restore',
uid: socket.uid,
pid: data.pid,
- ip: socket.ip
+ ip: socket.ip,
});
setImmediate(next);
- }
+ },
], callback);
};
@@ -171,9 +171,9 @@ module.exports = function (SocketPosts) {
uid: socket.uid,
pid: data.pid,
ip: socket.ip,
- title: validator.escape(String(title))
+ title: validator.escape(String(title)),
}, next);
- }
+ },
], callback);
};
@@ -184,7 +184,7 @@ module.exports = function (SocketPosts) {
},
function (topic, next) {
socketTopics.doTopicAction('delete', 'event:topic_deleted', socket, {tids: [topic.tid], cid: topic.cid}, next);
- }
+ },
], callback);
}
@@ -197,7 +197,7 @@ module.exports = function (SocketPosts) {
posts.getTopicFields(pid, ['postcount'], function (err, topic) {
next(err, topic ? parseInt(topic.postcount, 10) === 1 : false);
});
- }
+ },
}, callback);
}
diff --git a/src/socket.io/posts/votes.js b/src/socket.io/posts/votes.js
index e3a9510aaa..e5668789f2 100644
--- a/src/socket.io/posts/votes.js
+++ b/src/socket.io/posts/votes.js
@@ -30,7 +30,7 @@ module.exports = function (SocketPosts) {
},
downvoteUids: function (next) {
db.getSetMembers('pid:' + data.pid + ':downvote', next);
- }
+ },
}, next);
},
function (results, next) {
@@ -46,9 +46,9 @@ module.exports = function (SocketPosts) {
},
downvoteCount: function (next) {
next(null, results.downvoteUids.length);
- }
+ },
}, next);
- }
+ },
], callback);
};
@@ -71,7 +71,7 @@ module.exports = function (SocketPosts) {
user.getUsernamesByUids(uids, function (err, usernames) {
next(err, {
otherCount: otherCount,
- usernames: usernames
+ usernames: usernames,
});
});
}, callback);
diff --git a/src/socket.io/topics/infinitescroll.js b/src/socket.io/topics/infinitescroll.js
index a68d220609..9b694550ff 100644
--- a/src/socket.io/topics/infinitescroll.js
+++ b/src/socket.io/topics/infinitescroll.js
@@ -24,7 +24,7 @@ module.exports = function (SocketTopics) {
},
topic: function (next) {
topics.getTopicFields(data.tid, ['postcount', 'deleted'], next);
- }
+ },
}, next);
},
function (results, next) {
@@ -72,7 +72,7 @@ module.exports = function (SocketTopics) {
},
postSharing: function (next) {
social.getActivePostSharing(next);
- }
+ },
}, next);
},
function (topicData, next) {
@@ -86,7 +86,7 @@ module.exports = function (SocketTopics) {
topics.modifyPostsByPrivilege(topicData, userPrivileges);
next(null, topicData);
- }
+ },
], callback);
};
diff --git a/src/socket.io/topics/move.js b/src/socket.io/topics/move.js
index 938fe22792..3fcacde2a0 100644
--- a/src/socket.io/topics/move.js
+++ b/src/socket.io/topics/move.js
@@ -30,7 +30,7 @@ module.exports = function (SocketTopics) {
topicData = _topicData;
topicData.tid = tid;
topics.tools.move(tid, data.cid, socket.uid, next);
- }
+ },
], function (err) {
if (err) {
return next(err);
@@ -66,7 +66,7 @@ module.exports = function (SocketTopics) {
async.eachLimit(tids, 50, function (tid, next) {
topics.tools.move(tid, data.cid, socket.uid, next);
}, next);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/socket.io/topics/tags.js b/src/socket.io/topics/tags.js
index 8829229ca8..0efb40b4ec 100644
--- a/src/socket.io/topics/tags.js
+++ b/src/socket.io/topics/tags.js
@@ -20,7 +20,7 @@ module.exports = function (SocketTopics) {
return next(null, true);
}
next(null, tagWhitelist.indexOf(data.tag) !== -1);
- }
+ },
], callback);
};
@@ -50,7 +50,7 @@ module.exports = function (SocketTopics) {
function (tags, next) {
tags = tags.filter(Boolean);
next(null, {tags: tags, nextStart: stop + 1});
- }
+ },
], callback);
};
};
diff --git a/src/socket.io/topics/tools.js b/src/socket.io/topics/tools.js
index ede87d2599..d560a296d2 100644
--- a/src/socket.io/topics/tools.js
+++ b/src/socket.io/topics/tools.js
@@ -27,7 +27,7 @@ module.exports = function (SocketTopics) {
},
privileges: function (next) {
privileges.topics.get(data.tid, socket.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -41,7 +41,7 @@ module.exports = function (SocketTopics) {
topic.pinned = parseInt(topic.pinned, 10) === 1;
topic.thread_tools = data.tools;
next(null, topic);
- }
+ },
], callback);
};
@@ -95,7 +95,7 @@ module.exports = function (SocketTopics) {
function (data, next) {
socketHelpers.emitToTopicAndCategory(event, data);
logTopicAction(action, socket, tid, next);
- }
+ },
], next);
}, callback);
};
@@ -115,9 +115,9 @@ module.exports = function (SocketTopics) {
uid: socket.uid,
ip: socket.ip,
tid: tid,
- title: validator.escape(String(title))
+ title: validator.escape(String(title)),
}, next);
- }
+ },
], callback);
}
diff --git a/src/socket.io/topics/unread.js b/src/socket.io/topics/unread.js
index 39c6485a26..f331200e79 100644
--- a/src/socket.io/topics/unread.js
+++ b/src/socket.io/topics/unread.js
@@ -22,7 +22,7 @@ module.exports = function (SocketTopics) {
topics.markTopicNotificationsRead(tids, socket.uid);
}
next();
- }
+ },
], callback);
};
@@ -44,7 +44,7 @@ module.exports = function (SocketTopics) {
function (next) {
topics.pushUnreadCount(socket.uid);
next();
- }
+ },
], callback);
};
@@ -55,7 +55,7 @@ module.exports = function (SocketTopics) {
},
function (tids, next) {
SocketTopics.markAsRead(socket, tids, next);
- }
+ },
], callback);
};
@@ -70,7 +70,7 @@ module.exports = function (SocketTopics) {
function (next) {
topics.pushUnreadCount(socket.uid);
next();
- }
+ },
], callback);
};
@@ -110,14 +110,14 @@ module.exports = function (SocketTopics) {
},
function (next) {
topics.updateRecent(tid, Date.now(), next);
- }
+ },
], next);
}, next);
},
function (next) {
topics.pushUnreadCount(socket.uid);
next();
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/socket.io/user.js b/src/socket.io/user.js
index c10a510e71..30130a5ba1 100644
--- a/src/socket.io/user.js
+++ b/src/socket.io/user.js
@@ -52,10 +52,10 @@ SocketUser.deleteAccount = function (socket, data, callback) {
type: 'user-delete',
uid: socket.uid,
targetUid: socket.uid,
- ip: socket.ip
+ ip: socket.ip,
});
next();
- }
+ },
], callback);
};
@@ -85,7 +85,7 @@ SocketUser.emailConfirm = function (socket, data, callback) {
}
user.email.sendValidationEmail(socket.uid, email, next);
- }
+ },
], callback);
};
@@ -120,7 +120,7 @@ SocketUser.reset.commit = function (socket, data, callback) {
function (next) {
async.parallel({
uid: async.apply(db.getObjectField, 'reset:uid', data.code),
- reset: async.apply(user.reset.commit, data.code, data.password)
+ reset: async.apply(user.reset.commit, data.code, data.password),
}, next);
},
function (results, next) {
@@ -128,7 +128,7 @@ SocketUser.reset.commit = function (socket, data, callback) {
events.log({
type: 'password-reset',
uid: uid,
- ip: socket.ip
+ ip: socket.ip,
});
user.getUserField(uid, 'username', next);
@@ -140,11 +140,11 @@ SocketUser.reset.commit = function (socket, data, callback) {
username: username,
date: parsedDate,
site_title: meta.config.title || 'NodeBB',
- subject: '[[email:reset.notify.subject]]'
+ subject: '[[email:reset.notify.subject]]',
});
next();
- }
+ },
], callback);
};
@@ -175,7 +175,7 @@ SocketUser.follow = function (socket, data, callback) {
nid: 'follow:' + data.uid + ':uid:' + socket.uid,
from: socket.uid,
path: '/uid/' + data.uid + '/followers',
- mergeId: 'notifications:user_started_following_you'
+ mergeId: 'notifications:user_started_following_you',
}, next);
},
function (notification, next) {
@@ -184,7 +184,7 @@ SocketUser.follow = function (socket, data, callback) {
}
notification.user = userData;
notifications.push(notification, [data.uid], next);
- }
+ },
], callback);
};
@@ -203,7 +203,7 @@ function toggleFollow(method, uid, theiruid, callback) {
plugins.fireHook('action:user.' + method, {
fromUid: uid,
- toUid: theiruid
+ toUid: theiruid,
});
callback();
});
@@ -223,7 +223,7 @@ SocketUser.saveSettings = function (socket, data, callback) {
return next(new Error('[[error:no-privileges]]'));
}
user.saveSettings(data.uid, data.settings, next);
- }
+ },
], callback);
};
@@ -257,7 +257,7 @@ SocketUser.getUnreadCounts = function (socket, data, callback) {
unreadTopicCount: async.apply(topics.getTotalUnread, socket.uid),
unreadNewTopicCount: async.apply(topics.getTotalUnread, socket.uid, 'new'),
unreadChatCount: async.apply(messaging.getUnreadCount, socket.uid),
- unreadNotificationCount: async.apply(user.notifications.getUnreadCount, socket.uid)
+ unreadNotificationCount: async.apply(user.notifications.getUnreadCount, socket.uid),
}, callback);
};
@@ -294,7 +294,7 @@ SocketUser.invite = function (socket, email, callback) {
},
function (next) {
user.sendInvitationEmail(socket.uid, email, next);
- }
+ },
], callback);
} else {
user.sendInvitationEmail(socket.uid, email, callback);
@@ -340,7 +340,7 @@ SocketUser.setModerationNote = function (socket, data, callback) {
} else {
db.deleteObjectField('user:' + data.uid, 'moderationNote', next);
}
- }
+ },
], callback);
};
diff --git a/src/socket.io/user/ban.js b/src/socket.io/user/ban.js
index 089720c59e..cf869cc5de 100644
--- a/src/socket.io/user/ban.js
+++ b/src/socket.io/user/ban.js
@@ -24,7 +24,7 @@ module.exports = function (SocketUser) {
type: 'user-ban',
uid: socket.uid,
targetUid: uid,
- ip: socket.ip
+ ip: socket.ip,
}, next);
},
function (next) {
@@ -32,10 +32,10 @@ module.exports = function (SocketUser) {
callerUid: socket.uid,
ip: socket.ip,
uid: uid,
- until: data.until > 0 ? data.until : undefined
+ until: data.until > 0 ? data.until : undefined,
});
next();
- }
+ },
], next);
}, callback);
};
@@ -51,17 +51,17 @@ module.exports = function (SocketUser) {
type: 'user-unban',
uid: socket.uid,
targetUid: uid,
- ip: socket.ip
+ ip: socket.ip,
}, next);
},
function (next) {
plugins.fireHook('action:user.unbanned', {
callerUid: socket.uid,
ip: socket.ip,
- uid: uid
+ uid: uid,
});
next();
- }
+ },
], next);
}, callback);
};
@@ -80,7 +80,7 @@ module.exports = function (SocketUser) {
return next(new Error('[[error:no-privileges]]'));
}
async.each(uids, method, next);
- }
+ },
], callback);
}
@@ -98,7 +98,7 @@ module.exports = function (SocketUser) {
function (next) {
websockets.in('uid_' + uid).emit('event:banned');
next();
- }
+ },
], callback);
}
};
diff --git a/src/socket.io/user/picture.js b/src/socket.io/user/picture.js
index deceb70f8a..56c4c4c1c9 100644
--- a/src/socket.io/user/picture.js
+++ b/src/socket.io/user/picture.js
@@ -37,7 +37,7 @@ module.exports = function (SocketUser) {
plugins.fireHook('filter:user.getPicture', {
uid: socket.uid,
type: type,
- picture: undefined
+ picture: undefined,
}, function (err, returnData) {
if (err) {
return next(err);
@@ -50,7 +50,7 @@ module.exports = function (SocketUser) {
},
function (picture, next) {
user.setUserField(data.uid, 'picture', picture, next);
- }
+ },
], callback);
};
@@ -67,7 +67,7 @@ module.exports = function (SocketUser) {
},
function (uploadedImage, next) {
next(null, uploadedImage ? uploadedImage.url : null);
- }
+ },
], callback);
};
@@ -97,9 +97,9 @@ module.exports = function (SocketUser) {
user.setUserFields(data.uid, {
uploadedpicture: '',
- picture: userData.uploadedpicture === userData.picture ? '' : userData.picture // if current picture is uploaded picture, reset to user icon
+ picture: userData.uploadedpicture === userData.picture ? '' : userData.picture, // if current picture is uploaded picture, reset to user icon
}, next);
- }
+ },
], callback);
};
@@ -111,9 +111,9 @@ module.exports = function (SocketUser) {
async.parallel({
list: async.apply(plugins.fireHook, 'filter:user.listPictures', {
uid: data.uid,
- pictures: []
+ pictures: [],
}),
- uploaded: async.apply(user.getUserField, data.uid, 'uploadedpicture')
+ uploaded: async.apply(user.getUserField, data.uid, 'uploadedpicture'),
}, function (err, data) {
if (err) {
return callback(err);
@@ -123,7 +123,7 @@ module.exports = function (SocketUser) {
data.list.pictures.push({
type: 'uploaded',
url: data.uploaded,
- text: '[[user:uploaded_picture]]'
+ text: '[[user:uploaded_picture]]',
});
}
diff --git a/src/socket.io/user/profile.js b/src/socket.io/user/profile.js
index 392c7559b7..ed7b868ba2 100644
--- a/src/socket.io/user/profile.js
+++ b/src/socket.io/user/profile.js
@@ -20,7 +20,7 @@ module.exports = function (SocketUser) {
},
function (next) {
SocketUser.updateProfile(socket, data, next);
- }
+ },
], callback);
};
@@ -34,7 +34,7 @@ module.exports = function (SocketUser) {
},
function (next) {
user.updateCoverPicture(data, next);
- }
+ },
], callback);
};
@@ -48,7 +48,7 @@ module.exports = function (SocketUser) {
},
function (next) {
user.uploadCroppedPicture(data, next);
- }
+ },
], callback);
};
@@ -63,7 +63,7 @@ module.exports = function (SocketUser) {
},
function (next) {
user.removeCoverPicture(data, next);
- }
+ },
], callback);
};
@@ -77,7 +77,7 @@ module.exports = function (SocketUser) {
} else {
next(null, false);
}
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -114,7 +114,7 @@ module.exports = function (SocketUser) {
type: 'password-change',
uid: socket.uid,
targetUid: data.uid,
- ip: socket.ip
+ ip: socket.ip,
});
callback();
});
@@ -146,7 +146,7 @@ module.exports = function (SocketUser) {
},
canEdit: function (next) {
privileges.users.canEdit(socket.uid, data.uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -183,7 +183,7 @@ module.exports = function (SocketUser) {
}
next(null, userData);
- }
+ },
], callback);
};
diff --git a/src/socket.io/user/search.js b/src/socket.io/user/search.js
index 9c3774089d..c4619a28cf 100644
--- a/src/socket.io/user/search.js
+++ b/src/socket.io/user/search.js
@@ -21,7 +21,7 @@ module.exports = function (SocketUser) {
onlineOnly: data.onlineOnly,
bannedOnly: data.bannedOnly,
flaggedOnly: data.flaggedOnly,
- uid: socket.uid
+ uid: socket.uid,
}, function (err, result) {
if (err) {
return callback(err);
diff --git a/src/socket.io/user/status.js b/src/socket.io/user/status.js
index b3530ffc7d..1c08296725 100644
--- a/src/socket.io/user/status.js
+++ b/src/socket.io/user/status.js
@@ -17,7 +17,7 @@ module.exports = function (SocketUser) {
},
function (userData, next) {
next(null, user.getStatus(userData));
- }
+ },
], callback);
};
@@ -43,11 +43,11 @@ module.exports = function (SocketUser) {
function (next) {
var data = {
uid: socket.uid,
- status: status
+ status: status,
};
websockets.server.emit('event:user_status_change', data);
next(null, data);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/start.js b/src/start.js
index 0a8ed18e67..68378d331c 100644
--- a/src/start.js
+++ b/src/start.js
@@ -35,7 +35,7 @@ start.start = function () {
},
function (next) {
require('./upgrade').check(next);
- }
+ },
], function (err) {
next(err);
});
@@ -53,7 +53,7 @@ start.start = function () {
}
webserver.listen(next);
- }
+ },
], function (err) {
if (err) {
switch(err.message) {
@@ -80,7 +80,7 @@ start.start = function () {
if (process.send) {
process.send({
- action: 'listening'
+ action: 'listening',
});
}
});
@@ -143,7 +143,7 @@ function restart() {
if (process.send) {
winston.info('[app] Restarting...');
process.send({
- action: 'restart'
+ action: 'restart',
});
} else {
winston.error('[app] Could not restart server. Shutting down.');
diff --git a/src/topics.js b/src/topics.js
index 75aeb46564..ec03c04b47 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -50,7 +50,7 @@ var social = require('./social');
},
function (settings, next) {
next(null, Math.ceil((parseInt(postCount, 10) - 1) / settings.postsPerPage));
- }
+ },
], callback);
};
@@ -69,7 +69,7 @@ var social = require('./social');
},
function (topics, next) {
next(null, {topics: topics, nextStart: stop + 1});
- }
+ },
], callback);
};
@@ -80,7 +80,7 @@ var social = require('./social');
},
function (tids, next) {
Topics.getTopicsByTids(tids, uid, next);
- }
+ },
], callback);
};
@@ -129,7 +129,7 @@ var social = require('./social');
},
tags: function (next) {
Topics.getTopicsTagsObjects(tids, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -164,7 +164,7 @@ var social = require('./social');
},
function (data, next) {
next(null, data.topics);
- }
+ },
], callback);
};
@@ -187,9 +187,9 @@ var social = require('./social');
function (tags, next) {
topicData.tags = tags;
Topics.getRelatedTopics(topicData, uid, next);
- }
+ },
], next);
- }
+ },
}, next);
},
function (results, next) {
@@ -214,7 +214,7 @@ var social = require('./social');
},
function (data, next) {
next(null, data.topic);
- }
+ },
], callback);
};
@@ -253,7 +253,7 @@ var social = require('./social');
Topics.calculatePostIndices(replies, start, stop, topic.postcount, reverse);
Topics.addPostData(posts, uid, next);
- }
+ },
], callback);
}
@@ -313,7 +313,7 @@ var social = require('./social');
if (plugins.hasListeners('filter:topic.search')) {
plugins.fireHook('filter:topic.search', {
tid: tid,
- term: term
+ term: term,
}, callback);
} else {
callback(new Error('no-plugins-available'), []);
diff --git a/src/topics/bookmarks.js b/src/topics/bookmarks.js
index 8ec80cfdcb..2b3dbb3ec4 100644
--- a/src/topics/bookmarks.js
+++ b/src/topics/bookmarks.js
@@ -50,7 +50,7 @@ module.exports = function (Topics) {
var uidData = bookmarks.map(function (bookmark) {
return {
uid: bookmark.value,
- bookmark: bookmark.score
+ bookmark: bookmark.score,
};
});
@@ -74,7 +74,7 @@ module.exports = function (Topics) {
}
});
}, next);
- }
+ },
], function (err) {
callback(err);
});
diff --git a/src/topics/create.js b/src/topics/create.js
index bf62266ecf..cdb0a79bf3 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -42,7 +42,7 @@ module.exports = function (Topics) {
'viewcount': 0,
'locked': 0,
'deleted': 0,
- 'pinned': 0
+ 'pinned': 0,
};
if (data.thumb) {
@@ -61,7 +61,7 @@ module.exports = function (Topics) {
db.sortedSetsAdd([
'topics:tid',
'cid:' + topicData.cid + ':tids',
- 'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids'
+ 'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids',
], timestamp, topicData.tid, next);
},
function (next) {
@@ -78,13 +78,13 @@ module.exports = function (Topics) {
},
function (next) {
Topics.createTags(data.tags, topicData.tid, timestamp, next);
- }
+ },
], next);
},
function (results, next) {
plugins.fireHook('action:topic.save', topicData);
next(null, topicData.tid);
- }
+ },
], callback);
};
@@ -160,7 +160,7 @@ module.exports = function (Topics) {
},
topicData: function (next) {
Topics.getTopicsByTids([postData.tid], uid, next);
- }
+ },
}, next);
},
function (data, next) {
@@ -182,9 +182,9 @@ module.exports = function (Topics) {
next(null, {
topicData: data.topicData,
- postData: data.postData
+ postData: data.postData,
});
- }
+ },
], callback);
};
@@ -248,7 +248,7 @@ module.exports = function (Topics) {
content: content,
toPid: data.toPid,
timestamp: data.timestamp,
- ip: data.req ? data.req.ip : null
+ ip: data.req ? data.req.ip : null,
}, next);
},
function (_postData, next) {
@@ -272,7 +272,7 @@ module.exports = function (Topics) {
plugins.fireHook('action:topic.reply', postData);
next(null, postData);
- }
+ },
], callback);
};
@@ -299,7 +299,7 @@ module.exports = function (Topics) {
},
content: function (next) {
posts.parsePost(postData, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -323,7 +323,7 @@ module.exports = function (Topics) {
postData.topic.title = validator.escape(String(postData.topic.title));
next(null, postData);
- }
+ },
], callback);
}
diff --git a/src/topics/delete.js b/src/topics/delete.js
index 91c1bf53e3..9d114629ae 100644
--- a/src/topics/delete.js
+++ b/src/topics/delete.js
@@ -31,7 +31,7 @@ module.exports = function (Topics) {
}
db.sortedSetRemove('cid:' + topicData.cid + ':pids', pids, next);
});
- }
+ },
], function (err) {
callback(err);
});
@@ -78,7 +78,7 @@ module.exports = function (Topics) {
db.sortedSetAdd('cid:' + topicData.cid + ':pids', scores, pidsToAdd, next);
});
});
- }
+ },
], function (err) {
callback(err);
});
@@ -104,7 +104,7 @@ module.exports = function (Topics) {
},
function (next) {
Topics.purge(tid, uid, next);
- }
+ },
], callback);
};
@@ -122,7 +122,7 @@ module.exports = function (Topics) {
'tid:' + tid + ':posts',
'tid:' + tid + ':posts:votes',
'tid:' + tid + ':bookmarks',
- 'tid:' + tid + ':posters'
+ 'tid:' + tid + ':posters',
], next);
},
function (next) {
@@ -136,9 +136,9 @@ module.exports = function (Topics) {
},
function (next) {
reduceCounters(tid, next);
- }
+ },
], next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -153,7 +153,7 @@ module.exports = function (Topics) {
function (next) {
async.parallel({
followers: async.apply(db.getSetMembers, 'tid:' + tid + ':followers'),
- ignorers: async.apply(db.getSetMembers, 'tid:' + tid + ':ignorers')
+ ignorers: async.apply(db.getSetMembers, 'tid:' + tid + ':ignorers'),
}, next);
},
function (results, next) {
@@ -164,7 +164,7 @@ module.exports = function (Topics) {
return 'uid:' + uid + 'ignored_tids';
});
db.sortedSetsRemove(followerKeys.concat(ignorerKeys), tid, next);
- }
+ },
], callback);
}
@@ -180,12 +180,12 @@ module.exports = function (Topics) {
'cid:' + topicData.cid + ':tids:pinned',
'cid:' + topicData.cid + ':tids:posts',
'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids',
- 'uid:' + topicData.uid + ':topics'
+ 'uid:' + topicData.uid + ':topics',
], tid, next);
},
function (next) {
user.decrementUserFieldBy(topicData.uid, 'topiccount', 1, next);
- }
+ },
], callback);
});
}
@@ -214,10 +214,10 @@ module.exports = function (Topics) {
},
function (next) {
db.incrObjectFieldBy('category:' + topicData.cid, 'topic_count', incr, next);
- }
+ },
], next);
});
- }
+ },
], callback);
}
};
diff --git a/src/topics/follow.js b/src/topics/follow.js
index 4775cdb9bc..78ef0e87cc 100644
--- a/src/topics/follow.js
+++ b/src/topics/follow.js
@@ -40,7 +40,7 @@ module.exports = function (Topics) {
},
function (next) {
next(null, !isFollowing);
- }
+ },
], callback);
};
@@ -77,7 +77,7 @@ module.exports = function (Topics) {
function (next) {
plugins.fireHook(hook, {uid: uid, tid: tid});
next();
- }
+ },
], callback);
}
@@ -104,7 +104,7 @@ module.exports = function (Topics) {
},
function (next) {
db.sortedSetAdd(set2, Date.now(), tid, next);
- }
+ },
], callback);
}
@@ -115,7 +115,7 @@ module.exports = function (Topics) {
},
function (next) {
db.sortedSetRemove(set2, tid, next);
- }
+ },
], callback);
}
@@ -158,7 +158,7 @@ module.exports = function (Topics) {
return uid && !isIgnoring[index];
});
next(null, readingUids);
- }
+ },
], callback);
};
@@ -233,7 +233,7 @@ module.exports = function (Topics) {
tid: postData.topic.tid,
from: exceptUid,
mergeId: 'notifications:user_posted_to|' + postData.topic.tid,
- topicTitle: title
+ topicTitle: title,
}, next);
},
function (notification, next) {
@@ -248,7 +248,7 @@ module.exports = function (Topics) {
async.eachLimit(followers, 3, function (toUid, next) {
async.parallel({
userData: async.apply(user.getUserFields, toUid, ['username', 'userslug']),
- userSettings: async.apply(user.getSettings, toUid)
+ userSettings: async.apply(user.getSettings, toUid),
}, function (err, data) {
if (err) {
return next(err);
@@ -266,7 +266,7 @@ module.exports = function (Topics) {
url: nconf.get('url') + '/topic/' + postData.topic.tid,
topicSlug: postData.topic.slug,
postCount: postData.topic.postcount,
- base_url: nconf.get('url')
+ base_url: nconf.get('url'),
}, next);
} else {
winston.debug('[topics.notifyFollowers] uid ' + toUid + ' does not have post notifications enabled, skipping.');
@@ -275,7 +275,7 @@ module.exports = function (Topics) {
});
});
next();
- }
+ },
], callback);
};
};
diff --git a/src/topics/fork.js b/src/topics/fork.js
index d882cddf00..436096fa5b 100644
--- a/src/topics/fork.js
+++ b/src/topics/fork.js
@@ -46,7 +46,7 @@ module.exports = function (Topics) {
},
isAdminOrMod: function (next) {
privileges.categories.isAdminOrMod(cid, uid, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -76,7 +76,7 @@ module.exports = function (Topics) {
},
function (next) {
Topics.getTopicData(tid, next);
- }
+ },
], callback);
};
@@ -122,15 +122,15 @@ module.exports = function (Topics) {
},
function (next) {
Topics.addPostToTopic(tid, postData, next);
- }
+ },
], next);
},
function (results, next) {
async.parallel([
async.apply(updateRecentTopic, tid),
- async.apply(updateRecentTopic, postData.tid)
+ async.apply(updateRecentTopic, postData.tid),
], next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -153,7 +153,7 @@ module.exports = function (Topics) {
}
async.parallel([
async.apply(db.incrObjectFieldBy, 'category:' + topicData[0].cid, 'post_count', -1),
- async.apply(db.incrObjectFieldBy, 'category:' + topicData[1].cid, 'post_count', 1)
+ async.apply(db.incrObjectFieldBy, 'category:' + topicData[1].cid, 'post_count', 1),
], callback);
});
}
@@ -171,7 +171,7 @@ module.exports = function (Topics) {
},
function (timestamp, next) {
Topics.updateTimestamp(tid, timestamp, next);
- }
+ },
], callback);
}
diff --git a/src/topics/popular.js b/src/topics/popular.js
index 452f897581..cca04e40ba 100644
--- a/src/topics/popular.js
+++ b/src/topics/popular.js
@@ -19,7 +19,7 @@ module.exports = function (Topics) {
},
function (tids, next) {
getTopics(tids, uid, count, next);
- }
+ },
], callback);
};
@@ -46,7 +46,7 @@ module.exports = function (Topics) {
},
function (tids, next) {
Topics.getTopicsByTids(tids, uid, next);
- }
+ },
], callback);
}
};
diff --git a/src/topics/posts.js b/src/topics/posts.js
index aadf6bd76b..69905b454e 100644
--- a/src/topics/posts.js
+++ b/src/topics/posts.js
@@ -23,7 +23,7 @@ module.exports = function (Topics) {
},
function (next) {
Topics.addPostToTopic(postData.tid, postData, next);
- }
+ },
], callback);
};
@@ -35,7 +35,7 @@ module.exports = function (Topics) {
},
postCount: function (next) {
Topics.getTopicField(tid, 'postcount', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -109,7 +109,7 @@ module.exports = function (Topics) {
},
parents: function (next) {
Topics.addParentPosts(postData, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -136,7 +136,7 @@ module.exports = function (Topics) {
plugins.fireHook('filter:topics.addPostData', {
posts: postData,
- uid: uid
+ uid: uid,
}, function (err, data) {
callback(err, data ? data.posts : null);
});
@@ -193,7 +193,7 @@ module.exports = function (Topics) {
post.parent = parents[post.toPid];
});
next();
- }
+ },
], callback);
};
@@ -223,7 +223,7 @@ module.exports = function (Topics) {
},
function (mainPost, next) {
next(null, parseInt(mainPost.pid, 10) && parseInt(mainPost.deleted, 10) !== 1 ? mainPost.pid.toString() : null);
- }
+ },
], callback);
};
@@ -263,7 +263,7 @@ module.exports = function (Topics) {
},
function (err) {
callback(err, latestPid);
- }
+ },
);
};
@@ -285,7 +285,7 @@ module.exports = function (Topics) {
var downvotes = parseInt(postData.downvotes, 10) || 0;
var votes = upvotes - downvotes;
db.sortedSetAdd('tid:' + tid + ':posts:votes', votes, postData.pid, next);
- }
+ },
], function (err) {
next(err);
});
@@ -296,7 +296,7 @@ module.exports = function (Topics) {
},
function (count, next) {
Topics.updateTeaser(tid, next);
- }
+ },
], callback);
};
@@ -305,7 +305,7 @@ module.exports = function (Topics) {
function (next) {
db.sortedSetsRemove([
'tid:' + tid + ':posts',
- 'tid:' + tid + ':posts:votes'
+ 'tid:' + tid + ':posts:votes',
], postData.pid, next);
},
function (next) {
@@ -313,7 +313,7 @@ module.exports = function (Topics) {
},
function (count, next) {
Topics.updateTeaser(tid, next);
- }
+ },
], callback);
};
@@ -324,7 +324,7 @@ module.exports = function (Topics) {
},
pids: function (next) {
db.getSortedSetRange('tid:' + tid + ':posts', 0, -1, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
diff --git a/src/topics/recent.js b/src/topics/recent.js
index 23ca9ff5ba..4c68ceff9b 100644
--- a/src/topics/recent.js
+++ b/src/topics/recent.js
@@ -14,13 +14,13 @@ module.exports = function (Topics) {
day: 86400000,
week: 604800000,
month: 2592000000,
- year: 31104000000
+ year: 31104000000,
};
Topics.getRecentTopics = function (cid, uid, start, stop, filter, callback) {
var recentTopics = {
nextStart : 0,
- topics: []
+ topics: [],
};
async.waterfall([
@@ -43,7 +43,7 @@ module.exports = function (Topics) {
recentTopics.topics = topicData;
recentTopics.nextStart = stop + 1;
next(null, recentTopics);
- }
+ },
], callback);
};
@@ -72,7 +72,7 @@ module.exports = function (Topics) {
},
topicData: function (next) {
Topics.getTopicsFields(tids, ['tid', 'cid'], next);
- }
+ },
}, next);
},
function (results, next) {
@@ -86,7 +86,7 @@ module.exports = function (Topics) {
return topic.tid;
});
next(null, tids);
- }
+ },
], callback);
}
@@ -101,7 +101,7 @@ module.exports = function (Topics) {
},
function (topics, next) {
next(null, {topics: topics, nextStart: stop + 1});
- }
+ },
], callback);
};
@@ -128,12 +128,12 @@ module.exports = function (Topics) {
return next();
}
Topics.updateRecent(tid, timestamp, next);
- }
+ },
], next);
},
function (next) {
Topics.setTopicField(tid, 'lastposttime', timestamp, next);
- }
+ },
], function (err) {
callback(err);
});
diff --git a/src/topics/suggested.js b/src/topics/suggested.js
index d51d51827b..08c3c24f15 100644
--- a/src/topics/suggested.js
+++ b/src/topics/suggested.js
@@ -19,7 +19,7 @@ module.exports = function (Topics) {
},
categoryTids: function (next) {
getCategoryTids(tid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -51,7 +51,7 @@ module.exports = function (Topics) {
},
function (data, next) {
next(null, _.unique(_.flatten(data)));
- }
+ },
], callback);
}
@@ -62,7 +62,7 @@ module.exports = function (Topics) {
},
function (title, next) {
search.searchQuery('topic', title, [], [], next);
- }
+ },
], callback);
}
@@ -73,7 +73,7 @@ module.exports = function (Topics) {
},
function (cid, next) {
categories.getTopicIds(cid, 'cid:' + cid + ':tids', true, 0, 9, next);
- }
+ },
], callback);
}
diff --git a/src/topics/tags.js b/src/topics/tags.js
index a360de290e..d37ae6a929 100644
--- a/src/topics/tags.js
+++ b/src/topics/tags.js
@@ -41,14 +41,14 @@ module.exports = function (Topics) {
async.parallel([
async.apply(db.setAdd, 'topic:' + tid + ':tags', tags),
- async.apply(db.sortedSetsAdd, keys, timestamp, tid)
+ async.apply(db.sortedSetsAdd, keys, timestamp, tid),
], function (err) {
next(err);
});
},
function (next) {
async.each(tags, updateTagCount, next);
- }
+ },
], callback);
};
@@ -68,7 +68,7 @@ module.exports = function (Topics) {
return tagWhitelist.indexOf(tag) !== -1;
});
next(null, tags);
- }
+ },
], callback);
}
@@ -91,7 +91,7 @@ module.exports = function (Topics) {
return next();
}
db.sortedSetAdd('tags:topic:count', 0, tag, next);
- }
+ },
], callback);
};
@@ -112,7 +112,7 @@ module.exports = function (Topics) {
count = count || 0;
db.sortedSetAdd('tags:topic:count', count, tag, next);
- }
+ },
], callback);
}
@@ -146,7 +146,7 @@ module.exports = function (Topics) {
db.deleteAll(tags.map(function (tag) {
return 'tag:' + tag;
}), next);
- }
+ },
], callback);
};
@@ -176,7 +176,7 @@ module.exports = function (Topics) {
},
function (tags, next) {
Topics.getTagData(tags, next);
- }
+ },
], callback);
};
@@ -195,7 +195,7 @@ module.exports = function (Topics) {
tag.bgColor = tagData[index] ? tagData[index].bgColor : '';
});
next(null, tags);
- }
+ },
], callback);
};
@@ -240,7 +240,7 @@ module.exports = function (Topics) {
},
counts: function (next) {
db.sortedSetScores('tags:topic:count', uniqueTopicTags, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -257,7 +257,7 @@ module.exports = function (Topics) {
});
next(null, topicTags);
- }
+ },
], callback);
};
@@ -272,7 +272,7 @@ module.exports = function (Topics) {
},
function (timestamp, next) {
Topics.createTags(tags, tid, timestamp, next);
- }
+ },
], callback);
};
@@ -297,9 +297,9 @@ module.exports = function (Topics) {
async.each(tags, function (tag, next) {
updateTagCount(tag, next);
}, next);
- }
+ },
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -323,7 +323,7 @@ module.exports = function (Topics) {
},
function (result, next) {
next(null, result.matches);
- }
+ },
], callback);
};
@@ -342,7 +342,7 @@ module.exports = function (Topics) {
},
function (result, next) {
next(null, result.matches);
- }
+ },
], callback);
};
@@ -379,7 +379,7 @@ module.exports = function (Topics) {
return a > b;
});
next(null, {matches: matches});
- }
+ },
], callback);
}
@@ -387,7 +387,7 @@ module.exports = function (Topics) {
var searchResult = {
tags: [],
matchCount: 0,
- pageCount: 1
+ pageCount: 1,
};
if (!data || !data.query || !data.query.length) {
@@ -408,7 +408,7 @@ module.exports = function (Topics) {
});
Topics.getTagData(tags, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -422,7 +422,7 @@ module.exports = function (Topics) {
searchResult.matchCount = results.tagData.length;
searchResult.pageCount = 1;
next(null, searchResult);
- }
+ },
], callback);
};
@@ -453,7 +453,7 @@ module.exports = function (Topics) {
return topic && !topic.deleted && parseInt(topic.uid, 10) !== parseInt(uid, 10);
});
next(null, topics);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/topics/teaser.js b/src/topics/teaser.js
index 1467dd194f..264c5c77a6 100644
--- a/src/topics/teaser.js
+++ b/src/topics/teaser.js
@@ -99,7 +99,7 @@ module.exports = function (Topics) {
},
function (data, next) {
next(null, data.teasers);
- }
+ },
], callback);
};
@@ -113,7 +113,7 @@ module.exports = function (Topics) {
},
function (topics, next) {
Topics.getTeasers(topics, next);
- }
+ },
], callback);
};
diff --git a/src/topics/thumb.js b/src/topics/thumb.js
index a5ca38ed3e..171dabb11b 100644
--- a/src/topics/thumb.js
+++ b/src/topics/thumb.js
@@ -54,7 +54,7 @@ module.exports = function (Topics) {
path: pathToUpload,
extension: path.extname(pathToUpload),
width: size,
- height: size
+ height: size,
}, next);
},
function (next) {
@@ -69,7 +69,7 @@ module.exports = function (Topics) {
deleteFile(pathToUpload);
data.thumb = uploadedFile.url;
next();
- }
+ },
], function (err) {
if (err) {
deleteFile(pathToUpload);
diff --git a/src/topics/tools.js b/src/topics/tools.js
index cccffa8c75..8edf72142e 100644
--- a/src/topics/tools.js
+++ b/src/topics/tools.js
@@ -65,11 +65,11 @@ module.exports = function (Topics) {
tid: tid,
cid: topicData.cid,
isDelete: isDelete,
- uid: uid
+ uid: uid,
};
next(null, data);
- }
+ },
], callback);
}
@@ -99,7 +99,7 @@ module.exports = function (Topics) {
},
function (next) {
next(null, {tid: tid, cid: cid, uid: uid});
- }
+ },
], callback);
};
@@ -139,13 +139,13 @@ module.exports = function (Topics) {
tid: tid,
isLocked: lock,
uid: uid,
- cid: cid
+ cid: cid,
};
plugins.fireHook('action:topic.lock', data);
next(null, data);
- }
+ },
], callback);
}
@@ -185,16 +185,16 @@ module.exports = function (Topics) {
async.parallel([
async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids:pinned', Date.now(), tid),
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids', tid),
- async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', tid)
+ async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', tid),
], next);
} else {
async.parallel([
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:pinned', tid),
async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids', topicData.lastposttime, tid),
- async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids:posts', topicData.postcount, tid)
+ async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids:posts', topicData.postcount, tid),
], next);
}
- }
+ },
], next);
},
function (results, next) {
@@ -202,13 +202,13 @@ module.exports = function (Topics) {
tid: tid,
isPinned: pin,
uid: uid,
- cid: topicData.cid
+ cid: topicData.cid,
};
plugins.fireHook('action:topic.pin', data);
next(null, data);
- }
+ },
], callback);
}
@@ -248,10 +248,10 @@ module.exports = function (Topics) {
} else {
setImmediate(next);
}
- }
+ },
], next);
}, next);
- }
+ },
], callback);
};
@@ -272,7 +272,7 @@ module.exports = function (Topics) {
db.sortedSetsRemove([
'cid:' + topicData.cid + ':tids',
'cid:' + topicData.cid + ':tids:pinned',
- 'cid:' + topicData.cid + ':tids:posts' // post count
+ 'cid:' + topicData.cid + ':tids:posts', // post count
], tid, next);
},
function (next) {
@@ -286,10 +286,10 @@ module.exports = function (Topics) {
function (next) {
topic.postcount = topic.postcount || 0;
db.sortedSetAdd('cid:' + cid + ':tids:posts', topic.postcount, tid, next);
- }
+ },
], next);
}
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -307,9 +307,9 @@ module.exports = function (Topics) {
function (next) {
Topics.setTopicFields(tid, {
cid: cid,
- oldCid: oldCid
+ oldCid: oldCid,
}, next);
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -318,7 +318,7 @@ module.exports = function (Topics) {
tid: tid,
fromCid: oldCid,
toCid: cid,
- uid: uid
+ uid: uid,
});
callback();
});
diff --git a/src/topics/unread.js b/src/topics/unread.js
index e61ca46d59..717cdc8ef5 100644
--- a/src/topics/unread.js
+++ b/src/topics/unread.js
@@ -29,7 +29,7 @@ module.exports = function (Topics) {
var unreadTopics = {
showSelect: true,
nextStart : 0,
- topics: []
+ topics: [],
};
async.waterfall([
@@ -59,7 +59,7 @@ module.exports = function (Topics) {
unreadTopics.topics = topicData;
unreadTopics.nextStart = stop + 1;
next(null, unreadTopics);
- }
+ },
], callback);
};
@@ -97,7 +97,7 @@ module.exports = function (Topics) {
},
tids_unread: function (next) {
db.getSortedSetRevRangeWithScores('uid:' + uid + ':tids_unread', 0, -1, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -144,7 +144,7 @@ module.exports = function (Topics) {
tids = tids.slice(0, 200);
filterTopics(uid, tids, cid, ignoredCids, filter, next);
- }
+ },
], callback);
};
@@ -168,7 +168,7 @@ module.exports = function (Topics) {
return next(null, []);
}
db.sortedSetScores('uid:' + uid + ':followed_tids', tids, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -181,7 +181,7 @@ module.exports = function (Topics) {
return topic.tid;
});
next(null, tids);
- }
+ },
], callback);
}
@@ -223,7 +223,7 @@ module.exports = function (Topics) {
function (next) {
async.parallel({
topicScores: async.apply(db.sortedSetScores, 'topics:recent', tids),
- userScores: async.apply(db.sortedSetScores, 'uid:' + uid + ':tids_read', tids)
+ userScores: async.apply(db.sortedSetScores, 'uid:' + uid + ':tids_read', tids),
}, next);
},
function (results, next) {
@@ -243,7 +243,7 @@ module.exports = function (Topics) {
async.parallel({
markRead: async.apply(db.sortedSetAdd, 'uid:' + uid + ':tids_read', scores, tids),
markUnread: async.apply(db.sortedSetRemove, 'uid:' + uid + ':tids_unread', tids),
- topicData: async.apply(Topics.getTopicsFields, tids, ['cid'])
+ topicData: async.apply(Topics.getTopicsFields, tids, ['cid']),
}, next);
},
function (results, next) {
@@ -257,7 +257,7 @@ module.exports = function (Topics) {
},
function (next) {
next(null, true);
- }
+ },
], callback);
};
@@ -272,7 +272,7 @@ module.exports = function (Topics) {
},
function (markedRead, next) {
db.delete('uid:' + uid + ':tids_unread', next);
- }
+ },
], callback);
};
@@ -292,7 +292,7 @@ module.exports = function (Topics) {
function (next) {
user.notifications.pushCount(uid);
next();
- }
+ },
], callback);
};
@@ -303,7 +303,7 @@ module.exports = function (Topics) {
},
function (cid, next) {
categories.markAsUnreadForAll(cid, next);
- }
+ },
], callback);
};
@@ -323,7 +323,7 @@ module.exports = function (Topics) {
},
tids_unread: function (next) {
db.sortedSetScores('uid:' + uid + ':tids_unread', tids, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -359,7 +359,7 @@ module.exports = function (Topics) {
},
function (next) {
db.sortedSetAdd('uid:' + uid + ':tids_unread', Date.now(), tid, next);
- }
+ },
], callback);
};
diff --git a/src/upgrade.js b/src/upgrade.js
index 4aca187a7a..923684662b 100644
--- a/src/upgrade.js
+++ b/src/upgrade.js
@@ -131,7 +131,7 @@ Upgrade.upgrade = function (callback) {
},
function (next) {
db.deleteObjectField('post:' + id, 'reputation', next);
- }
+ },
], next);
}, next);
}, {}, next);
@@ -187,7 +187,7 @@ Upgrade.upgrade = function (callback) {
console.log('processing pid: ' + postData.pid + ' toPid: ' + postData.toPid);
async.parallel([
async.apply(db.sortedSetAdd, 'pid:' + postData.toPid + ':replies', postData.timestamp, postData.pid),
- async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies')
+ async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies'),
], next);
}, next);
});
@@ -254,11 +254,11 @@ Upgrade.upgrade = function (callback) {
} else {
setImmediate(next);
}
- }
+ },
], next);
}, next);
}, next);
- }
+ },
], function (err) {
if (err) {
return next(err);
@@ -297,7 +297,7 @@ Upgrade.upgrade = function (callback) {
async.parallel([
async.apply(db.sortedSetAdd, 'cid:' + topicData.cid + ':tids:pinned', Date.now(), topicData.tid),
async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids', topicData.tid),
- async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', topicData.tid)
+ async.apply(db.sortedSetRemove, 'cid:' + topicData.cid + ':tids:posts', topicData.tid),
], next);
}, next);
});
diff --git a/src/user.js b/src/user.js
index 00e5824690..6c1e9a2891 100644
--- a/src/user.js
+++ b/src/user.js
@@ -66,7 +66,7 @@ var meta = require('./meta');
topics.pushUnreadCount(uid);
plugins.fireHook('action:user.online', {uid: uid, timestamp: now});
next();
- }
+ },
], callback);
};
@@ -87,7 +87,7 @@ var meta = require('./meta');
},
function (uids, next) {
User.getUsers(uids, uid, next);
- }
+ },
], callback);
};
@@ -107,7 +107,7 @@ var meta = require('./meta');
},
isAdmin: function (next) {
User.isAdministrator(uids, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -125,7 +125,7 @@ var meta = require('./meta');
},
function (data, next) {
next(null, data.users);
- }
+ },
], callback);
};
@@ -214,7 +214,7 @@ var meta = require('./meta');
},
function (uid, next) {
User.getUserField(uid, 'username', next);
- }
+ },
], callback);
};
@@ -259,7 +259,7 @@ var meta = require('./meta');
User.isAdminOrGlobalMod = function (uid, callback) {
async.parallel({
isAdmin: async.apply(User.isAdministrator, uid),
- isGlobalMod: async.apply(User.isGlobalModerator, uid)
+ isGlobalMod: async.apply(User.isGlobalModerator, uid),
}, function (err, results) {
callback(err, results ? (results.isAdmin || results.isGlobalMod) : false);
});
@@ -292,7 +292,7 @@ var meta = require('./meta');
User.getAdminsandGlobalMods = function (callback) {
async.parallel({
admins: async.apply(groups.getMembers, 'administrators', 0, -1),
- mods: async.apply(groups.getMembers, 'Global Moderators', 0, -1)
+ mods: async.apply(groups.getMembers, 'Global Moderators', 0, -1),
}, function (err, results) {
if (err) {
return callback(err);
@@ -308,7 +308,7 @@ var meta = require('./meta');
async.parallel([
async.apply(groups.getMembers, 'administrators', 0, -1),
async.apply(groups.getMembers, 'Global Moderators', 0, -1),
- async.apply(User.getModeratorUids)
+ async.apply(User.getModeratorUids),
], function (err, results) {
if (err) {
return callback(err);
@@ -333,7 +333,7 @@ var meta = require('./meta');
next(null, _.union.apply(_, memberSets));
});
- }
+ },
], callback);
};
@@ -352,7 +352,7 @@ var meta = require('./meta');
return cid && isMods[index];
});
next(null, cids);
- }
+ },
], callback);
};
@@ -364,7 +364,7 @@ var meta = require('./meta');
data.interstitials.push({
template: 'partials/acceptTos',
data: {
- termsOfUse: meta.config.termsOfUse
+ termsOfUse: meta.config.termsOfUse,
},
callback: function (userData, formData, next) {
if (formData['agree-terms'] === 'on') {
@@ -372,12 +372,12 @@ var meta = require('./meta');
}
next(userData.acceptTos ? null : new Error('[[register:terms_of_use_error]]'));
- }
+ },
});
}
callback(null, data);
- }
+ },
});
callback();
diff --git a/src/user/admin.js b/src/user/admin.js
index 8b5a6ebef4..591e1f6d2e 100644
--- a/src/user/admin.js
+++ b/src/user/admin.js
@@ -52,7 +52,7 @@ module.exports = function (User) {
});
next(null, csvContent);
- }
+ },
], callback);
};
diff --git a/src/user/approval.js b/src/user/approval.js
index 2f9d9f847a..5194c26dd1 100644
--- a/src/user/approval.js
+++ b/src/user/approval.js
@@ -29,7 +29,7 @@ module.exports = function (User) {
username: userData.username,
email: userData.email,
ip: userData.ip,
- hashedPassword: hashedPassword
+ hashedPassword: hashedPassword,
};
plugins.fireHook('filter:user.addToApprovalQueue', {data: data, userData: userData}, next);
},
@@ -41,7 +41,7 @@ module.exports = function (User) {
},
function (next) {
sendNotificationToAdmins(userData.username, next);
- }
+ },
], callback);
};
@@ -52,12 +52,12 @@ module.exports = function (User) {
bodyShort: '[[notifications:new_register, ' + username + ']]',
nid: 'new_register:' + username,
path: '/admin/manage/registration',
- mergeId: 'new_register'
+ mergeId: 'new_register',
}, next);
},
function (notification, next) {
notifications.pushGroup(notification, 'administrators', next);
- }
+ },
], callback);
}
@@ -93,7 +93,7 @@ module.exports = function (User) {
username: username,
subject: subject,
template: 'registration_accepted',
- uid: uid
+ uid: uid,
};
emailer.send('registration_accepted', uid, data, next);
@@ -101,7 +101,7 @@ module.exports = function (User) {
},
function (next) {
next(null, uid);
- }
+ },
], callback);
};
@@ -115,7 +115,7 @@ module.exports = function (User) {
async.each(uids, function (uid, next) {
notifications.markRead(nid, uid, next);
}, next);
- }
+ },
], callback);
}
@@ -126,14 +126,14 @@ module.exports = function (User) {
},
function (next) {
markNotificationRead(username, next);
- }
+ },
], callback);
};
function removeFromQueue(username, callback) {
async.parallel([
async.apply(db.sortedSetRemove, 'registration:queue', username),
- async.apply(db.delete, 'registration:queue:name:' + username)
+ async.apply(db.delete, 'registration:queue:name:' + username),
], function (err) {
callback(err);
});
@@ -191,7 +191,7 @@ module.exports = function (User) {
'&email=' + encodeURIComponent(user.email) +
'&username=' + encodeURIComponent(user.username) +
'&f=json',
- json: true
+ json: true,
}, function (err, response, body) {
if (err) {
return next();
@@ -205,7 +205,7 @@ module.exports = function (User) {
next();
});
- }
+ },
], function (err) {
next(err, user);
});
@@ -216,7 +216,7 @@ module.exports = function (User) {
},
function (results, next) {
next(null, results.users);
- }
+ },
], callback);
};
diff --git a/src/user/auth.js b/src/user/auth.js
index 219c468304..92b206b4c0 100644
--- a/src/user/auth.js
+++ b/src/user/auth.js
@@ -37,10 +37,10 @@ module.exports = function (User) {
events.log({
type: 'account-locked',
uid: uid,
- ip: ip
+ ip: ip,
});
next(new Error('[[error:account-locked]]'));
- }
+ },
], callback);
};
@@ -51,7 +51,7 @@ module.exports = function (User) {
User.auth.resetLockout = function (uid, callback) {
async.parallel([
async.apply(db.delete, 'loginAttempts:' + uid),
- async.apply(db.delete, 'lockout:' + uid)
+ async.apply(db.delete, 'lockout:' + uid),
], callback);
};
@@ -98,7 +98,7 @@ module.exports = function (User) {
}, function (err) {
next(err, sessions);
});
- }
+ },
], function (err, sessions) {
callback(err, sessions ? sessions.map(function (sessObj) {
sessObj.meta.datetimeISO = new Date(sessObj.meta.datetime).toISOString();
@@ -128,7 +128,7 @@ module.exports = function (User) {
}
},
async.apply(db.sortedSetRemove, 'uid:' + uid + ':sessions', sessionId),
- async.apply(db.sessionStore.destroy.bind(db.sessionStore), sessionId)
+ async.apply(db.sessionStore.destroy.bind(db.sessionStore), sessionId),
], callback);
});
};
@@ -140,7 +140,7 @@ module.exports = function (User) {
async.each(sids, function (sid, next) {
User.auth.revokeSession(sid, uid, next);
}, next);
- }
+ },
], callback);
};
@@ -169,9 +169,9 @@ module.exports = function (User) {
async.each(sids, function (sid, next) {
db.sessionStore.destroy(sid, next);
}, next);
- }
+ },
], next);
- }
+ },
], next);
}, {batch: 1000}, callback);
};
diff --git a/src/user/bans.js b/src/user/bans.js
index 8667641c46..7af1e36cf0 100644
--- a/src/user/bans.js
+++ b/src/user/bans.js
@@ -27,7 +27,7 @@ module.exports = function (User) {
var tasks = [
async.apply(User.setUserField, uid, 'banned', 1),
async.apply(db.sortedSetAdd, 'users:banned', now, uid),
- async.apply(db.sortedSetAdd, 'uid:' + uid + ':bans', now, until)
+ async.apply(db.sortedSetAdd, 'uid:' + uid + ':bans', now, until),
];
if (until > 0 && now < until) {
@@ -53,7 +53,7 @@ module.exports = function (User) {
},
function (next) {
db.sortedSetsRemove(['users:banned', 'users:banned:expire'], uid, next);
- }
+ },
], callback);
};
@@ -75,11 +75,11 @@ module.exports = function (User) {
async.parallel([
async.apply(db.sortedSetRemove.bind(db), 'users:banned:expire', uid),
async.apply(db.sortedSetRemove.bind(db), 'users:banned', uid),
- async.apply(User.setUserFields, uid, {banned:0, 'banned:expire': 0})
+ async.apply(User.setUserFields, uid, {banned:0, 'banned:expire': 0}),
], function (err) {
next(err, false);
});
- }
+ },
], callback);
};
diff --git a/src/user/categories.js b/src/user/categories.js
index fee8fc8bb0..77d8cf4338 100644
--- a/src/user/categories.js
+++ b/src/user/categories.js
@@ -18,7 +18,7 @@ module.exports = function (User) {
},
all: function (next) {
db.getSortedSetRange('categories:cid', 0, -1, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -48,7 +48,7 @@ module.exports = function (User) {
},
function (next) {
db.sortedSetAdd('cid:' + cid + ':ignorers', Date.now(), uid, next);
- }
+ },
], callback);
};
@@ -69,7 +69,7 @@ module.exports = function (User) {
},
function (next) {
db.sortedSetRemove('cid:' + cid + ':ignorers', uid, next);
- }
+ },
], callback);
};
};
\ No newline at end of file
diff --git a/src/user/create.js b/src/user/create.js
index 67d6baf3cd..d61a79d39a 100644
--- a/src/user/create.js
+++ b/src/user/create.js
@@ -42,7 +42,7 @@ module.exports = function (User) {
'topiccount': 0,
'lastposttime': 0,
'banned': 0,
- 'status': 'online'
+ 'status': 'online',
};
async.parallel({
@@ -51,7 +51,7 @@ module.exports = function (User) {
},
userData: function (next) {
plugins.fireHook('filter:user.create', {user: userData, data: data}, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -106,7 +106,7 @@ module.exports = function (User) {
if (userData.email) {
async.parallel([
async.apply(db.sortedSetAdd, 'email:uid', userData.uid, userData.email.toLowerCase()),
- async.apply(db.sortedSetAdd, 'email:sorted', 0, userData.email.toLowerCase() + ':' + userData.uid)
+ async.apply(db.sortedSetAdd, 'email:sorted', 0, userData.email.toLowerCase() + ':' + userData.uid),
], next);
if (parseInt(userData.uid, 10) !== 1 && parseInt(meta.config.requireEmailConfirmation, 10) === 1) {
@@ -128,13 +128,13 @@ module.exports = function (User) {
async.parallel([
async.apply(User.setUserField, userData.uid, 'password', hash),
- async.apply(User.reset.updateExpiry, userData.uid)
+ async.apply(User.reset.updateExpiry, userData.uid),
], next);
});
},
function (next) {
User.updateDigestSetting(userData.uid, meta.config.dailyDigestFreq, next);
- }
+ },
], next);
},
function (results, next) {
@@ -143,7 +143,7 @@ module.exports = function (User) {
}
plugins.fireHook('action:user.create', userData);
next(null, userData.uid);
- }
+ },
], callback);
});
});
@@ -179,7 +179,7 @@ module.exports = function (User) {
} else {
next();
}
- }
+ },
}, function (err) {
callback(err);
});
diff --git a/src/user/delete.js b/src/user/delete.js
index e648c5dfb0..bc0ae912c6 100644
--- a/src/user/delete.js
+++ b/src/user/delete.js
@@ -25,7 +25,7 @@ module.exports = function (User) {
},
function (next) {
User.deleteAccount(uid, next);
- }
+ },
], callback);
};
@@ -88,7 +88,7 @@ module.exports = function (User) {
if (userData.email) {
async.parallel([
async.apply(db.sortedSetRemove, 'email:uid', userData.email.toLowerCase()),
- async.apply(db.sortedSetRemove, 'email:sorted', userData.email.toLowerCase() + ':' + uid)
+ async.apply(db.sortedSetRemove, 'email:sorted', userData.email.toLowerCase() + ':' + uid),
], next);
} else {
next();
@@ -104,7 +104,7 @@ module.exports = function (User) {
'users:notvalidated',
'digest:day:uids',
'digest:week:uids',
- 'digest:month:uids'
+ 'digest:month:uids',
], uid, next);
},
function (next) {
@@ -123,7 +123,7 @@ module.exports = function (User) {
'uid:' + uid + ':chat:rooms', 'uid:' + uid + ':chat:rooms:unread',
'uid:' + uid + ':upvote', 'uid:' + uid + ':downvote',
'uid:' + uid + ':ignored:cids', 'uid:' + uid + ':flag:pids',
- 'uid:' + uid + ':sessions', 'uid:' + uid + ':sessionUUID:sessionId'
+ 'uid:' + uid + ':sessions', 'uid:' + uid + ':sessionUUID:sessionId',
];
db.deleteAll(keys, next);
},
@@ -135,12 +135,12 @@ module.exports = function (User) {
},
function (next) {
groups.leaveAllGroups(uid, next);
- }
+ },
], next);
},
function (results, next) {
db.deleteAll(['followers:' + uid, 'following:' + uid, 'user:' + uid], next);
- }
+ },
], callback);
};
@@ -149,7 +149,7 @@ module.exports = function (User) {
function (next) {
async.parallel({
upvotedPids: async.apply(db.getSortedSetRange, 'uid:' + uid + ':upvote', 0, -1),
- downvotedPids: async.apply(db.getSortedSetRange, 'uid:' + uid + ':downvote', 0, -1)
+ downvotedPids: async.apply(db.getSortedSetRange, 'uid:' + uid + ':downvote', 0, -1),
}, next);
},
function (pids, next) {
@@ -160,7 +160,7 @@ module.exports = function (User) {
async.eachSeries(pids, function (pid, next) {
posts.unvote(pid, uid, next);
}, next);
- }
+ },
], function (err) {
callback(err);
});
@@ -181,9 +181,9 @@ module.exports = function (User) {
async.parallel([
async.apply(db.sortedSetsRemove, roomKeys, uid),
- async.apply(db.deleteAll, userKeys)
+ async.apply(db.deleteAll, userKeys),
], next);
- }
+ },
], function (err) {
callback(err);
});
@@ -202,14 +202,14 @@ module.exports = function (User) {
},
function (next) {
db.delete('uid:' + uid + ':ip', next);
- }
+ },
], callback);
}
function deleteUserFromFollowers(uid, callback) {
async.parallel({
followers: async.apply(db.getSortedSetRange, 'followers:' + uid, 0, -1),
- following: async.apply(db.getSortedSetRange, 'following:' + uid, 0, -1)
+ following: async.apply(db.getSortedSetRange, 'following:' + uid, 0, -1),
}, function (err, results) {
function updateCount(uids, name, fieldName, next) {
async.each(uids, function (uid, next) {
@@ -238,7 +238,7 @@ module.exports = function (User) {
async.parallel([
async.apply(db.sortedSetsRemove, followerSets.concat(followingSets), uid),
async.apply(updateCount, results.following, 'followers:', 'followerCount'),
- async.apply(updateCount, results.followers, 'following:', 'followingCount')
+ async.apply(updateCount, results.followers, 'following:', 'followingCount'),
], callback);
});
}
diff --git a/src/user/digest.js b/src/user/digest.js
index 9c86aca26d..b4de94efb6 100644
--- a/src/user/digest.js
+++ b/src/user/digest.js
@@ -31,7 +31,7 @@ var utils = require('../../public/src/utils');
function (next) {
async.parallel({
topics: async.apply(topics.getLatestTopics, 0, 0, 9, interval),
- subscribers: async.apply(Digest.getSubscribers, interval)
+ subscribers: async.apply(Digest.getSubscribers, interval),
}, next);
},
function (data, next) {
@@ -52,7 +52,7 @@ var utils = require('../../public/src/utils');
data.interval = interval;
Digest.send(data, next);
- }
+ },
], function (err) {
if (err) {
winston.error('[user/jobs] Could not send digests (' + interval + '): ' + err.message);
@@ -72,12 +72,12 @@ var utils = require('../../public/src/utils');
function (subscribers, next) {
plugins.fireHook('filter:digest.subscribers', {
interval: interval,
- subscribers: subscribers
+ subscribers: subscribers,
}, next);
},
function (results, next) {
next(null, results.subscribers);
- }
+ },
], callback);
};
@@ -118,13 +118,13 @@ var utils = require('../../public/src/utils');
site_title: meta.config.title || meta.config.browserTitle || 'NodeBB',
notifications: notifications,
recent: data.topics.topics,
- interval: data.interval
+ interval: data.interval,
});
next();
- }
+ },
], next);
}, next);
- }
+ },
], function (err) {
callback(err);
});
diff --git a/src/user/email.js b/src/user/email.js
index 99d2d9693d..05a3db8719 100644
--- a/src/user/email.js
+++ b/src/user/email.js
@@ -53,7 +53,7 @@ var emailer = require('../emailer');
confirm_code = _confirm_code;
db.setObject('confirm:' + confirm_code, {
email: email.toLowerCase(),
- uid: uid
+ uid: uid,
}, next);
},
function (next) {
@@ -73,7 +73,7 @@ var emailer = require('../emailer');
subject: subject,
template: 'welcome',
- uid: uid
+ uid: uid,
};
if (plugins.hasListeners('action:user.verify')) {
@@ -83,7 +83,7 @@ var emailer = require('../emailer');
emailer.send('welcome', uid, data, next);
}
});
- }
+ },
], callback);
};
@@ -103,7 +103,7 @@ var emailer = require('../emailer');
},
function (next) {
plugins.fireHook('action:user.email.confirmed', {uid: confirmObj.uid, email: confirmObj.email}, next);
- }
+ },
], function (err) {
callback(err ? new Error('[[error:email-confirm-failed]]') : null);
});
diff --git a/src/user/follow.js b/src/user/follow.js
index e6c9624018..fb8033ec80 100644
--- a/src/user/follow.js
+++ b/src/user/follow.js
@@ -44,7 +44,7 @@ module.exports = function (User) {
async.apply(db.sortedSetAdd, 'following:' + uid, now, theiruid),
async.apply(db.sortedSetAdd, 'followers:' + theiruid, now, uid),
async.apply(User.incrementUserFieldBy, uid, 'followingCount', 1),
- async.apply(User.incrementUserFieldBy, theiruid, 'followerCount', 1)
+ async.apply(User.incrementUserFieldBy, theiruid, 'followerCount', 1),
], next);
} else {
if (!isFollowing) {
@@ -54,10 +54,10 @@ module.exports = function (User) {
async.apply(db.sortedSetRemove, 'following:' + uid, theiruid),
async.apply(db.sortedSetRemove, 'followers:' + theiruid, uid),
async.apply(User.decrementUserFieldBy, uid, 'followingCount', 1),
- async.apply(User.decrementUserFieldBy, theiruid, 'followerCount', 1)
+ async.apply(User.decrementUserFieldBy, theiruid, 'followerCount', 1),
], next);
}
- }
+ },
], callback);
}
@@ -82,12 +82,12 @@ module.exports = function (User) {
uids: uids,
uid: uid,
start: start,
- stop: stop
+ stop: stop,
}, next);
},
function (data, next) {
User.getUsers(data.uids, uid, next);
- }
+ },
], callback);
}
diff --git a/src/user/info.js b/src/user/info.js
index 296dd9a723..16b383340c 100644
--- a/src/user/info.js
+++ b/src/user/info.js
@@ -28,7 +28,7 @@ module.exports = function (User) {
function (_reason, next) {
reason = _reason && _reason.length ? _reason[0] : '';
next();
- }
+ },
], function (err) {
if (err) {
return callback(err);
@@ -39,7 +39,7 @@ module.exports = function (User) {
timestamp: timestamp,
expiry: parseInt(expiry, 10),
expiry_readable: new Date(parseInt(expiry, 10)).toString().replace(/:/g, '%3A'),
- reason: validator.escape(String(reason))
+ reason: validator.escape(String(reason)),
});
});
};
@@ -50,12 +50,12 @@ module.exports = function (User) {
async.parallel({
flags: async.apply(db.getSortedSetRevRangeWithScores, 'uid:' + uid + ':flag:pids', 0, 19),
bans: async.apply(db.getSortedSetRevRangeWithScores, 'uid:' + uid + ':bans', 0, 19),
- reasons: async.apply(db.getSortedSetRevRangeWithScores, 'banned:' + uid + ':reasons', 0, 19)
+ reasons: async.apply(db.getSortedSetRevRangeWithScores, 'banned:' + uid + ':reasons', 0, 19),
}, next);
},
function (data, next) {
getFlagMetadata(data, next);
- }
+ },
], function (err, data) {
if (err) {
return callback(err);
diff --git a/src/user/invite.js b/src/user/invite.js
index 1066a662ac..30c3091ade 100644
--- a/src/user/invite.js
+++ b/src/user/invite.js
@@ -37,11 +37,11 @@ module.exports = function (User) {
invitations = invitations.map(function (invites, index) {
return {
uid: uids[index],
- invitations: invites
+ invitations: invites,
};
});
next(null, invitations);
- }
+ },
], callback);
};
@@ -70,7 +70,7 @@ module.exports = function (User) {
},
function (next) {
db.setAdd('invitation:uids', uid, next);
- }
+ },
], function (err) {
next(err);
});
@@ -92,12 +92,12 @@ module.exports = function (User) {
registerLink: registerLink,
subject: subject,
username: username,
- template: 'invitation'
+ template: 'invitation',
};
emailer.sendToEmail('invitation', email, meta.config.defaultLang, data, next);
});
- }
+ },
], callback);
};
@@ -116,7 +116,7 @@ module.exports = function (User) {
}
next();
- }
+ },
], callback);
};
@@ -136,11 +136,11 @@ module.exports = function (User) {
},
function deleteInviteKey(next) {
db.delete('invitation:email:' + email, callback);
- }
+ },
], function (err) {
next(err);
});
- }
+ },
], callback);
};
diff --git a/src/user/notifications.js b/src/user/notifications.js
index 7182c1a223..74c8751d23 100644
--- a/src/user/notifications.js
+++ b/src/user/notifications.js
@@ -54,7 +54,7 @@ var privileges = require('../privileges');
},
read: function (next) {
getNotificationsFromSet('uid:' + uid + ':notifications:read', true, uid, start, stop, next);
- }
+ },
}, callback);
}
@@ -89,7 +89,7 @@ var privileges = require('../privileges');
}
notifications.merge(notifs, next);
- }
+ },
], callback);
}
@@ -137,7 +137,7 @@ var privileges = require('../privileges');
});
db.getObjectsFields(keys, ['mergeId'], next);
- }
+ },
], function (err, mergeIds) {
// A missing (null) mergeId means that notification is counted separately.
mergeIds = mergeIds.map(function (set) {
@@ -195,7 +195,7 @@ var privileges = require('../privileges');
},
function (next) {
db.delete('uid:' + uid + ':notifications:read', next);
- }
+ },
], callback);
};
@@ -229,9 +229,9 @@ var privileges = require('../privileges');
path: '/post/' + postData.pid,
nid: 'tid:' + postData.tid + ':uid:' + uid,
tid: postData.tid,
- from: uid
+ from: uid,
}, next);
- }
+ },
], function (err, notification) {
if (err) {
return winston.error(err);
@@ -254,7 +254,7 @@ var privileges = require('../privileges');
notifications.create({
bodyShort: meta.config.welcomeNotification,
path: path,
- nid: 'welcome_' + uid
+ nid: 'welcome_' + uid,
}, function (err, notification) {
if (err || !notification) {
return callback(err);
@@ -269,7 +269,7 @@ var privileges = require('../privileges');
bodyShort: '[[user:username_taken_workaround, ' + username + ']]',
image: 'brand:logo',
nid: 'username_taken:' + uid,
- datetime: Date.now()
+ datetime: Date.now(),
}, function (err, notification) {
if (!err && notification) {
notifications.push(notification, uid);
diff --git a/src/user/password.js b/src/user/password.js
index 8e9b7780e3..093f11a56f 100644
--- a/src/user/password.js
+++ b/src/user/password.js
@@ -34,7 +34,7 @@ module.exports = function (User) {
Password.compare(password, hashedPassword, next);
});
- }
+ },
], callback);
};
diff --git a/src/user/picture.js b/src/user/picture.js
index bc0b8f597f..1d5653c371 100644
--- a/src/user/picture.js
+++ b/src/user/picture.js
@@ -67,7 +67,7 @@ module.exports = function (User) {
}
async.series([
async.apply(image.normalise, picture.path, extension),
- async.apply(fs.rename, picture.path + '.png', picture.path)
+ async.apply(fs.rename, picture.path + '.png', picture.path),
], function (err) {
next(err);
});
@@ -83,7 +83,7 @@ module.exports = function (User) {
},
function (next) {
next(null, uploadedImage);
- }
+ },
], callback);
};
@@ -153,20 +153,20 @@ module.exports = function (User) {
md5sum = md5sum.digest('hex');
data.file = {
- path: path.join(os.tmpdir(), md5sum)
+ path: path.join(os.tmpdir(), md5sum),
};
var buffer = new Buffer(data.imageData.slice(data.imageData.indexOf('base64') + 7), 'base64');
fs.writeFile(data.file.path, buffer, {
- encoding: 'base64'
+ encoding: 'base64',
}, next);
},
function (next) {
var image = {
name: 'profileCover',
path: data.file.path,
- uid: data.uid
+ uid: data.uid,
};
if (plugins.hasListeners('filter:uploadImage')) {
@@ -184,9 +184,9 @@ module.exports = function (User) {
function (upload, next) {
next(null, {
url: nconf.get('relative_path') + upload.url,
- name: image.name
+ name: image.name,
});
- }
+ },
], next);
},
function (uploadData, next) {
@@ -200,7 +200,7 @@ module.exports = function (User) {
}
next();
});
- }
+ },
], function (err) {
if (err) {
return fs.unlink(data.file.path, function (unlinkErr) {
@@ -243,20 +243,20 @@ module.exports = function (User) {
md5sum = md5sum.digest('hex');
data.file = {
- path: path.join(os.tmpdir(), md5sum)
+ path: path.join(os.tmpdir(), md5sum),
};
var buffer = new Buffer(data.imageData.slice(data.imageData.indexOf('base64') + 7), 'base64');
fs.writeFile(data.file.path, buffer, {
- encoding: 'base64'
+ encoding: 'base64',
}, next);
},
function (next) {
var image = {
name: 'profileAvatar',
path: data.file.path,
- uid: data.uid
+ uid: data.uid,
};
if (plugins.hasListeners('filter:uploadImage')) {
@@ -274,9 +274,9 @@ module.exports = function (User) {
function (upload, next) {
next(null, {
url: nconf.get('relative_path') + upload.url,
- name: image.name
+ name: image.name,
});
- }
+ },
], next);
},
function (uploadData, next) {
@@ -290,7 +290,7 @@ module.exports = function (User) {
}
next();
});
- }
+ },
], function (err) {
if (err) {
callback(err); // send back the original error
diff --git a/src/user/posts.js b/src/user/posts.js
index 37b5e92b16..7b7cc7cfbb 100644
--- a/src/user/posts.js
+++ b/src/user/posts.js
@@ -21,7 +21,7 @@ module.exports = function (User) {
},
isAdminOrMod: function (next) {
privileges.categories.isAdminOrMod(cid, uid, next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -75,7 +75,7 @@ module.exports = function (User) {
},
function (next) {
User.updateLastOnlineTime(postData.uid, next);
- }
+ },
], callback);
};
diff --git a/src/user/profile.js b/src/user/profile.js
index 37b280612f..90df742d8e 100644
--- a/src/user/profile.js
+++ b/src/user/profile.js
@@ -29,7 +29,7 @@ module.exports = function (User) {
async.apply(isSignatureValid, data),
async.apply(isEmailAvailable, data, uid),
async.apply(isUsernameAvailable, data, uid),
- async.apply(isGroupTitleValid, data)
+ async.apply(isGroupTitleValid, data),
], function (err) {
next(err);
});
@@ -58,7 +58,7 @@ module.exports = function (User) {
function (next) {
plugins.fireHook('action:user.updateProfile', {data: data, uid: uid});
User.getUserFields(uid, ['email', 'username', 'userslug', 'picture', 'icon:text', 'icon:bgColor'], next);
- }
+ },
], callback);
};
@@ -99,7 +99,7 @@ module.exports = function (User) {
},
function (available, next) {
next(!available ? new Error('[[error:email-taken]]') : null);
- }
+ },
], callback);
}
@@ -134,7 +134,7 @@ module.exports = function (User) {
},
function (exists, next) {
next(exists ? new Error('[[error:username-taken]]') : null);
- }
+ },
], callback);
}
@@ -159,7 +159,7 @@ module.exports = function (User) {
}
async.series([
async.apply(db.sortedSetRemove, 'email:uid', oldEmail.toLowerCase()),
- async.apply(db.sortedSetRemove, 'email:sorted', oldEmail.toLowerCase() + ':' + uid)
+ async.apply(db.sortedSetRemove, 'email:sorted', oldEmail.toLowerCase() + ':' + uid),
], function (err) {
next(err);
});
@@ -186,11 +186,11 @@ module.exports = function (User) {
},
function (next) {
db.sortedSetAdd('users:notvalidated', Date.now(), uid, next);
- }
+ },
], function (err) {
next(err);
});
- }
+ },
], callback);
}
@@ -216,7 +216,7 @@ module.exports = function (User) {
async.series([
async.apply(db.sortedSetRemove, 'username:sorted', userData.username.toLowerCase() + ':' + uid),
async.apply(db.sortedSetAdd, 'username:sorted', 0, newUsername.toLowerCase() + ':' + uid),
- async.apply(db.sortedSetAdd, 'user:' + uid + ':usernames', Date.now(), newUsername + ':' + Date.now())
+ async.apply(db.sortedSetAdd, 'user:' + uid + ':usernames', Date.now(), newUsername + ':' + Date.now()),
], next);
},
], callback);
@@ -241,7 +241,7 @@ module.exports = function (User) {
} else {
next();
}
- }
+ },
], callback);
}
@@ -252,7 +252,7 @@ module.exports = function (User) {
},
function (fullname, next) {
updateUidMapping('fullname', uid, newFullname, fullname, next);
- }
+ },
], callback);
}
@@ -282,11 +282,11 @@ module.exports = function (User) {
function (hashedPassword, next) {
async.parallel([
async.apply(User.setUserField, data.uid, 'password', hashedPassword),
- async.apply(User.reset.updateExpiry, data.uid)
+ async.apply(User.reset.updateExpiry, data.uid),
], function (err) {
next(err);
});
- }
+ },
], callback);
};
};
diff --git a/src/user/reset.js b/src/user/reset.js
index 39bf1f0e07..dc484d1825 100644
--- a/src/user/reset.js
+++ b/src/user/reset.js
@@ -28,7 +28,7 @@ var async = require('async'),
},
function (issueDate, next) {
next(null, parseInt(issueDate, 10) > Date.now() - twoHours);
- }
+ },
], callback);
};
@@ -36,7 +36,7 @@ var async = require('async'),
var code = utils.generateUUID();
async.parallel([
async.apply(db.setObjectField, 'reset:uid', code, uid),
- async.apply(db.sortedSetAdd, 'reset:issueDate', Date.now(), code)
+ async.apply(db.sortedSetAdd, 'reset:issueDate', Date.now(), code),
], function (err) {
callback(err, code);
});
@@ -52,7 +52,7 @@ var async = require('async'),
return next(new Error('[[error:cant-reset-password-more-than-once-a-minute]]'));
}
next();
- }
+ },
], callback);
}
@@ -88,9 +88,9 @@ var async = require('async'),
reset_link: reset_link,
subject: subject,
template: 'reset',
- uid: uid
+ uid: uid,
}, next);
- }
+ },
], callback);
};
@@ -124,9 +124,9 @@ var async = require('async'),
async.apply(db.sortedSetRemove, 'reset:issueDate', code),
async.apply(db.sortedSetRemove, 'reset:issueDate:uid', uid),
async.apply(user.reset.updateExpiry, uid),
- async.apply(user.auth.resetLockout, uid)
+ async.apply(user.auth.resetLockout, uid),
], next);
- }
+ },
], callback);
};
@@ -148,7 +148,7 @@ var async = require('async'),
},
uids: function (next) {
db.getSortedSetRangeByScore('reset:issueDate:uid', 0, -1, '-inf', Date.now() - twoHours, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -160,9 +160,9 @@ var async = require('async'),
async.parallel([
async.apply(db.deleteObjectFields, 'reset:uid', results.tokens),
async.apply(db.sortedSetRemove, 'reset:issueDate', results.tokens),
- async.apply(db.sortedSetRemove, 'reset:issueDate:uid', results.uids)
+ async.apply(db.sortedSetRemove, 'reset:issueDate:uid', results.uids),
], next);
- }
+ },
], callback);
};
diff --git a/src/user/search.js b/src/user/search.js
index 65d0e41a6a..ee20b48c39 100644
--- a/src/user/search.js
+++ b/src/user/search.js
@@ -54,7 +54,7 @@ module.exports = function (User) {
searchResult.timing = (process.elapsedTimeSince(startTime) / 1000).toFixed(2);
searchResult.users = userData;
next(null, searchResult);
- }
+ },
], callback);
};
@@ -158,7 +158,7 @@ module.exports = function (User) {
var diff = process.hrtime(start);
var timing = (diff[0] * 1e3 + diff[1] / 1e6).toFixed(1);
next(null, {timing: timing, users: users});
- }
+ },
], callback);
}
};
diff --git a/src/user/settings.js b/src/user/settings.js
index 3d93a9724a..9d423f4084 100644
--- a/src/user/settings.js
+++ b/src/user/settings.js
@@ -124,7 +124,7 @@ module.exports = function (User) {
scrollToMyPost: data.scrollToMyPost,
notificationSound: data.notificationSound,
incomingChatSound: data.incomingChatSound,
- outgoingChatSound: data.outgoingChatSound
+ outgoingChatSound: data.outgoingChatSound,
};
if (data.bootswatchSkin) {
@@ -140,7 +140,7 @@ module.exports = function (User) {
},
function (next) {
User.getSettings(uid, next);
- }
+ },
], callback);
};
@@ -155,7 +155,7 @@ module.exports = function (User) {
} else {
next();
}
- }
+ },
], callback);
};
diff --git a/src/user/topics.js b/src/user/topics.js
index 53dade36e9..5dd2ac2c5a 100644
--- a/src/user/topics.js
+++ b/src/user/topics.js
@@ -12,7 +12,7 @@ module.exports = function (User) {
User.addTopicIdToUser = function (uid, tid, timestamp, callback) {
async.parallel([
async.apply(db.sortedSetAdd, 'uid:' + uid + ':topics', timestamp, tid),
- async.apply(User.incrementUserFieldBy, uid, 'topiccount', 1)
+ async.apply(User.incrementUserFieldBy, uid, 'topiccount', 1),
], callback);
};
diff --git a/src/webserver.js b/src/webserver.js
index ee2605cdb2..cf2d97b39f 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -33,7 +33,7 @@ var helpers = require('../public/src/modules/helpers');
if (nconf.get('ssl')) {
server = require('https').createServer({
key: fs.readFileSync(nconf.get('ssl').key),
- cert: fs.readFileSync(nconf.get('ssl').cert)
+ cert: fs.readFileSync(nconf.get('ssl').cert),
}, app);
} else {
server = require('http').createServer(app);
@@ -69,7 +69,7 @@ module.exports.listen = function (callback) {
winston.info('NodeBB Ready');
require('./socket.io').server.emit('event:nodebb.ready', {
- 'cache-buster': meta.config['cache-buster']
+ 'cache-buster': meta.config['cache-buster'],
});
plugins.fireHook('action:nodebb.ready');
@@ -91,7 +91,7 @@ function initializeNodeBB(callback) {
function (next) {
plugins.fireHook('static:app.preload', {
app: app,
- middleware: middleware
+ middleware: middleware,
}, next);
},
function (next) {
@@ -105,9 +105,9 @@ function initializeNodeBB(callback) {
async.series([
async.apply(meta.sounds.init),
async.apply(languages.init),
- async.apply(meta.blacklist.load)
+ async.apply(meta.blacklist.load),
], next);
- }
+ },
], callback);
}
@@ -146,7 +146,7 @@ function setupExpressApp(app) {
key: nconf.get('sessionKey'),
cookie: setupCookie(),
resave: true,
- saveUninitialized: true
+ saveUninitialized: true,
}));
app.use(middleware.addHeaders);
@@ -171,7 +171,7 @@ function setupCookie() {
var ttl = ttlSeconds || ttlDays || 1209600000; // Default to 14 days
var cookie = {
- maxAge: ttl
+ maxAge: ttl,
};
if (nconf.get('cookieDomain') || meta.config.cookieDomain) {
diff --git a/src/widgets/admin.js b/src/widgets/admin.js
index ecfd73b750..e92df2e154 100644
--- a/src/widgets/admin.js
+++ b/src/widgets/admin.js
@@ -17,7 +17,7 @@ admin.get = function (callback) {
{ name: 'Global Footer', template: 'global', location: 'footer' },
{ name: 'Group Page (Left)', template: 'groups/details.tpl', location: 'left'},
- { name: 'Group Page (Right)', template: 'groups/details.tpl', location: 'right'}
+ { name: 'Group Page (Right)', template: 'groups/details.tpl', location: 'right'},
];
plugins.fireHook('filter:widgets.getAreas', defaultAreas, next);
@@ -27,7 +27,7 @@ admin.get = function (callback) {
},
adminTemplate: function (next) {
fs.readFile(path.resolve(nconf.get('views_dir'), 'admin/partials/widget-settings.tpl'), 'utf8', next);
- }
+ },
}, function (err, widgetData) {
if (err) {
return callback(err);
@@ -56,7 +56,7 @@ admin.get = function (callback) {
list[area.template] = index;
templates.push({
template: area.template,
- areas: []
+ areas: [],
});
index++;
@@ -64,14 +64,14 @@ admin.get = function (callback) {
templates[list[area.template]].areas.push({
name: area.name,
- location: area.location
+ location: area.location,
});
});
callback(false, {
templates: templates,
areas: widgetData.areas,
- widgets: widgetData.widgets
+ widgets: widgetData.widgets,
});
});
});
diff --git a/src/widgets/index.js b/src/widgets/index.js
index eac58e46e3..5d46b42416 100644
--- a/src/widgets/index.js
+++ b/src/widgets/index.js
@@ -42,7 +42,7 @@ widgets.render = function (uid, area, req, res, callback) {
area: area,
data: widget.data,
req: req,
- res: res
+ res: res,
}, function (err, html) {
if (err || html === null) {
return next(err);
@@ -56,7 +56,7 @@ widgets.render = function (uid, area, req, res, callback) {
translator.translate(widget.data.title, function (title) {
html = templates.parse(widget.data.container, {
title: title,
- body: html
+ body: html,
});
next(null, {html: html});
@@ -133,7 +133,7 @@ widgets.reset = function (callback) {
var defaultAreas = [
{ name: 'Draft Zone', template: 'global', location: 'header' },
{ name: 'Draft Zone', template: 'global', location: 'footer' },
- { name: 'Draft Zone', template: 'global', location: 'sidebar' }
+ { name: 'Draft Zone', template: 'global', location: 'sidebar' },
];
async.parallel({
@@ -142,7 +142,7 @@ widgets.reset = function (callback) {
},
drafts: function (next) {
widgets.getArea('global', 'drafts', next);
- }
+ },
}, function (err, results) {
if (err) {
return callback(err);
@@ -167,7 +167,7 @@ widgets.reset = function (callback) {
widgets.setArea({
template: 'global',
location: 'drafts',
- widgets: drafts
+ widgets: drafts,
}, callback);
});
});
diff --git a/test/authentication.js b/test/authentication.js
index fb26e0bfbf..815070d660 100644
--- a/test/authentication.js
+++ b/test/authentication.js
@@ -23,7 +23,7 @@ describe('authentication', function () {
request({
url: nconf.get('url') + '/api/config',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
@@ -36,8 +36,8 @@ describe('authentication', function () {
json: true,
jar: jar,
headers: {
- 'x-csrf-token': body.csrf_token
- }
+ 'x-csrf-token': body.csrf_token,
+ },
}, function (err, response, body) {
assert.ifError(err);
assert(body);
@@ -45,7 +45,7 @@ describe('authentication', function () {
request({
url: nconf.get('url') + '/api/me',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
assert(body);
@@ -61,7 +61,7 @@ describe('authentication', function () {
request({
url: nconf.get('url') + '/api/config',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
@@ -70,15 +70,15 @@ describe('authentication', function () {
json: true,
jar: jar,
headers: {
- 'x-csrf-token': body.csrf_token
- }
+ 'x-csrf-token': body.csrf_token,
+ },
}, function (err) {
assert.ifError(err);
request({
url: nconf.get('url') + '/api/me',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
assert.equal(body, 'not-authorized');
@@ -93,7 +93,7 @@ describe('authentication', function () {
request({
url: nconf.get('url') + '/api/config',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
@@ -105,8 +105,8 @@ describe('authentication', function () {
json: true,
jar: jar,
headers: {
- 'x-csrf-token': body.csrf_token
- }
+ 'x-csrf-token': body.csrf_token,
+ },
}, function (err, response, body) {
assert.ifError(err);
assert(body);
@@ -114,7 +114,7 @@ describe('authentication', function () {
request({
url: nconf.get('url') + '/api/me',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
assert.ifError(err);
assert(body);
diff --git a/test/categories.js b/test/categories.js
index e0e035410b..8795548577 100644
--- a/test/categories.js
+++ b/test/categories.js
@@ -27,7 +27,7 @@ describe('Categories', function () {
},
adminUid: function (next) {
User.create({username: 'admin'}, next);
- }
+ },
}, function (err, results) {
assert.ifError(err);
posterUid = results.posterUid;
@@ -44,7 +44,7 @@ describe('Categories', function () {
description: 'Test category created by testing script',
icon: 'fa-check',
blockclass: 'category-blue',
- order: '5'
+ order: '5',
}, function (err, category) {
assert.ifError(err);
@@ -60,7 +60,7 @@ describe('Categories', function () {
reverse: true,
start: 0,
stop: -1,
- uid: 0
+ uid: 0,
}, function (err, categoryData) {
assert.equal(err, null);
@@ -90,7 +90,7 @@ describe('Categories', function () {
reverse: true,
start: 0,
stop: -1,
- uid: 0
+ uid: 0,
}, function (err, categoryData) {
assert.ifError(err);
Categories.getRecentTopicReplies(categoryData, 0, function (err) {
@@ -109,7 +109,7 @@ describe('Categories', function () {
reverse: true,
start: 0,
stop: 10,
- uid: 0
+ uid: 0,
}, function (err, result) {
assert.equal(err, null);
@@ -130,7 +130,7 @@ describe('Categories', function () {
start: 0,
stop: 10,
uid: 0,
- targetUid: 1
+ targetUid: 1,
}, function (err, result) {
assert.equal(err, null);
assert(Array.isArray(result.topics));
@@ -151,7 +151,7 @@ describe('Categories', function () {
category: function (next) {
Categories.create({
name: 'Test Category 2',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
topic: function (next) {
@@ -159,9 +159,9 @@ describe('Categories', function () {
uid: posterUid,
cid: categoryObj.cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
}, next);
- }
+ },
}, function (err, results) {
if (err) {
return done(err);
@@ -199,7 +199,7 @@ describe('Categories', function () {
cid: categoryObj.cid,
title: 'Test Topic Title',
content: 'The content of test topic',
- tags: ['nodebb']
+ tags: ['nodebb'],
}, done);
});
@@ -318,7 +318,7 @@ describe('Categories', function () {
description: 'update description',
parentCid: categoryObj.cid,
icon: 'fa-check',
- order: '5'
+ order: '5',
}, function (err, category) {
assert.ifError(err);
@@ -337,7 +337,7 @@ describe('Categories', function () {
it('should error if you try to set parent as self', function (done) {
var updateData = {};
updateData[cid] = {
- parentCid: cid
+ parentCid: cid,
};
socketCategories.update({uid: adminUid}, updateData, function (err) {
assert.equal(err.message, '[[error:cant-set-self-as-parent]]');
@@ -352,7 +352,7 @@ describe('Categories', function () {
description: 'new description',
parentCid: 0,
order: 3,
- icon: 'fa-hammer'
+ icon: 'fa-hammer',
};
socketCategories.update({uid: adminUid}, updateData, function (err) {
assert.ifError(err);
@@ -371,14 +371,14 @@ describe('Categories', function () {
it('should purge category', function (done) {
Categories.create({
name: 'purge me',
- description: 'update description'
+ description: 'update description',
}, function (err, category) {
assert.ifError(err);
Topics.post({
uid: posterUid,
cid: category.cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
}, function (err) {
assert.ifError(err);
socketCategories.purge({uid: adminUid}, category.cid, function (err) {
@@ -464,7 +464,7 @@ describe('Categories', function () {
function (canDelete, next) {
assert(canDelete);
next();
- }
+ },
], done);
});
@@ -489,7 +489,7 @@ describe('Categories', function () {
function (description, next) {
assert.equal(description, 'copy me');
next();
- }
+ },
], done);
});
@@ -517,21 +517,21 @@ describe('Categories', function () {
function (canDelete, next) {
assert(canDelete);
next();
- }
+ },
], done);
});
});
it('should get active users', function (done) {
Categories.create({
- name: 'test'
+ name: 'test',
}, function (err, category) {
assert.ifError(err);
Topics.post({
uid: posterUid,
cid: category.cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
}, function (err) {
assert.ifError(err);
Categories.getActiveUsers(category.cid, function (err, uids) {
@@ -548,7 +548,7 @@ describe('Categories', function () {
var socketTopics = require('../src/socket.io/topics');
before(function (done) {
Categories.create({
- name: 'test'
+ name: 'test',
}, function (err, category) {
assert.ifError(err);
cid = category.cid;
@@ -574,7 +574,7 @@ describe('Categories', function () {
it('should add tags to category whitelist', function (done) {
var data = {};
data[cid] = {
- tagWhitelist: 'nodebb,jquery,javascript'
+ tagWhitelist: 'nodebb,jquery,javascript',
};
Categories.update(data, function (err) {
assert.ifError(err);
@@ -608,7 +608,7 @@ describe('Categories', function () {
cid: cid,
title: 'Test Topic Title',
content: 'The content of test topic',
- tags: ['nodebb', 'jquery', 'notallowed']
+ tags: ['nodebb', 'jquery', 'notallowed'],
}, function (err, data) {
assert.ifError(err);
assert.equal(data.topicData.tags.length, 2);
diff --git a/test/controllers-admin.js b/test/controllers-admin.js
index 41ffacca29..4102446f96 100644
--- a/test/controllers-admin.js
+++ b/test/controllers-admin.js
@@ -26,7 +26,7 @@ describe('Admin Controllers', function () {
category: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
adminUid: function (next) {
@@ -34,7 +34,7 @@ describe('Admin Controllers', function () {
},
regularUid: function (next) {
user.create({username: 'regular'}, next);
- }
+ },
}, function (err, results) {
if (err) {
return done(err);
diff --git a/test/controllers.js b/test/controllers.js
index 54578f76c3..42496db702 100644
--- a/test/controllers.js
+++ b/test/controllers.js
@@ -24,12 +24,12 @@ describe('Controllers', function () {
category: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
user: function (next) {
user.create({username: 'foo', password: 'barbar'}, next);
- }
+ },
}, function (err, results) {
if (err) {
return done(err);
@@ -438,7 +438,7 @@ describe('Controllers', function () {
groups.create({
name: 'group-details',
description: 'Foobar!',
- hidden: 0
+ hidden: 0,
}, function (err) {
assert.ifError(err);
request(nconf.get('url') + '/groups/group-details', function (err, res, body) {
@@ -464,7 +464,7 @@ describe('Controllers', function () {
groups.create({
name: 'hidden-group',
description: 'Foobar!',
- hidden: 1
+ hidden: 1,
}, function (err) {
assert.ifError(err);
request(nconf.get('url') + '/groups/hidden-group/members', function (err, res, body) {
@@ -525,8 +525,8 @@ describe('Controllers', function () {
request.del(nconf.get('url') + '/api/user/revokeme/session', {
jar: jar,
headers: {
- 'x-csrf-token': csrf_token
- }
+ 'x-csrf-token': csrf_token,
+ },
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 404);
@@ -538,8 +538,8 @@ describe('Controllers', function () {
request.del(nconf.get('url') + '/api/user/doesnotexist/session/1112233', {
jar: jar,
headers: {
- 'x-csrf-token': csrf_token
- }
+ 'x-csrf-token': csrf_token,
+ },
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 403);
@@ -558,8 +558,8 @@ describe('Controllers', function () {
request.del(nconf.get('url') + '/api/user/revokeme/session/' + sessionObj.meta.uuid, {
jar: jar,
headers: {
- 'x-csrf-token': csrf_token
- }
+ 'x-csrf-token': csrf_token,
+ },
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 200);
@@ -591,15 +591,15 @@ describe('Controllers', function () {
data: {
html: 'test',
title: '',
- container: ''
- }
- } ]
- }
- ]
+ container: '',
+ },
+ } ],
+ },
+ ],
};
widgets.setArea(data, next);
- }
+ },
], done);
});
@@ -632,7 +632,7 @@ describe('Controllers', function () {
title: 'topic title',
content: 'test topic content',
cid: cid,
- tags: ['nodebb', 'bug', 'test']
+ tags: ['nodebb', 'bug', 'test'],
}, function (err, result) {
assert.ifError(err);
tid = result.topicData.tid;
@@ -806,7 +806,7 @@ describe('Controllers', function () {
tid: 1,
from: fooUid,
mergeId: 'notifications:user_posted_to|' + 1,
- topicTitle: 'topic title'
+ topicTitle: 'topic title',
};
async.waterfall([
function (next) {
@@ -831,7 +831,7 @@ describe('Controllers', function () {
assert.equal(notif.path, notifData.path);
assert.equal(notif.nid, notifData.nid);
next();
- }
+ },
], done);
});
});
diff --git a/test/database/hash.js b/test/database/hash.js
index 811f5254e7..266e8cbdae 100644
--- a/test/database/hash.js
+++ b/test/database/hash.js
@@ -9,7 +9,7 @@ describe('Hash methods', function () {
var testData = {
name: 'baris',
lastname: 'usakli',
- age: 99
+ age: 99,
};
beforeEach(function (done) {
@@ -87,7 +87,7 @@ describe('Hash methods', function () {
before(function (done) {
async.parallel([
async.apply(db.setObject, 'testObject4', {name: 'baris'}),
- async.apply(db.setObjectField, 'testObject5', 'name', 'ginger')
+ async.apply(db.setObjectField, 'testObject5', 'name', 'ginger'),
], done);
});
@@ -162,7 +162,7 @@ describe('Hash methods', function () {
before(function (done) {
async.parallel([
async.apply(db.setObject, 'testObject8', {name: 'baris', age:99}),
- async.apply(db.setObject, 'testObject9', {name: 'ginger', age: 3})
+ async.apply(db.setObject, 'testObject9', {name: 'ginger', age: 3}),
], done);
});
@@ -299,7 +299,7 @@ describe('Hash methods', function () {
assert.equal(arguments.length, 1);
async.parallel({
delete1: async.apply(db.isObjectField, 'testObject10', 'delete1'),
- delete2: async.apply(db.isObjectField, 'testObject10', 'delete2')
+ delete2: async.apply(db.isObjectField, 'testObject10', 'delete2'),
}, function (err, results) {
assert.ifError(err);
assert.equal(results.delete1, false);
diff --git a/test/database/keys.js b/test/database/keys.js
index 430ceebdb5..602731241f 100644
--- a/test/database/keys.js
+++ b/test/database/keys.js
@@ -78,7 +78,7 @@ describe('Key methods', function () {
},
function (next) {
db.set('key2', 'value2', next);
- }
+ },
], function (err) {
if (err) {
return done(err);
@@ -92,7 +92,7 @@ describe('Key methods', function () {
},
key2exists: function (next) {
db.exists('key2', next);
- }
+ },
}, function (err, results) {
assert.equal(err, null);
assert.equal(results.key1exists, false);
diff --git a/test/database/list.js b/test/database/list.js
index cbac21984f..09528a00fe 100644
--- a/test/database/list.js
+++ b/test/database/list.js
@@ -33,7 +33,7 @@ describe('List methods', function () {
},
function (next) {
db.listPrepend('testList2', 1, next);
- }
+ },
], function (err) {
assert.equal(err, null);
done();
@@ -52,7 +52,7 @@ describe('List methods', function () {
},
function (next) {
db.listAppend('testList4', 5, next);
- }
+ },
], done);
});
@@ -94,7 +94,7 @@ describe('List methods', function () {
},
function (next) {
db.listPrepend('testList4', 9, next);
- }
+ },
], done);
});
@@ -115,7 +115,7 @@ describe('List methods', function () {
async.apply(db.listAppend, 'testList5', 1),
async.apply(db.listAppend, 'testList5', 1),
async.apply(db.listAppend, 'testList5', 2),
- async.apply(db.listAppend, 'testList5', 5)
+ async.apply(db.listAppend, 'testList5', 5),
], done);
});
diff --git a/test/database/sets.js b/test/database/sets.js
index aa3eda0c3d..a753de9eae 100644
--- a/test/database/sets.js
+++ b/test/database/sets.js
@@ -157,7 +157,7 @@ describe('Set methods', function () {
async.parallel([
async.apply(db.setAdd, 'set5', [1,2,3,4,5]),
async.apply(db.setAdd, 'set6', 1),
- async.apply(db.setAdd, 'set7', 2)
+ async.apply(db.setAdd, 'set7', 2),
], done);
});
diff --git a/test/database/sorted.js b/test/database/sorted.js
index ac95fcbe09..f3c7c297f9 100644
--- a/test/database/sorted.js
+++ b/test/database/sorted.js
@@ -20,7 +20,7 @@ describe('Sorted Set methods', function () {
},
function (next) {
db.sortedSetAdd('sortedSetLex', [0, 0, 0, 0], ['a', 'b', 'c', 'd'], next);
- }
+ },
], done);
});
@@ -565,7 +565,7 @@ describe('Sorted Set methods', function () {
},
function (next) {
db.sortedSetAdd('interSet2', [4,5,6], ['value2', 'value3', 'value5'], next);
- }
+ },
], done);
});
@@ -573,7 +573,7 @@ describe('Sorted Set methods', function () {
db.getSortedSetIntersect({
sets: ['interSet1', 'interSet2'],
start: 0,
- stop: -1
+ stop: -1,
}, function (err, data) {
assert.ifError(err);
assert.deepEqual(['value2', 'value3'], data);
@@ -586,7 +586,7 @@ describe('Sorted Set methods', function () {
sets: ['interSet1', 'interSet2'],
start: 0,
stop: -1,
- withScores: true
+ withScores: true,
}, function (err, data) {
assert.ifError(err);
assert.deepEqual([{value: 'value2', score: 6}, {value: 'value3', score: 8}], data);
@@ -600,7 +600,7 @@ describe('Sorted Set methods', function () {
start: 0,
stop: -1,
withScores: true,
- aggregate: 'MIN'
+ aggregate: 'MIN',
}, function (err, data) {
assert.ifError(err);
assert.deepEqual([{value: 'value2', score: 2}, {value: 'value3', score: 3}], data);
@@ -614,7 +614,7 @@ describe('Sorted Set methods', function () {
start: 0,
stop: -1,
withScores: true,
- aggregate: 'MAX'
+ aggregate: 'MAX',
}, function (err, data) {
assert.ifError(err);
assert.deepEqual([{value: 'value2', score: 4}, {value: 'value3', score: 5}], data);
@@ -628,7 +628,7 @@ describe('Sorted Set methods', function () {
start: 0,
stop: -1,
withScores: true,
- weights: [1, 0.5]
+ weights: [1, 0.5],
}, function (err, data) {
assert.ifError(err);
assert.deepEqual([{value: 'value2', score: 4}, {value: 'value3', score: 5.5}], data);
@@ -640,7 +640,7 @@ describe('Sorted Set methods', function () {
db.getSortedSetIntersect({
sets: ['interSet10', 'interSet12'],
start: 0,
- stop: -1
+ stop: -1,
}, function (err, data) {
assert.ifError(err);
assert.equal(data.length, 0);
@@ -652,7 +652,7 @@ describe('Sorted Set methods', function () {
db.getSortedSetIntersect({
sets: ['interSet1', 'interSet12'],
start: 0,
- stop: -1
+ stop: -1,
}, function (err, data) {
assert.ifError(err);
assert.equal(data.length, 0);
@@ -676,7 +676,7 @@ describe('Sorted Set methods', function () {
},
function (next) {
db.sortedSetAdd('interCard4', [0, 0, 0], ['value4', 'value5', 'value6'], next);
- }
+ },
], done);
});
diff --git a/test/groups.js b/test/groups.js
index 81d37ed833..1428c4e6ef 100644
--- a/test/groups.js
+++ b/test/groups.js
@@ -20,7 +20,7 @@ describe('Groups', function () {
// Create a group to play around with
Groups.create({
name: 'Test',
- description: 'Foobar!'
+ description: 'Foobar!',
}, next);
},
function (next) {
@@ -28,7 +28,7 @@ describe('Groups', function () {
name: 'PrivateNoJoin',
description: 'Private group',
private: 1,
- disableJoinRequests: 1
+ disableJoinRequests: 1,
}, next);
},
function (next) {
@@ -36,27 +36,27 @@ describe('Groups', function () {
name: 'PrivateCanJoin',
description: 'Private group',
private: 1,
- disableJoinRequests: 0
+ disableJoinRequests: 0,
}, next);
},
function (next) {
// Create a new user
User.create({
username: 'testuser',
- email: 'b@c.com'
+ email: 'b@c.com',
}, next);
},
function (next) {
User.create({
username: 'admin',
email: 'admin@admin.com',
- password: '123456'
+ password: '123456',
}, next);
},
function (next) {
// Also create a hidden group
Groups.join('Hidden', 'Test', next);
- }
+ },
], function (err, results) {
assert.ifError(err);
testUid = results[3];
@@ -136,7 +136,7 @@ describe('Groups', function () {
it('should return all users if no query', function (done) {
User.create({
username: 'newuser',
- email: 'newuser@b.com'
+ email: 'newuser@b.com',
}, function (err, uid) {
assert.ifError(err);
Groups.join('Test', uid, function (err) {
@@ -227,7 +227,7 @@ describe('Groups', function () {
it('should create another group', function (done) {
Groups.create({
name: 'foo',
- description: 'bar'
+ description: 'bar',
}, function (err) {
assert.ifError(err);
Groups.get('foo', {}, done);
@@ -284,13 +284,13 @@ describe('Groups', function () {
name: 'updateTestGroup',
description: 'bar',
system: 0,
- hidden: 0
+ hidden: 0,
}, done);
});
it('should change an aspect of a group', function (done) {
Groups.update('updateTestGroup', {
- description: 'baz'
+ description: 'baz',
}, function (err) {
assert.ifError(err);
@@ -304,7 +304,7 @@ describe('Groups', function () {
it('should rename a group if the name was updated', function (done) {
Groups.update('updateTestGroup', {
- name: 'updateTestGroup?'
+ name: 'updateTestGroup?',
}, function (err) {
assert.ifError(err);
@@ -685,8 +685,8 @@ describe('Groups', function () {
userTitleEnabled: 1,
disableJoinRequests: 1,
hidden: 1,
- private: 0
- }
+ private: 0,
+ },
};
socketGroups.update({uid: adminUid}, data, function (err) {
assert.ifError(err);
@@ -722,7 +722,7 @@ describe('Groups', function () {
},
function (next) {
helpers.copyFile(logoPath, imagePath, next);
- }
+ },
], done);
});
});
@@ -740,7 +740,7 @@ describe('Groups', function () {
it('should upload group cover image from file', function (done) {
var data = {
groupName: 'Test',
- file: imagePath
+ file: imagePath,
};
socketGroups.cover.update({uid: adminUid}, data, function (err, data) {
assert.ifError(err);
@@ -756,7 +756,7 @@ describe('Groups', function () {
it('should upload group cover image from data', function (done) {
var data = {
groupName: 'Test',
- imageData: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAACcJJREFUeNqMl9tvnNV6xn/f+s5z8DCeg88Zj+NYdhJH4KShFoJAIkzVphLVJnsDaiV6gUKaC2qQUFVATbnoValAakuQYKMqBKUUJCgI9XBBSmOROMqGoCStHbA9sWM7nrFn/I3n9B17kcwoabfarj9gvet53+d9nmdJAwMDAAgh8DyPtbU1XNfFMAwkScK2bTzPw/M8dF1/SAhxKAiCxxVF2aeqqqTr+q+Af+7o6Ch0d3f/69TU1KwkSRiGwbFjx3jmmWd47rnn+OGHH1BVFYX/5QRBkPQ87xeSJP22YRi/oapqStM0PM/D931kWSYIgnHf98cXFxepVqtomjZt2/Zf2bb990EQ4Pv+PXfeU1CSpGYhfN9/TgjxQTQaJQgCwuEwQRBQKpUwDAPTNPF9n0ajAYDv+8zPzzM+Pr6/Wq2eqdVqfxOJRA6Zpnn57hrivyEC0IQQZ4Mg+MAwDCKRCJIkUa/XEUIQi8XQNI1QKIQkSQghUBQFIQSmaTI7OwtAuVxOTE9Pfzc9Pf27lUqlBUgulUoUi0VKpRKqqg4EQfAfiqLsDIfDAC0E4XCYaDSKEALXdalUKvfM1/d9hBBYlkUul2N4eJi3335bcl33mW+++aaUz+cvSJKE8uKLL6JpGo7j8Omnn/7d+vp6sr+/HyEEjuMgyzKu6yJJEsViEVVV8TyPjY2NVisV5fZkTNMkkUhw8+ZN6vU6Kysr7Nmzh9OnT7/12GOPDS8sLByT7rQR4A9XV1d/+cILLzA9PU0kEmF4eBhFUTh//jyWZaHrOkII0uk0jUaDWq1GJpOhWCyysrLC1tYWnuehqir79+9H13W6urp48803+f7773n++ef/4G7S/H4ikUCSJNbX11trcuvWLcrlMrIs4zgODzzwABMTE/i+T7lcpq2tjUqlwubmJrZts7y8jBCCkZERGo0G2WyWkydPkkql6Onp+eMmwihwc3JyMvrWW2+RTCYBcF0XWZbRdZ3l5WX27NnD008/TSwWQ1VVyuVy63GhUIhEIkEqlcJxHCzLIhaLMTQ0xJkzZ7Btm3379lmS53kIIczZ2dnFsbGxRK1Wo729HQDP8zAMg5WVFXp7e5mcnKSzs5N8Po/rutTrdVzXbQmHrutEo1FM00RVVXp7e0kkEgRBwMWLF9F1vaxUq1UikUjtlVdeuV6pVBJ9fX3Ytn2bwrLMysoKXV1dTE5OkslksCwLTdMwDANVVdnY2CAIApLJJJFIBMdxiMfj7Nq1C1VViUajLQCvvvrqkhKJRJiZmfmdb7/99jeTySSyLLfWodFoEAqFOH78OLt37yaXy2GaJoqisLy8zNTUFFevXiUIAtrb29m5cyePPPJIa+cymQz1eh2A0dFRCoXCsgIwNTW1J5/P093dTbFYRJZlJEmiWq1y4MABxsbGqNVqhEIh6vU6QRBQLpcxDIPh4WE8z2NxcZFTp05x7tw5Xn755ZY6dXZ2tliZzWa/EwD1ev3RsbExxsfHSafTVCoVGo0Gqqqya9cuIpEIQgh832dtbY3FxUUA+vr62LZtG2NjYxw5coTDhw+ztLTEyZMnuXr1KoVC4R4d3bt375R84sQJEY/H/2Jubq7N9326urqwbZt6vY5pmhw5coS+vr4W9YvFIrdu3WJqagohBFeuXOHcuXOtue7evRtN01rtfO+991haWmJkZGQrkUi8JIC9iqL0BkFAIpFACMETTzxBV1cXiUSC7u5uHMfB8zyCIMA0TeLxONlsFlmW8X2fwcFBHMdhfn6eer1Oe3s7Dz30EBMTE1y6dImjR49y6tSppR07dqwrjuM8+OWXXzI0NMTly5e5du0aQ0NDTExMkMvlCIKAIAhaIh2LxQiHw0QiEfL5POl0mlqtRq1Wo6OjA8uykGWZdDrN0tISvb29vPPOOzz++OPk83lELpf7rXfffRfDMOjo6MBxHEqlEocOHWLHjh00Gg0kSULTNIS4bS6qqhKPxxkaGmJ4eJjR0VH279/PwMAA27dvJ5vN4vs+X331FR9//DGzs7OEQiE++eQTlPb29keuX7/OtWvXOH78ONVqlZs3b9LW1kYmk8F13dZeCiGQJAnXdRFCYBgGsiwjhMC2bQqFAkEQoOs6P/74Iw8++CCDg4Pous6xY8f47LPPkIIguDo2Nrbzxo0bfPjhh9i2zczMTHNvcF2XpsZalkWj0cB1Xe4o1O3YoCisra3x008/EY/H6erqAuDAgQNEIhGCIODQoUP/ubCwMCKAjx599FHW19f56KOP6OjooFgsks/niUajKIqCbds4joMQAiFESxxs226xd2Zmhng8Tl9fH67r0mg0sG2bbDZLpVIhl8vd5gHwtysrKy8Dcdd1mZubo6enh1gsRrVabZlrk6VND/R9n3q9TqVSQdd1QqEQi4uLnD9/nlKpxODgIHv37gXAcRyCICiFQiHEzp07i1988cUfKYpCIpHANE22b9/eUhNFUVotDIKghc7zPCzLolKpsLW1RVtbG0EQ4DgOmqbR09NDM1qUSiWAPwdQ7ujjmf7+/kQymfxrSZJQVZWtra2WG+i63iKH53m4rku1WqVcLmNZFu3t7S2x7+/vJ51O89prr7VYfenSpcPAP1UqFeSHH36YeDxOKpW6eP/9988Bv9d09nw+T7VapVKptJjZnE2tVmNtbY1cLke5XGZra4vNzU16enp49tlnGRgYaD7iTxqNxgexWIzDhw+jNEPQHV87NT8/f+PChQtnR0ZGqFarrUVuOsDds2u2b2FhgVQqRSQSYWFhgStXrtDf308ymcwBf3nw4EEOHjx4O5c2lURVVRzHYXp6+t8uX7785IULFz7LZDLous59991HOBy+h31N9xgdHSWTyVCtVhkaGmLfvn1MT08zPz/PzMzM6c8//9xr+uE9QViWZer1OhsbGxiG8fns7OzPc7ncx729vXR3d1OpVNi2bRuhUAhZljEMA9/3sW0bVVVZWlri4sWLjI+P8/rrr/P111/z5JNPXrIs69cn76ZeGoaBpmm0tbX9Q6FQeHhubu7fC4UCkUiE1dVVstks8Xgc0zSRZZlGo9ESAdM02djYoNFo8MYbb2BZ1mYoFOKuZPjr/xZBEHCHred83x/b3Nz8l/X19aRlWWxsbNDZ2cnw8DDhcBjf96lWq/T09HD06FGeeuopXnrpJc6ePUs6nb4hhPi/C959ZFn+TtO0lG3bJ0ql0p85jsPW1haFQoG2tjYkSWpF/Uwmw9raGu+//z7A977vX2+GrP93wSZiTdNOGIbxy3K5/DPHcfYXCoVe27Yzpmm2m6bppVKp/Orqqnv69OmoZVn/mEwm/9TzvP9x138NAMpJ4VFTBr6SAAAAAElFTkSuQmCC'
+ imageData: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAACcJJREFUeNqMl9tvnNV6xn/f+s5z8DCeg88Zj+NYdhJH4KShFoJAIkzVphLVJnsDaiV6gUKaC2qQUFVATbnoValAakuQYKMqBKUUJCgI9XBBSmOROMqGoCStHbA9sWM7nrFn/I3n9B17kcwoabfarj9gvet53+d9nmdJAwMDAAgh8DyPtbU1XNfFMAwkScK2bTzPw/M8dF1/SAhxKAiCxxVF2aeqqqTr+q+Af+7o6Ch0d3f/69TU1KwkSRiGwbFjx3jmmWd47rnn+OGHH1BVFYX/5QRBkPQ87xeSJP22YRi/oapqStM0PM/D931kWSYIgnHf98cXFxepVqtomjZt2/Zf2bb990EQ4Pv+PXfeU1CSpGYhfN9/TgjxQTQaJQgCwuEwQRBQKpUwDAPTNPF9n0ajAYDv+8zPzzM+Pr6/Wq2eqdVqfxOJRA6Zpnn57hrivyEC0IQQZ4Mg+MAwDCKRCJIkUa/XEUIQi8XQNI1QKIQkSQghUBQFIQSmaTI7OwtAuVxOTE9Pfzc9Pf27lUqlBUgulUoUi0VKpRKqqg4EQfAfiqLsDIfDAC0E4XCYaDSKEALXdalUKvfM1/d9hBBYlkUul2N4eJi3335bcl33mW+++aaUz+cvSJKE8uKLL6JpGo7j8Omnn/7d+vp6sr+/HyEEjuMgyzKu6yJJEsViEVVV8TyPjY2NVisV5fZkTNMkkUhw8+ZN6vU6Kysr7Nmzh9OnT7/12GOPDS8sLByT7rQR4A9XV1d/+cILLzA9PU0kEmF4eBhFUTh//jyWZaHrOkII0uk0jUaDWq1GJpOhWCyysrLC1tYWnuehqir79+9H13W6urp48803+f7773n++ef/4G7S/H4ikUCSJNbX11trcuvWLcrlMrIs4zgODzzwABMTE/i+T7lcpq2tjUqlwubmJrZts7y8jBCCkZERGo0G2WyWkydPkkql6Onp+eMmwihwc3JyMvrWW2+RTCYBcF0XWZbRdZ3l5WX27NnD008/TSwWQ1VVyuVy63GhUIhEIkEqlcJxHCzLIhaLMTQ0xJkzZ7Btm3379lmS53kIIczZ2dnFsbGxRK1Wo729HQDP8zAMg5WVFXp7e5mcnKSzs5N8Po/rutTrdVzXbQmHrutEo1FM00RVVXp7e0kkEgRBwMWLF9F1vaxUq1UikUjtlVdeuV6pVBJ9fX3Ytn2bwrLMysoKXV1dTE5OkslksCwLTdMwDANVVdnY2CAIApLJJJFIBMdxiMfj7Nq1C1VViUajLQCvvvrqkhKJRJiZmfmdb7/99jeTySSyLLfWodFoEAqFOH78OLt37yaXy2GaJoqisLy8zNTUFFevXiUIAtrb29m5cyePPPJIa+cymQz1eh2A0dFRCoXCsgIwNTW1J5/P093dTbFYRJZlJEmiWq1y4MABxsbGqNVqhEIh6vU6QRBQLpcxDIPh4WE8z2NxcZFTp05x7tw5Xn755ZY6dXZ2tliZzWa/EwD1ev3RsbExxsfHSafTVCoVGo0Gqqqya9cuIpEIQgh832dtbY3FxUUA+vr62LZtG2NjYxw5coTDhw+ztLTEyZMnuXr1KoVC4R4d3bt375R84sQJEY/H/2Jubq7N9326urqwbZt6vY5pmhw5coS+vr4W9YvFIrdu3WJqagohBFeuXOHcuXOtue7evRtN01rtfO+991haWmJkZGQrkUi8JIC9iqL0BkFAIpFACMETTzxBV1cXiUSC7u5uHMfB8zyCIMA0TeLxONlsFlmW8X2fwcFBHMdhfn6eer1Oe3s7Dz30EBMTE1y6dImjR49y6tSppR07dqwrjuM8+OWXXzI0NMTly5e5du0aQ0NDTExMkMvlCIKAIAhaIh2LxQiHw0QiEfL5POl0mlqtRq1Wo6OjA8uykGWZdDrN0tISvb29vPPOOzz++OPk83lELpf7rXfffRfDMOjo6MBxHEqlEocOHWLHjh00Gg0kSULTNIS4bS6qqhKPxxkaGmJ4eJjR0VH279/PwMAA27dvJ5vN4vs+X331FR9//DGzs7OEQiE++eQTlPb29keuX7/OtWvXOH78ONVqlZs3b9LW1kYmk8F13dZeCiGQJAnXdRFCYBgGsiwjhMC2bQqFAkEQoOs6P/74Iw8++CCDg4Pous6xY8f47LPPkIIguDo2Nrbzxo0bfPjhh9i2zczMTHNvcF2XpsZalkWj0cB1Xe4o1O3YoCisra3x008/EY/H6erqAuDAgQNEIhGCIODQoUP/ubCwMCKAjx599FHW19f56KOP6OjooFgsks/niUajKIqCbds4joMQAiFESxxs226xd2Zmhng8Tl9fH67r0mg0sG2bbDZLpVIhl8vd5gHwtysrKy8Dcdd1mZubo6enh1gsRrVabZlrk6VND/R9n3q9TqVSQdd1QqEQi4uLnD9/nlKpxODgIHv37gXAcRyCICiFQiHEzp07i1988cUfKYpCIpHANE22b9/eUhNFUVotDIKghc7zPCzLolKpsLW1RVtbG0EQ4DgOmqbR09NDM1qUSiWAPwdQ7ujjmf7+/kQymfxrSZJQVZWtra2WG+i63iKH53m4rku1WqVcLmNZFu3t7S2x7+/vJ51O89prr7VYfenSpcPAP1UqFeSHH36YeDxOKpW6eP/9988Bv9d09nw+T7VapVKptJjZnE2tVmNtbY1cLke5XGZra4vNzU16enp49tlnGRgYaD7iTxqNxgexWIzDhw+jNEPQHV87NT8/f+PChQtnR0ZGqFarrUVuOsDds2u2b2FhgVQqRSQSYWFhgStXrtDf308ymcwBf3nw4EEOHjx4O5c2lURVVRzHYXp6+t8uX7785IULFz7LZDLous59991HOBy+h31N9xgdHSWTyVCtVhkaGmLfvn1MT08zPz/PzMzM6c8//9xr+uE9QViWZer1OhsbGxiG8fns7OzPc7ncx729vXR3d1OpVNi2bRuhUAhZljEMA9/3sW0bVVVZWlri4sWLjI+P8/rrr/P111/z5JNPXrIs69cn76ZeGoaBpmm0tbX9Q6FQeHhubu7fC4UCkUiE1dVVstks8Xgc0zSRZZlGo9ESAdM02djYoNFo8MYbb2BZ1mYoFOKuZPjr/xZBEHCHred83x/b3Nz8l/X19aRlWWxsbNDZ2cnw8DDhcBjf96lWq/T09HD06FGeeuopXnrpJc6ePUs6nb4hhPi/C959ZFn+TtO0lG3bJ0ql0p85jsPW1haFQoG2tjYkSWpF/Uwmw9raGu+//z7A977vX2+GrP93wSZiTdNOGIbxy3K5/DPHcfYXCoVe27Yzpmm2m6bppVKp/Orqqnv69OmoZVn/mEwm/9TzvP9x138NAMpJ4VFTBr6SAAAAAElFTkSuQmCC',
};
socketGroups.cover.update({uid: adminUid}, data, function (err, data) {
assert.ifError(err);
@@ -771,7 +771,7 @@ describe('Groups', function () {
it('should update group cover position', function (done) {
var data = {
groupName: 'Test',
- position: '50% 50%'
+ position: '50% 50%',
};
socketGroups.cover.update({uid: adminUid}, data, function (err) {
assert.ifError(err);
diff --git a/test/helpers/index.js b/test/helpers/index.js
index edae035b66..91582cae11 100644
--- a/test/helpers/index.js
+++ b/test/helpers/index.js
@@ -14,7 +14,7 @@ helpers.loginUser = function (username, password, callback) {
request({
url: nconf.get('url') + '/api/config',
json: true,
- jar: jar
+ jar: jar,
}, function (err, res, body) {
if (err || res.statusCode !== 200) {
return callback(err || new Error('[[error:invalid-response]]'));
@@ -28,8 +28,8 @@ helpers.loginUser = function (username, password, callback) {
json: true,
jar: jar,
headers: {
- 'x-csrf-token': body.csrf_token
- }
+ 'x-csrf-token': body.csrf_token,
+ },
}, function (err, res) {
if (err || res.statusCode !== 200) {
return callback(err || new Error('[[error:invalid-response]]'));
@@ -62,7 +62,7 @@ helpers.initSocketIO = function (callback) {
request.get({
url: nconf.get('url') + '/api/config',
jar: jar,
- json: true
+ json: true,
}, function (err, res, body) {
if (err) {
return callback(err);
@@ -94,8 +94,8 @@ helpers.uploadFile = function (uploadEndPoint, filePath, body, jar, csrf_token,
var formData = {
files: [
fs.createReadStream(filePath),
- fs.createReadStream(filePath) // see https://github.com/request/request/issues/2445
- ]
+ fs.createReadStream(filePath), // see https://github.com/request/request/issues/2445
+ ],
};
formData = utils.merge(formData, body);
request.post({
@@ -104,8 +104,8 @@ helpers.uploadFile = function (uploadEndPoint, filePath, body, jar, csrf_token,
json: true,
jar: jar,
headers: {
- 'x-csrf-token': csrf_token
- }
+ 'x-csrf-token': csrf_token,
+ },
}, function (err, res, body) {
if (err) {
return callback(err);
@@ -119,7 +119,7 @@ helpers.registerUser = function (data, callback) {
request({
url: nconf.get('url') + '/api/config',
json: true,
- jar: jar
+ jar: jar,
}, function (err, response, body) {
if (err) {
return callback(err);
@@ -130,8 +130,8 @@ helpers.registerUser = function (data, callback) {
json: true,
jar: jar,
headers: {
- 'x-csrf-token': body.csrf_token
- }
+ 'x-csrf-token': body.csrf_token,
+ },
}, function (err, res, body) {
if (err) {
return callback(err);
diff --git a/test/messaging.js b/test/messaging.js
index a60504544b..a31c89b624 100644
--- a/test/messaging.js
+++ b/test/messaging.js
@@ -25,7 +25,7 @@ describe('Messaging Library', function () {
async.series([
async.apply(User.create, { username: 'foo', password: 'barbar' }), // admin
async.apply(User.create, { username: 'baz', password: 'quuxquux' }), // restricted user
- async.apply(User.create, { username: 'herp', password: 'derpderp' }) // regular user
+ async.apply(User.create, { username: 'herp', password: 'derpderp' }), // regular user
], function (err, uids) {
if (err) {
return done(err);
@@ -37,7 +37,7 @@ describe('Messaging Library', function () {
async.parallel([
async.apply(Groups.join, 'administrators', fooUid),
- async.apply(User.setSetting, bazUid, 'restrictChat', '1')
+ async.apply(User.setSetting, bazUid, 'restrictChat', '1'),
], done);
});
});
@@ -125,7 +125,7 @@ describe('Messaging Library', function () {
socketModules.chats.getMessages({uid: fooUid}, {
uid: fooUid,
roomId: roomId,
- start: 0
+ start: 0,
}, function (err, messages) {
assert.ifError(err);
assert(Array.isArray(messages));
diff --git a/test/meta.js b/test/meta.js
index 6f27de6a8e..b293f78ed9 100644
--- a/test/meta.js
+++ b/test/meta.js
@@ -19,7 +19,7 @@ describe('meta', function () {
async.series([
async.apply(User.create, { username: 'foo', password: 'barbar' }), // admin
async.apply(User.create, { username: 'baz', password: 'quuxquux' }), // restricted user
- async.apply(User.create, { username: 'herp', password: 'derpderp' }) // regular user
+ async.apply(User.create, { username: 'herp', password: 'derpderp' }), // regular user
], function (err, uids) {
if (err) {
return done(err);
@@ -146,7 +146,7 @@ describe('meta', function () {
socketAdmin.config.setMultiple({uid: fooUid}, {
someField1: 'someValue1',
someField2: 'someValue2',
- customCSS: '.derp{color:#00ff00;}'
+ customCSS: '.derp{color:#00ff00;}',
}, function (err) {
assert.ifError(err);
meta.configs.getFields(['someField1', 'someField2'], function (err, data) {
diff --git a/test/mocks/databasemock.js b/test/mocks/databasemock.js
index db28b8025c..00f076ae2a 100644
--- a/test/mocks/databasemock.js
+++ b/test/mocks/databasemock.js
@@ -21,7 +21,7 @@
themes_path: path.join(__dirname, '../../node_modules'),
upload_path: 'public/uploads',
views_dir: path.join(__dirname, '../../build/public/templates'),
- relative_path: ''
+ relative_path: '',
});
if (!nconf.get('isCluster')) {
@@ -60,7 +60,7 @@
' "password": "",' + '\n' +
' "database": "nodebb_test"' + '\n' +
'}\n' +
- '==========================================================='
+ '===========================================================',
);
winston.error(errorText);
throw new Error(errorText);
@@ -116,7 +116,7 @@
function (next) {
meta.themes.set({
type: 'local',
- id: 'nodebb-theme-persona'
+ id: 'nodebb-theme-persona',
}, next);
},
function (next) {
@@ -151,7 +151,7 @@
require('../../src/user').startJobs();
webserver.listen(next);
- }
+ },
], done);
});
@@ -167,7 +167,7 @@
winston.info('Enabling default plugins\n');
var defaultEnabled = [
- 'nodebb-plugin-dbsearch'
+ 'nodebb-plugin-dbsearch',
];
winston.info('[install/enableDefaultPlugins] activating default plugins', defaultEnabled);
diff --git a/test/notifications.js b/test/notifications.js
index c36c8008e4..e989b7f16e 100644
--- a/test/notifications.js
+++ b/test/notifications.js
@@ -29,7 +29,7 @@ describe('Notifications', function () {
notifications.create({
bodyShort: 'bodyShort',
nid: 'notification_id',
- path: '/notification/path'
+ path: '/notification/path',
}, function (err, _notification) {
notification = _notification;
assert.ifError(err);
@@ -162,7 +162,7 @@ describe('Notifications', function () {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
function (category, next) {
@@ -172,7 +172,7 @@ describe('Notifications', function () {
uid: watcherUid,
cid: cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
}, next);
},
function (topic, next) {
@@ -184,7 +184,7 @@ describe('Notifications', function () {
topics.reply({
uid: uid,
content: 'This is the first reply.',
- tid: tid
+ tid: tid,
}, next);
},
function (post, next) {
@@ -193,7 +193,7 @@ describe('Notifications', function () {
topics.reply({
uid: uid,
content: 'This is the second reply.',
- tid: tid
+ tid: tid,
}, next);
},
function (post, next) {
@@ -207,7 +207,7 @@ describe('Notifications', function () {
assert.equal(notifications.unread.length, 1, 'there should be 1 unread notification');
assert.equal('/post/' + pid, notifications.unread[0].path, 'the notification should link to the first unread post');
next();
- }
+ },
], function (err) {
assert.ifError(err);
done();
diff --git a/test/posts.js b/test/posts.js
index 84b5934724..4a291d401b 100644
--- a/test/posts.js
+++ b/test/posts.js
@@ -35,9 +35,9 @@ describe('Post\'s', function () {
category: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
- }
+ },
}, function (err, results) {
if (err) {
return done(err);
@@ -52,7 +52,7 @@ describe('Post\'s', function () {
uid: results.voteeUid,
cid: results.category.cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
}, function (err, data) {
if (err) {
return done(err);
@@ -190,14 +190,14 @@ describe('Post\'s', function () {
uid: voterUid,
cid: cid,
title: 'topic to delete/restore/purge',
- content: 'A post to delete/restore/purge'
+ content: 'A post to delete/restore/purge',
}, function (err, topicPostData) {
assert.ifError(err);
topics.reply({
uid: voterUid,
tid: topicPostData.topicData.tid,
timestamp: Date.now(),
- content: 'A post to delete/restore and purge'
+ content: 'A post to delete/restore and purge',
}, function (err, replyData) {
assert.ifError(err);
callback(topicPostData, replyData);
@@ -307,7 +307,7 @@ describe('Post\'s', function () {
uid: voterUid,
cid: cid,
title: 'topic to edit',
- content: 'A post to edit'
+ content: 'A post to edit',
}, function (err, data) {
assert.ifError(err);
pid = data.postData.pid;
@@ -316,7 +316,7 @@ describe('Post\'s', function () {
uid: voterUid,
tid: tid,
timestamp: Date.now(),
- content: 'A reply to edit'
+ content: 'A reply to edit',
}, function (err, data) {
assert.ifError(err);
replyPid = data.pid;
@@ -440,7 +440,7 @@ describe('Post\'s', function () {
uid: voterUid,
cid: cid,
title: 'topic 1',
- content: 'some content'
+ content: 'some content',
}, next);
},
function (data, next) {
@@ -449,7 +449,7 @@ describe('Post\'s', function () {
uid: voterUid,
cid: cid,
title: 'topic 2',
- content: 'some content'
+ content: 'some content',
}, next);
},
function (data, next) {
@@ -458,13 +458,13 @@ describe('Post\'s', function () {
uid: voterUid,
tid: tid,
timestamp: Date.now(),
- content: 'A reply to move'
+ content: 'A reply to move',
}, function (err, data) {
assert.ifError(err);
replyPid = data.pid;
next();
});
- }
+ },
], done);
});
@@ -587,8 +587,8 @@ describe('Post\'s', function () {
pid: postData.pid,
data: [
{name: 'assignee', value: `${globalModUid}`},
- {name: 'notes', value: 'notes'}
- ]
+ {name: 'notes', value: 'notes'},
+ ],
}, function (err) {
assert.ifError(err);
posts.getFlags('posts:flagged', cid, globalModUid, 0, -1, function (err, flagData) {
@@ -599,19 +599,19 @@ describe('Post\'s', function () {
assignee: flagData.posts[0].flagData.assignee,
notes: flagData.posts[0].flagData.notes,
state: flagData.posts[0].flagData.state,
- labelClass: flagData.posts[0].flagData.labelClass
+ labelClass: flagData.posts[0].flagData.labelClass,
}, {
assignee: `${globalModUid}`,
notes: 'notes',
state: 'open',
- labelClass: 'info'
+ labelClass: 'info',
});
next();
});
});
}, function (next) {
posts.updateFlagData(globalModUid, postData.pid, {
- state: 'rejected'
+ state: 'rejected',
}, function (err) {
assert.ifError(err);
posts.getFlags('posts:flagged', cid, globalModUid, 0, -1, function (err, flagData) {
@@ -620,17 +620,17 @@ describe('Post\'s', function () {
assert.equal(flagData.posts.length, 1);
assert.deepEqual({
state: flagData.posts[0].flagData.state,
- labelClass: flagData.posts[0].flagData.labelClass
+ labelClass: flagData.posts[0].flagData.labelClass,
}, {
state: 'rejected',
- labelClass: 'danger'
+ labelClass: 'danger',
});
next();
});
});
}, function (next) {
posts.updateFlagData(globalModUid, postData.pid, {
- state: 'wip'
+ state: 'wip',
}, function (err) {
assert.ifError(err);
posts.getFlags('posts:flagged', cid, globalModUid, 0, -1, function (err, flagData) {
@@ -639,17 +639,17 @@ describe('Post\'s', function () {
assert.equal(flagData.posts.length, 1);
assert.deepEqual({
state: flagData.posts[0].flagData.state,
- labelClass: flagData.posts[0].flagData.labelClass
+ labelClass: flagData.posts[0].flagData.labelClass,
}, {
state: 'wip',
- labelClass: 'warning'
+ labelClass: 'warning',
});
next();
});
});
}, function (next) {
posts.updateFlagData(globalModUid, postData.pid, {
- state: 'resolved'
+ state: 'resolved',
}, function (err) {
assert.ifError(err);
posts.getFlags('posts:flagged', cid, globalModUid, 0, -1, function (err, flagData) {
@@ -658,15 +658,15 @@ describe('Post\'s', function () {
assert.equal(flagData.posts.length, 1);
assert.deepEqual({
state: flagData.posts[0].flagData.state,
- labelClass: flagData.posts[0].flagData.labelClass
+ labelClass: flagData.posts[0].flagData.labelClass,
}, {
state: 'resolved',
- labelClass: 'success'
+ labelClass: 'success',
});
next();
});
});
- }
+ },
], done);
});
});
@@ -742,7 +742,7 @@ describe('Post\'s', function () {
uid: voterUid,
tid: topicData.tid,
timestamp: Date.now(),
- content: 'some content'
+ content: 'some content',
}, function (err) {
assert.ifError(err);
posts.getRecentPosterUids(0, 1, function (err, uids) {
diff --git a/test/rewards.js b/test/rewards.js
index 5804465ef7..ead6c6dd1a 100644
--- a/test/rewards.js
+++ b/test/rewards.js
@@ -19,7 +19,7 @@ describe('rewards', function () {
async.series([
async.apply(User.create, { username: 'foo', password: 'barbar' }),
async.apply(User.create, { username: 'baz', password: 'quuxquux' }),
- async.apply(User.create, { username: 'herp', password: 'derpderp' })
+ async.apply(User.create, { username: 'herp', password: 'derpderp' }),
], function (err, uids) {
if (err) {
return done(err);
@@ -35,7 +35,7 @@ describe('rewards', function () {
},
function (next) {
Groups.join('rewardGroup', adminUid, done);
- }
+ },
], done);
});
});
@@ -53,8 +53,8 @@ describe('rewards', function () {
rid: 'essentials/add-to-group',
claimable: '1',
id: '',
- disabled: false
- }
+ disabled: false,
+ },
];
socketAdmin.rewards.save({uid: adminUid}, data, function (err) {
diff --git a/test/search-admin.js b/test/search-admin.js
index 216d26d35f..8a8a810f63 100644
--- a/test/search-admin.js
+++ b/test/search-admin.js
@@ -40,7 +40,7 @@ describe('admin search', function () {
search.sanitize('Pellentesque tristique senectus' +
' habitant morbi'),
'Pellentesque tristique senectus' +
- ' habitant morbi'
+ ' habitant morbi',
);
done();
});
@@ -49,7 +49,7 @@ describe('admin search', function () {
search.sanitize('
Pellentesque habitant morbi tristique senectus' +
'Aenean vitae est.Mauris eleifend leo.
'),
'Pellentesque habitant morbi tristique senectus' +
- 'Aenean vitae est.Mauris eleifend leo.'
+ 'Aenean vitae est.Mauris eleifend leo.',
);
done();
});
@@ -60,10 +60,10 @@ describe('admin search', function () {
assert.equal(
search.simplify(
'Pellentesque tristique {{senectus}}habitant morbi' +
- 'liquam tincidunt {mauris.eu}risus'
+ 'liquam tincidunt {mauris.eu}risus',
),
'Pellentesque tristique habitant morbi' +
- 'liquam tincidunt risus'
+ 'liquam tincidunt risus',
);
done();
});
@@ -71,10 +71,10 @@ describe('admin search', function () {
assert.equal(
search.simplify(
'Pellentesque tristique habitant morbi' +
- ' \n\n liquam tincidunt mauris eu risus.'
+ ' \n\n liquam tincidunt mauris eu risus.',
),
'Pellentesque tristique habitant morbi' +
- '\nliquam tincidunt mauris eu risus.'
+ '\nliquam tincidunt mauris eu risus.',
);
done();
});
diff --git a/test/search.js b/test/search.js
index 7c619d0b6c..0c4713b720 100644
--- a/test/search.js
+++ b/test/search.js
@@ -37,15 +37,15 @@ describe('Search', function () {
category1: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
category2: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
- }
+ },
}, next);
},
function (results, next) {
@@ -61,7 +61,7 @@ describe('Search', function () {
cid: cid1,
title: 'nodebb mongodb bugs',
content: 'avocado cucumber apple orange fox',
- tags: ['nodebb', 'bug', 'plugin', 'nodebb-plugin', 'jquery']
+ tags: ['nodebb', 'bug', 'plugin', 'nodebb-plugin', 'jquery'],
}, next);
},
function (results, next) {
@@ -73,7 +73,7 @@ describe('Search', function () {
cid: cid2,
title: 'java mongodb redis',
content: 'avocado cucumber carrot armadillo',
- tags: ['nodebb', 'bug', 'plugin', 'nodebb-plugin', 'javascript']
+ tags: ['nodebb', 'bug', 'plugin', 'nodebb-plugin', 'javascript'],
}, next);
},
function (results, next) {
@@ -82,15 +82,15 @@ describe('Search', function () {
topics.reply({
uid: phoebeUid,
content: 'reply post apple',
- tid: topic2Data.tid
+ tid: topic2Data.tid,
}, next);
},
function (_post3Data, next) {
post3Data = _post3Data;
setTimeout(next, 500);
- }
+ },
], next);
- }
+ },
], done);
});
@@ -102,7 +102,7 @@ describe('Search', function () {
request({
url: nconf.get('url') + qs,
- json: true
+ json: true,
}, function (err, response, body) {
assert.ifError(err);
assert(body);
@@ -118,7 +118,7 @@ describe('Search', function () {
it('should search for a user', function (done) {
search.search({
query: 'gin',
- searchIn: 'users'
+ searchIn: 'users',
}, function (err, data) {
assert.ifError(err);
assert(data);
@@ -133,7 +133,7 @@ describe('Search', function () {
it('should search for a tag', function (done) {
search.search({
query: 'plug',
- searchIn: 'tags'
+ searchIn: 'tags',
}, function (err, data) {
assert.ifError(err);
assert(data);
@@ -148,7 +148,7 @@ describe('Search', function () {
it('should fail if searchIn is wrong', function (done) {
search.search({
query: 'plug',
- searchIn: 'invalidfilter'
+ searchIn: 'invalidfilter',
}, function (err) {
assert.equal(err.message, '[[error:unknown-search-filter]]');
done();
@@ -159,7 +159,7 @@ describe('Search', function () {
search.search({
query: 'mongodb',
searchIn: 'titles',
- hasTags: ['nodebb', 'javascript']
+ hasTags: ['nodebb', 'javascript'],
}, function (err, data) {
assert.ifError(err);
assert.equal(data.posts[0].tid, topic2Data.tid);
diff --git a/test/socket.io.js b/test/socket.io.js
index ac8170225c..ca3ba2bb0e 100644
--- a/test/socket.io.js
+++ b/test/socket.io.js
@@ -33,8 +33,8 @@ describe('socket.io', function () {
async.apply(user.create, { username: 'regular', password: 'regularpwd', email: 'regular@test.com'}),
async.apply(categories.create, {
name: 'Test Category',
- description: 'Test category created by testing script'
- })
+ description: 'Test category created by testing script',
+ }),
], function (err, data) {
if (err) {
return done(err);
@@ -52,7 +52,7 @@ describe('socket.io', function () {
request.get({
url: nconf.get('url') + '/api/config',
jar: cookies,
- json: true
+ json: true,
}, function (err, res, body) {
assert.ifError(err);
@@ -60,12 +60,12 @@ describe('socket.io', function () {
jar: cookies,
form: {
username: 'admin',
- password: 'adminpwd'
+ password: 'adminpwd',
},
headers: {
- 'x-csrf-token': body.csrf_token
+ 'x-csrf-token': body.csrf_token,
},
- json: true
+ json: true,
}, function (err, res, body) {
assert.ifError(err);
diff --git a/test/topics.js b/test/topics.js
index 01af1f5f2e..741f095192 100644
--- a/test/topics.js
+++ b/test/topics.js
@@ -28,7 +28,7 @@ describe('Topic\'s', function () {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, function (err, category) {
if (err) {
return done(err);
@@ -40,7 +40,7 @@ describe('Topic\'s', function () {
userId: uid,
categoryId: categoryObj.cid,
title: 'Test Topic Title',
- content: 'The content of test topic'
+ content: 'The content of test topic',
};
done();
});
@@ -248,7 +248,7 @@ describe('Topic\'s', function () {
function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, function (err, category) {
if (err) {
return next(err);
@@ -256,7 +256,7 @@ describe('Topic\'s', function () {
moveCid = category.cid;
next();
});
- }
+ },
], done);
});
@@ -370,7 +370,7 @@ describe('Topic\'s', function () {
uid: topic.userId,
title: 'topic for test',
content: 'topic content',
- cid: topic.categoryId
+ cid: topic.categoryId,
}, callback);
}
async.series({
@@ -382,7 +382,7 @@ describe('Topic\'s', function () {
},
topic3: function (next) {
createTopic(next);
- }
+ },
}, function (err, results) {
assert.ifError(err);
tid1 = results.topic1.topicData.tid;
@@ -394,7 +394,7 @@ describe('Topic\'s', function () {
},
function (next) {
topics.tools.pin(tid2, adminUid, next);
- }
+ },
], done);
});
});
@@ -472,7 +472,7 @@ describe('Topic\'s', function () {
},
function (done) {
topics.markUnread( newTid, uid, done );
- }
+ },
],done);
});
@@ -489,7 +489,7 @@ describe('Topic\'s', function () {
var tids = topics.map( function (topic) { return topic.tid; } );
assert.equal(tids.indexOf(newTid), -1, 'The topic appeared in the unread list.');
done();
- }
+ },
], done);
});
@@ -513,7 +513,7 @@ describe('Topic\'s', function () {
}
assert.ok(topic, 'topic didn\'t appear in the recent list');
done();
- }
+ },
], done);
});
@@ -533,7 +533,7 @@ describe('Topic\'s', function () {
var tids = topics.map( function (topic) { return topic.tid; } );
assert.notEqual(tids.indexOf(newTid), -1, 'The topic did not appear in the unread list.');
done();
- }
+ },
], done);
});
@@ -553,7 +553,7 @@ describe('Topic\'s', function () {
var tids = topics.map( function (topic) { return topic.tid; } );
assert.notEqual(tids.indexOf(newTid), -1, 'The topic did not appear in the unread list.');
done();
- }
+ },
], done);
});
});
@@ -569,7 +569,7 @@ describe('Topic\'s', function () {
assert.ok(result);
replies.push(result);
next();
- }
+ },
);
}
@@ -625,7 +625,7 @@ describe('Topic\'s', function () {
function ( bookmark, next ) {
assert.equal( originalBookmark, bookmark );
next();
- }
+ },
],done);
});
@@ -645,7 +645,7 @@ describe('Topic\'s', function () {
function ( bookmark, next ) {
assert.equal( originalBookmark - 2, bookmark );
next();
- }
+ },
],done);
});
});
@@ -656,7 +656,7 @@ describe('Topic\'s', function () {
title: 'topic for controller test',
content: 'topic content',
cid: topic.categoryId,
- thumb: 'http://i.imgur.com/64iBdBD.jpg'
+ thumb: 'http://i.imgur.com/64iBdBD.jpg',
}, function (err, result) {
assert.ifError(err);
assert.ok(result);
@@ -762,7 +762,7 @@ describe('Topic\'s', function () {
},
topic2: function (next) {
topics.post({uid: adminUid, tags: ['nodebb'], title: 'topic title 2', content: 'topic 2 content', cid: topic.categoryId}, next);
- }
+ },
}, function (err, results) {
assert.ifError(err);
tid1 = results.topic1.topicData.tid;
@@ -792,7 +792,7 @@ describe('Topic\'s', function () {
},
user: function (next) {
User.create({username: 'regularJoe'}, next);
- }
+ },
}, function (err, results) {
assert.ifError(err);
tid = results.topic.topicData.tid;
@@ -880,7 +880,7 @@ describe('Topic\'s', function () {
function (count, next) {
assert.equal(count, 0);
next();
- }
+ },
], function (err) {
assert.ifError(err);
done();
@@ -960,7 +960,7 @@ describe('Topic\'s', function () {
},
regularRead: function (next) {
topics.hasReadTopic(tid, uid, next);
- }
+ },
}, function (err, results) {
assert.ifError(err);
assert.equal(results.adminRead, false);
@@ -982,7 +982,7 @@ describe('Topic\'s', function () {
},
topic2: function (next) {
topics.post({uid: adminUid, tags: ['javascript', 'mysql', 'python', 'nodejs'], title: 'topic title 2', content: 'topic 2 content', cid: topic.categoryId}, next);
- }
+ },
}, function (err) {
assert.ifError(err);
done();
@@ -1043,7 +1043,7 @@ describe('Topic\'s', function () {
var tagData = [
{ value: 'nodebb', color: '', bgColor: '', score: 3 },
{ value: 'nodejs', color: '', bgColor: '', score: 1 },
- { value: 'nosql', color: '', bgColor: '', score: 1 }
+ { value: 'nosql', color: '', bgColor: '', score: 1 },
];
assert.deepEqual(data.tags, tagData);
@@ -1120,7 +1120,7 @@ describe('Topic\'s', function () {
it('should error if data.tag is invalid', function (done) {
socketAdmin.tags.update({uid: adminUid}, {
bgColor: '#ff0000',
- color: '#00ff00'
+ color: '#00ff00',
}, function (err) {
assert.equal(err.message, '[[error:invalid-tag]]');
done();
@@ -1131,7 +1131,7 @@ describe('Topic\'s', function () {
socketAdmin.tags.update({uid: adminUid}, {
tag: 'emptytag',
bgColor: '#ff0000',
- color: '#00ff00'
+ color: '#00ff00',
}, function (err) {
assert.ifError(err);
db.getObject('tag:emptytag', function (err, data) {
@@ -1147,7 +1147,7 @@ describe('Topic\'s', function () {
var meta = require('../src/meta');
meta.config.maximumRelatedTopics = 2;
var topicData = {
- tags: [{value: 'javascript'}]
+ tags: [{value: 'javascript'}],
};
topics.getRelatedTopics(topicData, 0, function (err, data) {
assert.ifError(err);
diff --git a/test/translator.js b/test/translator.js
index 8198814164..ad8c9c34ee 100644
--- a/test/translator.js
+++ b/test/translator.js
@@ -218,7 +218,7 @@ describe('Translator static methods', function () {
it('should remove translator patterns from text', function (done) {
assert.strictEqual(
Translator.removePatterns('Lorem ipsum dolor [[sit:amet]], consectetur adipiscing elit. [[sed:vitae, [[semper:dolor]]]] lorem'),
- 'Lorem ipsum dolor , consectetur adipiscing elit. lorem'
+ 'Lorem ipsum dolor , consectetur adipiscing elit. lorem',
);
done();
});
@@ -227,7 +227,7 @@ describe('Translator static methods', function () {
it('should escape translation patterns within text', function (done) {
assert.strictEqual(
Translator.escape('some nice text [[global:home]] here'),
- 'some nice text \\[\\[global:home\\]\\] here'
+ 'some nice text \\[\\[global:home\\]\\] here',
);
done();
});
@@ -237,7 +237,7 @@ describe('Translator static methods', function () {
it('should unescape escaped translation patterns within text', function (done) {
assert.strictEqual(
Translator.unescape('some nice text \\[\\[global:home\\]\\] here'),
- 'some nice text [[global:home]] here'
+ 'some nice text [[global:home]] here',
);
done();
});
@@ -247,7 +247,7 @@ describe('Translator static methods', function () {
it('should create a translator pattern from a key and list of arguments', function (done) {
assert.strictEqual(
Translator.compile('amazing:cool', 'awesome', 'great'),
- '[[amazing:cool, awesome, great]]'
+ '[[amazing:cool, awesome, great]]',
);
done();
});
@@ -255,7 +255,7 @@ describe('Translator static methods', function () {
it('should escape `%` and `,` in arguments', function (done) {
assert.strictEqual(
Translator.compile('amazing:cool', '100% awesome!', 'one, two, and three'),
- '[[amazing:cool, 100% awesome!, one, two, and three]]'
+ '[[amazing:cool, 100% awesome!, one, two, and three]]',
);
done();
});
diff --git a/test/uploads.js b/test/uploads.js
index 43e39d2f26..d1fd0e0df3 100644
--- a/test/uploads.js
+++ b/test/uploads.js
@@ -28,7 +28,7 @@ describe('Upload Controllers', function () {
category: function (next) {
categories.create({
name: 'Test Category',
- description: 'Test category created by testing script'
+ description: 'Test category created by testing script',
}, next);
},
adminUid: function (next) {
@@ -36,7 +36,7 @@ describe('Upload Controllers', function () {
},
regularUid: function (next) {
user.create({username: 'regular', password: 'zugzug'}, next);
- }
+ },
}, function (err, results) {
if (err) {
return done(err);
diff --git a/test/user.js b/test/user.js
index 43b5b3f847..a9003d6b9c 100644
--- a/test/user.js
+++ b/test/user.js
@@ -28,7 +28,7 @@ describe('User', function () {
Categories.create({
name: 'Test Category',
description: 'A test',
- order: 1
+ order: 1,
}, function (err, categoryObj) {
if (err) {
return done(err);
@@ -45,7 +45,7 @@ describe('User', function () {
fullname: 'John Smith McNamara',
password: 'swordfish',
email: 'john@example.com',
- callback: undefined
+ callback: undefined,
};
});
@@ -108,14 +108,14 @@ describe('User', function () {
uid: testUid,
title: 'Topic 1',
content: 'lorem ipsum',
- cid: testCid
+ cid: testCid,
}),
async.apply(Topics.post, {
uid: testUid,
title: 'Topic 2',
content: 'lorem ipsum',
- cid: testCid
- })
+ cid: testCid,
+ }),
], function (err) {
assert(err);
done();
@@ -128,7 +128,7 @@ describe('User', function () {
uid: testUid,
title: 'Topic 3',
content: 'lorem ipsum',
- cid: testCid
+ cid: testCid,
}, function (err) {
assert.ifError(err);
done();
@@ -145,7 +145,7 @@ describe('User', function () {
uid: testUid,
title: 'Topic 4',
content: 'lorem ipsum',
- cid: testCid
+ cid: testCid,
}, function (err) {
assert(err);
done();
@@ -156,13 +156,13 @@ describe('User', function () {
it('should not error if a non-newbie user posts if the last post time is 10 < 30 seconds', function (done) {
User.setUserFields(testUid, {
lastposttime: +new Date() - (20 * 1000),
- reputation: 10
+ reputation: 10,
}, function () {
Topics.post({
uid: testUid,
title: 'Topic 5',
content: 'lorem ipsum',
- cid: testCid
+ cid: testCid,
}, function (err) {
assert.ifError(err);
done();
@@ -380,7 +380,7 @@ describe('User', function () {
location: 'izmir',
groupTitle: 'testGroup',
birthday: '01/01/1980',
- signature: 'nodebb is good'
+ signature: 'nodebb is good',
};
io.emit('user.updateProfile', data, function (err, result) {
assert.ifError(err);
@@ -499,7 +499,7 @@ describe('User', function () {
var picture = {
path: path.join(nconf.get('base_dir'), 'public', 'logo.png'),
size: 7189,
- name: 'logo.png'
+ name: 'logo.png',
};
User.uploadPicture(uid, picture, function (err, uploadedPicture) {
assert.ifError(err);
@@ -515,7 +515,7 @@ describe('User', function () {
var picture = {
path: path.join(nconf.get('base_dir'), 'public', 'logo.png'),
size: 7189,
- name: 'logo.png'
+ name: 'logo.png',
};
User.uploadPicture(uid, picture, function (err, uploadedPicture) {
assert.equal(err.message, '[[error:profile-image-uploads-disabled]]');
@@ -529,7 +529,7 @@ describe('User', function () {
var picture = {
path: path.join(nconf.get('base_dir'), 'public', 'logo.png'),
size: 265000,
- name: 'logo.png'
+ name: 'logo.png',
};
User.uploadPicture(uid, picture, function (err, uploadedPicture) {
assert.equal(err.message, '[[error:file-too-big, 256]]');
@@ -542,7 +542,7 @@ describe('User', function () {
var picture = {
path: path.join(nconf.get('base_dir'), 'public', 'logo.png'),
size: 7189,
- name: 'logo'
+ name: 'logo',
};
User.uploadPicture(uid, picture, function (err, uploadedPicture) {
assert.equal(err.message, '[[error:invalid-image-extension]]');
@@ -672,7 +672,7 @@ describe('User', function () {
it('should load user\'s groups page', function (done) {
groups.create({
name: 'Test',
- description: 'Foobar!'
+ description: 'Foobar!',
}, function (err) {
assert.ifError(err);
groups.join('Test', uid, function (err) {
@@ -707,7 +707,7 @@ describe('User', function () {
next(err);
});
- }
+ },
], function (err) {
assert.ifError(err);
User.unban(testUid, function (err) {
@@ -879,8 +879,8 @@ describe('User', function () {
followTopicsOnReply: 1,
notificationSound: '',
incomingChatSound: '',
- outgoingChatSound: ''
- }
+ outgoingChatSound: '',
+ },
};
socketUser.saveSettings({uid: testUid}, data, function (err) {
assert.ifError(err);
@@ -931,7 +931,7 @@ describe('User', function () {
helpers.registerUser({
username: 'rejectme',
password: '123456',
- email: 'reject@me.com'
+ email: 'reject@me.com',
}, function (err) {
assert.ifError(err);
helpers.loginUser('admin', '123456', function (err, jar) {
@@ -961,7 +961,7 @@ describe('User', function () {
helpers.registerUser({
username: 'acceptme',
password: '123456',
- email: 'accept@me.com'
+ email: 'accept@me.com',
}, function (err) {
assert.ifError(err);
socketAdmin.user.acceptRegistration({uid: adminUid}, {username: 'acceptme'}, function (err, uid) {