mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: remove tabs after declaration
This commit is contained in:
@@ -209,7 +209,7 @@ fs.open(pathToConfig, 'r', (err) => {
|
||||
if (nconf.get('daemon') !== 'false' && nconf.get('daemon') !== false) {
|
||||
if (file.existsSync(pidFilePath)) {
|
||||
try {
|
||||
const pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
|
||||
const pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
|
||||
process.kill(pid, 0);
|
||||
process.exit();
|
||||
} catch (e) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('admin/advanced/logs', function () {
|
||||
const Logs = {};
|
||||
const Logs = {};
|
||||
|
||||
Logs.init = function () {
|
||||
const logsEl = $('.logs pre');
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
|
||||
define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], function (Chart, translator, Benchpress, bootbox) {
|
||||
const Admin = {};
|
||||
const intervals = {
|
||||
const Admin = {};
|
||||
const intervals = {
|
||||
rooms: false,
|
||||
graphs: false,
|
||||
};
|
||||
let isMobile = false;
|
||||
const graphData = {
|
||||
const graphData = {
|
||||
rooms: {},
|
||||
traffic: {},
|
||||
};
|
||||
const currentGraph = {
|
||||
const currentGraph = {
|
||||
units: 'hours',
|
||||
until: undefined,
|
||||
};
|
||||
@@ -23,7 +23,7 @@ define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], func
|
||||
realtimeInterval: 1500,
|
||||
};
|
||||
|
||||
const usedTopicColors = [];
|
||||
const usedTopicColors = [];
|
||||
|
||||
$(window).on('action:ajaxify.start', function () {
|
||||
clearInterval(intervals.rooms);
|
||||
@@ -520,7 +520,7 @@ define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], func
|
||||
let html = '';
|
||||
topics.forEach(function (t, i) {
|
||||
const link = t.tid ? '<a title="' + t.title + '"href="' + config.relative_path + '/topic/' + t.tid + '" target="_blank"> ' + t.title + '</a>' : t.title;
|
||||
const label = t.count === '0' ? t.title : link;
|
||||
const label = t.count === '0' ? t.title : link;
|
||||
|
||||
html += '<li>' +
|
||||
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
||||
|
||||
@@ -8,7 +8,7 @@ define('admin/manage/categories', [
|
||||
'Sortable',
|
||||
'bootbox',
|
||||
], function (translator, Benchpress, categorySelector, api, Sortable, bootbox) {
|
||||
const Categories = {};
|
||||
const Categories = {};
|
||||
let newCategoryId = -1;
|
||||
let sortables;
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
|
||||
|
||||
CategoryAnalytics.init = function () {
|
||||
const hourlyCanvas = document.getElementById('pageviews:hourly');
|
||||
const dailyCanvas = document.getElementById('pageviews:daily');
|
||||
const topicsCanvas = document.getElementById('topics:daily');
|
||||
const postsCanvas = document.getElementById('posts:daily');
|
||||
const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
|
||||
const dailyCanvas = document.getElementById('pageviews:daily');
|
||||
const topicsCanvas = document.getElementById('topics:daily');
|
||||
const postsCanvas = document.getElementById('posts:daily');
|
||||
const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
|
||||
return idx % 3 ? '' : text;
|
||||
});
|
||||
const dailyLabels = utils.getDaysArray().map(function (text, idx) {
|
||||
const dailyLabels = utils.getDaysArray().map(function (text, idx) {
|
||||
return idx % 3 ? '' : text;
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ define('admin/manage/category', [
|
||||
'api',
|
||||
'bootbox',
|
||||
], function (uploader, iconSelect, categorySelector, Benchpress, api, bootbox) {
|
||||
const Category = {};
|
||||
const Category = {};
|
||||
let updateHash = {};
|
||||
|
||||
Category.init = function () {
|
||||
|
||||
@@ -6,10 +6,10 @@ define('admin/manage/groups', [
|
||||
'api',
|
||||
'bootbox',
|
||||
], function (categorySelector, slugify, api, bootbox) {
|
||||
const Groups = {};
|
||||
const Groups = {};
|
||||
|
||||
Groups.init = function () {
|
||||
const createModal = $('#create-modal');
|
||||
const createModal = $('#create-modal');
|
||||
const createGroupName = $('#create-group-name');
|
||||
const createModalGo = $('#create-modal-go');
|
||||
const createModalError = $('#create-modal-error');
|
||||
|
||||
@@ -6,7 +6,7 @@ define('admin/manage/tags', [
|
||||
'forum/infinitescroll',
|
||||
'admin/modules/selectable',
|
||||
], function (bootbox, infinitescroll, selectable) {
|
||||
const Tags = {};
|
||||
const Tags = {};
|
||||
|
||||
Tags.init = function () {
|
||||
selectable.enable('.tag-management', '.tag-row');
|
||||
|
||||
@@ -30,9 +30,9 @@ define('admin/settings', ['uploader', 'mousetrap', 'hooks'], function (uploader,
|
||||
Settings.prepare = function (callback) {
|
||||
// Populate the fields on the page from the config
|
||||
const fields = $('#content [data-field]');
|
||||
const numFields = fields.length;
|
||||
const saveBtn = $('#save');
|
||||
const revertBtn = $('#revert');
|
||||
const numFields = fields.length;
|
||||
const saveBtn = $('#save');
|
||||
const revertBtn = $('#revert');
|
||||
let x;
|
||||
let key;
|
||||
let inputType;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
define('admin/settings/notifications', [
|
||||
'autocomplete',
|
||||
], function (autocomplete) {
|
||||
const Notifications = {};
|
||||
const Notifications = {};
|
||||
|
||||
Notifications.init = function () {
|
||||
const searchInput = $('[data-field="welcomeUid"]');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/account/followers', ['forum/account/header'], function (header) {
|
||||
const Followers = {};
|
||||
const Followers = {};
|
||||
|
||||
Followers.init = function () {
|
||||
header.init();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/account/following', ['forum/account/header'], function (header) {
|
||||
const Following = {};
|
||||
const Following = {};
|
||||
|
||||
Following.init = function () {
|
||||
header.init();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/account/settings', ['forum/account/header', 'components', 'translator', 'api'], function (header, components, translator, api) {
|
||||
const AccountSettings = {};
|
||||
const AccountSettings = {};
|
||||
|
||||
// If page skin is changed but not saved, switch the skin back
|
||||
$(window).on('action:ajaxify.start', function () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/categories', ['components', 'categorySelector', 'hooks'], function (components, categorySelector, hooks) {
|
||||
const categories = {};
|
||||
const categories = {};
|
||||
|
||||
$(window).on('action:ajaxify.start', function (ev, data) {
|
||||
if (ajaxify.currentPage !== data.url) {
|
||||
|
||||
@@ -18,7 +18,7 @@ define('forum/category', [
|
||||
});
|
||||
|
||||
Category.init = function () {
|
||||
const cid = ajaxify.data.cid;
|
||||
const cid = ajaxify.data.cid;
|
||||
|
||||
app.enterRoom('category_' + cid);
|
||||
|
||||
|
||||
@@ -43,11 +43,11 @@ define('forum/ip-blacklist', ['Chart', 'benchpress', 'bootbox'], function (Chart
|
||||
|
||||
Blacklist.setupAnalytics = function () {
|
||||
const hourlyCanvas = document.getElementById('blacklist:hourly');
|
||||
const dailyCanvas = document.getElementById('blacklist:daily');
|
||||
const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
|
||||
const dailyCanvas = document.getElementById('blacklist:daily');
|
||||
const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
|
||||
return idx % 3 ? '' : text;
|
||||
});
|
||||
const dailyLabels = utils.getDaysArray().slice(-7).map(function (text, idx) {
|
||||
const dailyLabels = utils.getDaysArray().slice(-7).map(function (text, idx) {
|
||||
return idx % 3 ? '' : text;
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/login', ['hooks', 'translator', 'jquery-form'], function (hooks, translator) {
|
||||
const Login = {
|
||||
const Login = {
|
||||
_capsState: false,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
define('forum/recent', ['topicList'], function (topicList) {
|
||||
const Recent = {};
|
||||
const Recent = {};
|
||||
|
||||
Recent.init = function () {
|
||||
app.enterRoom('recent_topics');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/reset', function () {
|
||||
const ResetPassword = {};
|
||||
const ResetPassword = {};
|
||||
|
||||
ResetPassword.init = function () {
|
||||
const inputEl = $('#email');
|
||||
|
||||
@@ -7,7 +7,7 @@ define('forum/search', [
|
||||
'storage',
|
||||
'hooks',
|
||||
], function (searchModule, autocomplete, storage, hooks) {
|
||||
const Search = {};
|
||||
const Search = {};
|
||||
|
||||
Search.init = function () {
|
||||
const searchQuery = $('#results').attr('data-search-query');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
define('forum/top', ['topicList'], function (topicList) {
|
||||
const Top = {};
|
||||
const Top = {};
|
||||
|
||||
Top.init = function () {
|
||||
app.enterRoom('top_topics');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
define('forum/users', [
|
||||
'translator', 'benchpress', 'api', 'accounts/invite',
|
||||
], function (translator, Benchpress, api, AccountInvite) {
|
||||
const Users = {};
|
||||
const Users = {};
|
||||
|
||||
let searchResultCount = 0;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
|
||||
$(document.body).append(self.taskbar);
|
||||
|
||||
self.taskbar.on('click', 'li', function () {
|
||||
const $btn = $(this);
|
||||
const $btn = $(this);
|
||||
const module = $btn.attr('data-module');
|
||||
const uuid = $btn.attr('data-uuid');
|
||||
|
||||
@@ -121,7 +121,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
|
||||
};
|
||||
|
||||
taskbar.updateActive = function (uuid) {
|
||||
const tasks = taskbar.tasklist.find('li');
|
||||
const tasks = taskbar.tasklist.find('li');
|
||||
tasks.removeClass('active');
|
||||
tasks.filter('[data-uuid="' + uuid + '"]').addClass('active');
|
||||
|
||||
@@ -135,7 +135,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
|
||||
};
|
||||
|
||||
function update() {
|
||||
const tasks = taskbar.tasklist.find('li');
|
||||
const tasks = taskbar.tasklist.find('li');
|
||||
|
||||
if (tasks.length > 0) {
|
||||
taskbar.taskbar.attr('data-active', '1');
|
||||
@@ -152,7 +152,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
|
||||
translator.translate(data.options.title, function (taskTitle) {
|
||||
const title = $('<div></div>').text(taskTitle || 'NodeBB Task').html();
|
||||
|
||||
const taskbarEl = $('<li></li>')
|
||||
const taskbarEl = $('<li></li>')
|
||||
.addClass(data.options.className)
|
||||
.html('<a href="#"' + (data.options.image ? ' style="background-image: url(\'' + data.options.image + '\'); background-size: cover;"' : '') + '>' +
|
||||
(data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const assert = require('assert');
|
||||
const assert = require('assert');
|
||||
const nconf = require('nconf');
|
||||
const db = require('./mocks/databasemock');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const async = require('async');
|
||||
const async = require('async');
|
||||
const assert = require('assert');
|
||||
const db = require('../mocks/databasemock');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const async = require('async');
|
||||
const async = require('async');
|
||||
const assert = require('assert');
|
||||
const db = require('../mocks/databasemock');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const async = require('async');
|
||||
const async = require('async');
|
||||
const assert = require('assert');
|
||||
const db = require('../mocks/databasemock');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const async = require('async');
|
||||
const async = require('async');
|
||||
const assert = require('assert');
|
||||
const db = require('../mocks/databasemock');
|
||||
|
||||
|
||||
@@ -752,7 +752,7 @@ describe('Groups', () => {
|
||||
Groups.leaveAllGroups(testUid, (err) => {
|
||||
assert.ifError(err);
|
||||
|
||||
const groups = ['Test', 'Hidden'];
|
||||
const groups = ['Test', 'Hidden'];
|
||||
async.every(groups, (group, next) => {
|
||||
Groups.isMember(testUid, group, (err, isMember) => {
|
||||
next(err, !isMember);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const assert = require('assert');
|
||||
const nconf = require('nconf');
|
||||
const request = require('request');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const assert = require('assert');
|
||||
const assert = require('assert');
|
||||
const pagination = require('../src/pagination');
|
||||
|
||||
describe('Pagination', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
const assert = require('assert');
|
||||
const assert = require('assert');
|
||||
const async = require('async');
|
||||
const request = require('request');
|
||||
const nconf = require('nconf');
|
||||
|
||||
@@ -313,7 +313,7 @@ describe('Topic\'s', () => {
|
||||
});
|
||||
|
||||
describe('Get methods', () => {
|
||||
let newTopic;
|
||||
let newTopic;
|
||||
let newPost;
|
||||
|
||||
before((done) => {
|
||||
|
||||
Reference in New Issue
Block a user