diff --git a/loader.js b/loader.js index bd1d463b46..8c3e47e806 100644 --- a/loader.js +++ b/loader.js @@ -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) { diff --git a/public/src/admin/advanced/logs.js b/public/src/admin/advanced/logs.js index 6a236b49e3..f752cfc126 100644 --- a/public/src/admin/advanced/logs.js +++ b/public/src/admin/advanced/logs.js @@ -2,7 +2,7 @@ define('admin/advanced/logs', function () { - const Logs = {}; + const Logs = {}; Logs.init = function () { const logsEl = $('.logs pre'); diff --git a/public/src/admin/dashboard.js b/public/src/admin/dashboard.js index 645023b563..0e3c58f3f0 100644 --- a/public/src/admin/dashboard.js +++ b/public/src/admin/dashboard.js @@ -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 ? ' ' + t.title + '' : t.title; - const label = t.count === '0' ? t.title : link; + const label = t.count === '0' ? t.title : link; html += '
  • ' + '
    ' + diff --git a/public/src/admin/manage/categories.js b/public/src/admin/manage/categories.js index 23c85892a4..9120a52c23 100644 --- a/public/src/admin/manage/categories.js +++ b/public/src/admin/manage/categories.js @@ -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; diff --git a/public/src/admin/manage/category-analytics.js b/public/src/admin/manage/category-analytics.js index 6a283ef43f..a4366d07d1 100644 --- a/public/src/admin/manage/category-analytics.js +++ b/public/src/admin/manage/category-analytics.js @@ -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; }); diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index 10f665ecab..6dc849aee7 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -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 () { diff --git a/public/src/admin/manage/groups.js b/public/src/admin/manage/groups.js index 10867bede5..576b7293ce 100644 --- a/public/src/admin/manage/groups.js +++ b/public/src/admin/manage/groups.js @@ -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'); diff --git a/public/src/admin/manage/tags.js b/public/src/admin/manage/tags.js index 836c8f7be9..4e30620f15 100644 --- a/public/src/admin/manage/tags.js +++ b/public/src/admin/manage/tags.js @@ -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'); diff --git a/public/src/admin/settings.js b/public/src/admin/settings.js index c7166305a0..6b5a5c717f 100644 --- a/public/src/admin/settings.js +++ b/public/src/admin/settings.js @@ -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; diff --git a/public/src/admin/settings/notifications.js b/public/src/admin/settings/notifications.js index 9235478482..af86b2ce59 100644 --- a/public/src/admin/settings/notifications.js +++ b/public/src/admin/settings/notifications.js @@ -3,7 +3,7 @@ define('admin/settings/notifications', [ 'autocomplete', ], function (autocomplete) { - const Notifications = {}; + const Notifications = {}; Notifications.init = function () { const searchInput = $('[data-field="welcomeUid"]'); diff --git a/public/src/client/account/followers.js b/public/src/client/account/followers.js index 89b67561d8..b9b78d0f6e 100644 --- a/public/src/client/account/followers.js +++ b/public/src/client/account/followers.js @@ -2,7 +2,7 @@ define('forum/account/followers', ['forum/account/header'], function (header) { - const Followers = {}; + const Followers = {}; Followers.init = function () { header.init(); diff --git a/public/src/client/account/following.js b/public/src/client/account/following.js index 8bc5c92614..083b153c51 100644 --- a/public/src/client/account/following.js +++ b/public/src/client/account/following.js @@ -2,7 +2,7 @@ define('forum/account/following', ['forum/account/header'], function (header) { - const Following = {}; + const Following = {}; Following.init = function () { header.init(); diff --git a/public/src/client/account/settings.js b/public/src/client/account/settings.js index 995fbbd4b6..c5f2d8ae75 100644 --- a/public/src/client/account/settings.js +++ b/public/src/client/account/settings.js @@ -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 () { diff --git a/public/src/client/categories.js b/public/src/client/categories.js index 04010f5554..f07730278f 100644 --- a/public/src/client/categories.js +++ b/public/src/client/categories.js @@ -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) { diff --git a/public/src/client/category.js b/public/src/client/category.js index da8a6296cf..f318f6e25b 100644 --- a/public/src/client/category.js +++ b/public/src/client/category.js @@ -18,7 +18,7 @@ define('forum/category', [ }); Category.init = function () { - const cid = ajaxify.data.cid; + const cid = ajaxify.data.cid; app.enterRoom('category_' + cid); diff --git a/public/src/client/ip-blacklist.js b/public/src/client/ip-blacklist.js index 624fe70ee5..55ddbd42d5 100644 --- a/public/src/client/ip-blacklist.js +++ b/public/src/client/ip-blacklist.js @@ -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; }); diff --git a/public/src/client/login.js b/public/src/client/login.js index 9b130a4939..1a09f09e25 100644 --- a/public/src/client/login.js +++ b/public/src/client/login.js @@ -2,7 +2,7 @@ define('forum/login', ['hooks', 'translator', 'jquery-form'], function (hooks, translator) { - const Login = { + const Login = { _capsState: false, }; diff --git a/public/src/client/recent.js b/public/src/client/recent.js index 9d0a9904a2..af039cd1d2 100644 --- a/public/src/client/recent.js +++ b/public/src/client/recent.js @@ -1,7 +1,7 @@ 'use strict'; define('forum/recent', ['topicList'], function (topicList) { - const Recent = {}; + const Recent = {}; Recent.init = function () { app.enterRoom('recent_topics'); diff --git a/public/src/client/reset.js b/public/src/client/reset.js index 0c2f4d6066..43289da1c8 100644 --- a/public/src/client/reset.js +++ b/public/src/client/reset.js @@ -2,7 +2,7 @@ define('forum/reset', function () { - const ResetPassword = {}; + const ResetPassword = {}; ResetPassword.init = function () { const inputEl = $('#email'); diff --git a/public/src/client/search.js b/public/src/client/search.js index ac0d1ccfb1..8be674432c 100644 --- a/public/src/client/search.js +++ b/public/src/client/search.js @@ -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'); diff --git a/public/src/client/top.js b/public/src/client/top.js index b2eb44e99f..785255d001 100644 --- a/public/src/client/top.js +++ b/public/src/client/top.js @@ -1,7 +1,7 @@ 'use strict'; define('forum/top', ['topicList'], function (topicList) { - const Top = {}; + const Top = {}; Top.init = function () { app.enterRoom('top_topics'); diff --git a/public/src/client/users.js b/public/src/client/users.js index 2b732c7632..4973216a71 100644 --- a/public/src/client/users.js +++ b/public/src/client/users.js @@ -4,7 +4,7 @@ define('forum/users', [ 'translator', 'benchpress', 'api', 'accounts/invite', ], function (translator, Benchpress, api, AccountInvite) { - const Users = {}; + const Users = {}; let searchResultCount = 0; diff --git a/public/src/modules/taskbar.js b/public/src/modules/taskbar.js index ce811bc046..87fc2ad1c6 100644 --- a/public/src/modules/taskbar.js +++ b/public/src/modules/taskbar.js @@ -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 = $('
    ').text(taskTitle || 'NodeBB Task').html(); - const taskbarEl = $('
  • ') + const taskbarEl = $('
  • ') .addClass(data.options.className) .html('' + (data.options.icon ? ' ' : '') + diff --git a/test/database.js b/test/database.js index 0d3f73b34e..baede9f72b 100644 --- a/test/database.js +++ b/test/database.js @@ -1,7 +1,7 @@ 'use strict'; -const assert = require('assert'); +const assert = require('assert'); const nconf = require('nconf'); const db = require('./mocks/databasemock'); diff --git a/test/database/keys.js b/test/database/keys.js index ef4afc8857..3941edb65a 100644 --- a/test/database/keys.js +++ b/test/database/keys.js @@ -1,7 +1,7 @@ 'use strict'; -const async = require('async'); +const async = require('async'); const assert = require('assert'); const db = require('../mocks/databasemock'); diff --git a/test/database/list.js b/test/database/list.js index f6f500f2f7..663ed7695e 100644 --- a/test/database/list.js +++ b/test/database/list.js @@ -1,7 +1,7 @@ 'use strict'; -const async = require('async'); +const async = require('async'); const assert = require('assert'); const db = require('../mocks/databasemock'); diff --git a/test/database/sets.js b/test/database/sets.js index 35608c018b..eae737c688 100644 --- a/test/database/sets.js +++ b/test/database/sets.js @@ -1,7 +1,7 @@ 'use strict'; -const async = require('async'); +const async = require('async'); const assert = require('assert'); const db = require('../mocks/databasemock'); diff --git a/test/database/sorted.js b/test/database/sorted.js index ede6cc8c5d..8a25818017 100644 --- a/test/database/sorted.js +++ b/test/database/sorted.js @@ -1,7 +1,7 @@ 'use strict'; -const async = require('async'); +const async = require('async'); const assert = require('assert'); const db = require('../mocks/databasemock'); diff --git a/test/groups.js b/test/groups.js index c4d5149e03..98aadadd98 100644 --- a/test/groups.js +++ b/test/groups.js @@ -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); diff --git a/test/locale-detect.js b/test/locale-detect.js index 3f6bfaf5db..91c3e94194 100644 --- a/test/locale-detect.js +++ b/test/locale-detect.js @@ -1,6 +1,6 @@ 'use strict'; -const assert = require('assert'); +const assert = require('assert'); const nconf = require('nconf'); const request = require('request'); diff --git a/test/pagination.js b/test/pagination.js index ef86871014..3073728d8d 100644 --- a/test/pagination.js +++ b/test/pagination.js @@ -1,7 +1,7 @@ 'use strict'; -const assert = require('assert'); +const assert = require('assert'); const pagination = require('../src/pagination'); describe('Pagination', () => { diff --git a/test/search.js b/test/search.js index ee28dd3956..b58702bb38 100644 --- a/test/search.js +++ b/test/search.js @@ -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'); diff --git a/test/topics.js b/test/topics.js index a8cad19d1c..dc48d829c3 100644 --- a/test/topics.js +++ b/test/topics.js @@ -313,7 +313,7 @@ describe('Topic\'s', () => { }); describe('Get methods', () => { - let newTopic; + let newTopic; let newPost; before((done) => {