refactor: remove tabs after declaration

isekai-main
Barış Soner Uşaklı 3 years ago
parent 0532c1b2a1
commit 4359e5c97c

@ -209,7 +209,7 @@ fs.open(pathToConfig, 'r', (err) => {
if (nconf.get('daemon') !== 'false' && nconf.get('daemon') !== false) { if (nconf.get('daemon') !== 'false' && nconf.get('daemon') !== false) {
if (file.existsSync(pidFilePath)) { if (file.existsSync(pidFilePath)) {
try { try {
const pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' }); const pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
process.kill(pid, 0); process.kill(pid, 0);
process.exit(); process.exit();
} catch (e) { } catch (e) {

@ -2,7 +2,7 @@
define('admin/advanced/logs', function () { define('admin/advanced/logs', function () {
const Logs = {}; const Logs = {};
Logs.init = function () { Logs.init = function () {
const logsEl = $('.logs pre'); const logsEl = $('.logs pre');

@ -2,17 +2,17 @@
define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], function (Chart, translator, Benchpress, bootbox) { define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], function (Chart, translator, Benchpress, bootbox) {
const Admin = {}; const Admin = {};
const intervals = { const intervals = {
rooms: false, rooms: false,
graphs: false, graphs: false,
}; };
let isMobile = false; let isMobile = false;
const graphData = { const graphData = {
rooms: {}, rooms: {},
traffic: {}, traffic: {},
}; };
const currentGraph = { const currentGraph = {
units: 'hours', units: 'hours',
until: undefined, until: undefined,
}; };
@ -23,7 +23,7 @@ define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], func
realtimeInterval: 1500, realtimeInterval: 1500,
}; };
const usedTopicColors = []; const usedTopicColors = [];
$(window).on('action:ajaxify.start', function () { $(window).on('action:ajaxify.start', function () {
clearInterval(intervals.rooms); clearInterval(intervals.rooms);
@ -520,7 +520,7 @@ define('admin/dashboard', ['Chart', 'translator', 'benchpress', 'bootbox'], func
let html = ''; let html = '';
topics.forEach(function (t, i) { 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 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>' + html += '<li>' +
'<div style="background-color: ' + topicColors[i] + ';"></div>' + '<div style="background-color: ' + topicColors[i] + ';"></div>' +

@ -8,7 +8,7 @@ define('admin/manage/categories', [
'Sortable', 'Sortable',
'bootbox', 'bootbox',
], function (translator, Benchpress, categorySelector, api, Sortable, bootbox) { ], function (translator, Benchpress, categorySelector, api, Sortable, bootbox) {
const Categories = {}; const Categories = {};
let newCategoryId = -1; let newCategoryId = -1;
let sortables; let sortables;

@ -6,13 +6,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) {
CategoryAnalytics.init = function () { CategoryAnalytics.init = function () {
const hourlyCanvas = document.getElementById('pageviews:hourly'); const hourlyCanvas = document.getElementById('pageviews:hourly');
const dailyCanvas = document.getElementById('pageviews:daily'); const dailyCanvas = document.getElementById('pageviews:daily');
const topicsCanvas = document.getElementById('topics:daily'); const topicsCanvas = document.getElementById('topics:daily');
const postsCanvas = document.getElementById('posts:daily'); const postsCanvas = document.getElementById('posts:daily');
const hourlyLabels = utils.getHoursArray().map(function (text, idx) { const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
return idx % 3 ? '' : text; return idx % 3 ? '' : text;
}); });
const dailyLabels = utils.getDaysArray().map(function (text, idx) { const dailyLabels = utils.getDaysArray().map(function (text, idx) {
return idx % 3 ? '' : text; return idx % 3 ? '' : text;
}); });

@ -8,7 +8,7 @@ define('admin/manage/category', [
'api', 'api',
'bootbox', 'bootbox',
], function (uploader, iconSelect, categorySelector, Benchpress, api, bootbox) { ], function (uploader, iconSelect, categorySelector, Benchpress, api, bootbox) {
const Category = {}; const Category = {};
let updateHash = {}; let updateHash = {};
Category.init = function () { Category.init = function () {

@ -6,10 +6,10 @@ define('admin/manage/groups', [
'api', 'api',
'bootbox', 'bootbox',
], function (categorySelector, slugify, api, bootbox) { ], function (categorySelector, slugify, api, bootbox) {
const Groups = {}; const Groups = {};
Groups.init = function () { Groups.init = function () {
const createModal = $('#create-modal'); const createModal = $('#create-modal');
const createGroupName = $('#create-group-name'); const createGroupName = $('#create-group-name');
const createModalGo = $('#create-modal-go'); const createModalGo = $('#create-modal-go');
const createModalError = $('#create-modal-error'); const createModalError = $('#create-modal-error');

@ -6,7 +6,7 @@ define('admin/manage/tags', [
'forum/infinitescroll', 'forum/infinitescroll',
'admin/modules/selectable', 'admin/modules/selectable',
], function (bootbox, infinitescroll, selectable) { ], function (bootbox, infinitescroll, selectable) {
const Tags = {}; const Tags = {};
Tags.init = function () { Tags.init = function () {
selectable.enable('.tag-management', '.tag-row'); selectable.enable('.tag-management', '.tag-row');

@ -30,9 +30,9 @@ define('admin/settings', ['uploader', 'mousetrap', 'hooks'], function (uploader,
Settings.prepare = function (callback) { Settings.prepare = function (callback) {
// Populate the fields on the page from the config // Populate the fields on the page from the config
const fields = $('#content [data-field]'); const fields = $('#content [data-field]');
const numFields = fields.length; const numFields = fields.length;
const saveBtn = $('#save'); const saveBtn = $('#save');
const revertBtn = $('#revert'); const revertBtn = $('#revert');
let x; let x;
let key; let key;
let inputType; let inputType;

@ -3,7 +3,7 @@
define('admin/settings/notifications', [ define('admin/settings/notifications', [
'autocomplete', 'autocomplete',
], function (autocomplete) { ], function (autocomplete) {
const Notifications = {}; const Notifications = {};
Notifications.init = function () { Notifications.init = function () {
const searchInput = $('[data-field="welcomeUid"]'); const searchInput = $('[data-field="welcomeUid"]');

@ -2,7 +2,7 @@
define('forum/account/followers', ['forum/account/header'], function (header) { define('forum/account/followers', ['forum/account/header'], function (header) {
const Followers = {}; const Followers = {};
Followers.init = function () { Followers.init = function () {
header.init(); header.init();

@ -2,7 +2,7 @@
define('forum/account/following', ['forum/account/header'], function (header) { define('forum/account/following', ['forum/account/header'], function (header) {
const Following = {}; const Following = {};
Following.init = function () { Following.init = function () {
header.init(); header.init();

@ -2,7 +2,7 @@
define('forum/account/settings', ['forum/account/header', 'components', 'translator', 'api'], function (header, components, translator, api) { 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 // If page skin is changed but not saved, switch the skin back
$(window).on('action:ajaxify.start', function () { $(window).on('action:ajaxify.start', function () {

@ -2,7 +2,7 @@
define('forum/categories', ['components', 'categorySelector', 'hooks'], function (components, categorySelector, hooks) { define('forum/categories', ['components', 'categorySelector', 'hooks'], function (components, categorySelector, hooks) {
const categories = {}; const categories = {};
$(window).on('action:ajaxify.start', function (ev, data) { $(window).on('action:ajaxify.start', function (ev, data) {
if (ajaxify.currentPage !== data.url) { if (ajaxify.currentPage !== data.url) {

@ -18,7 +18,7 @@ define('forum/category', [
}); });
Category.init = function () { Category.init = function () {
const cid = ajaxify.data.cid; const cid = ajaxify.data.cid;
app.enterRoom('category_' + cid); app.enterRoom('category_' + cid);

@ -43,11 +43,11 @@ define('forum/ip-blacklist', ['Chart', 'benchpress', 'bootbox'], function (Chart
Blacklist.setupAnalytics = function () { Blacklist.setupAnalytics = function () {
const hourlyCanvas = document.getElementById('blacklist:hourly'); const hourlyCanvas = document.getElementById('blacklist:hourly');
const dailyCanvas = document.getElementById('blacklist:daily'); const dailyCanvas = document.getElementById('blacklist:daily');
const hourlyLabels = utils.getHoursArray().map(function (text, idx) { const hourlyLabels = utils.getHoursArray().map(function (text, idx) {
return idx % 3 ? '' : text; 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; return idx % 3 ? '' : text;
}); });

@ -2,7 +2,7 @@
define('forum/login', ['hooks', 'translator', 'jquery-form'], function (hooks, translator) { define('forum/login', ['hooks', 'translator', 'jquery-form'], function (hooks, translator) {
const Login = { const Login = {
_capsState: false, _capsState: false,
}; };

@ -1,7 +1,7 @@
'use strict'; 'use strict';
define('forum/recent', ['topicList'], function (topicList) { define('forum/recent', ['topicList'], function (topicList) {
const Recent = {}; const Recent = {};
Recent.init = function () { Recent.init = function () {
app.enterRoom('recent_topics'); app.enterRoom('recent_topics');

@ -2,7 +2,7 @@
define('forum/reset', function () { define('forum/reset', function () {
const ResetPassword = {}; const ResetPassword = {};
ResetPassword.init = function () { ResetPassword.init = function () {
const inputEl = $('#email'); const inputEl = $('#email');

@ -7,7 +7,7 @@ define('forum/search', [
'storage', 'storage',
'hooks', 'hooks',
], function (searchModule, autocomplete, storage, hooks) { ], function (searchModule, autocomplete, storage, hooks) {
const Search = {}; const Search = {};
Search.init = function () { Search.init = function () {
const searchQuery = $('#results').attr('data-search-query'); const searchQuery = $('#results').attr('data-search-query');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
define('forum/top', ['topicList'], function (topicList) { define('forum/top', ['topicList'], function (topicList) {
const Top = {}; const Top = {};
Top.init = function () { Top.init = function () {
app.enterRoom('top_topics'); app.enterRoom('top_topics');

@ -4,7 +4,7 @@
define('forum/users', [ define('forum/users', [
'translator', 'benchpress', 'api', 'accounts/invite', 'translator', 'benchpress', 'api', 'accounts/invite',
], function (translator, Benchpress, api, AccountInvite) { ], function (translator, Benchpress, api, AccountInvite) {
const Users = {}; const Users = {};
let searchResultCount = 0; let searchResultCount = 0;

@ -13,7 +13,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
$(document.body).append(self.taskbar); $(document.body).append(self.taskbar);
self.taskbar.on('click', 'li', function () { self.taskbar.on('click', 'li', function () {
const $btn = $(this); const $btn = $(this);
const module = $btn.attr('data-module'); const module = $btn.attr('data-module');
const uuid = $btn.attr('data-uuid'); const uuid = $btn.attr('data-uuid');
@ -121,7 +121,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
}; };
taskbar.updateActive = function (uuid) { taskbar.updateActive = function (uuid) {
const tasks = taskbar.tasklist.find('li'); const tasks = taskbar.tasklist.find('li');
tasks.removeClass('active'); tasks.removeClass('active');
tasks.filter('[data-uuid="' + uuid + '"]').addClass('active'); tasks.filter('[data-uuid="' + uuid + '"]').addClass('active');
@ -135,7 +135,7 @@ define('taskbar', ['benchpress', 'translator', 'hooks'], function (Benchpress, t
}; };
function update() { function update() {
const tasks = taskbar.tasklist.find('li'); const tasks = taskbar.tasklist.find('li');
if (tasks.length > 0) { if (tasks.length > 0) {
taskbar.taskbar.attr('data-active', '1'); 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) { translator.translate(data.options.title, function (taskTitle) {
const title = $('<div></div>').text(taskTitle || 'NodeBB Task').html(); const title = $('<div></div>').text(taskTitle || 'NodeBB Task').html();
const taskbarEl = $('<li></li>') const taskbarEl = $('<li></li>')
.addClass(data.options.className) .addClass(data.options.className)
.html('<a href="#"' + (data.options.image ? ' style="background-image: url(\'' + data.options.image + '\'); background-size: cover;"' : '') + '>' + .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> ' : '') + (data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const assert = require('assert'); const assert = require('assert');
const nconf = require('nconf'); const nconf = require('nconf');
const db = require('./mocks/databasemock'); const db = require('./mocks/databasemock');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const async = require('async'); const async = require('async');
const assert = require('assert'); const assert = require('assert');
const db = require('../mocks/databasemock'); const db = require('../mocks/databasemock');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const async = require('async'); const async = require('async');
const assert = require('assert'); const assert = require('assert');
const db = require('../mocks/databasemock'); const db = require('../mocks/databasemock');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const async = require('async'); const async = require('async');
const assert = require('assert'); const assert = require('assert');
const db = require('../mocks/databasemock'); const db = require('../mocks/databasemock');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const async = require('async'); const async = require('async');
const assert = require('assert'); const assert = require('assert');
const db = require('../mocks/databasemock'); const db = require('../mocks/databasemock');

@ -752,7 +752,7 @@ describe('Groups', () => {
Groups.leaveAllGroups(testUid, (err) => { Groups.leaveAllGroups(testUid, (err) => {
assert.ifError(err); assert.ifError(err);
const groups = ['Test', 'Hidden']; const groups = ['Test', 'Hidden'];
async.every(groups, (group, next) => { async.every(groups, (group, next) => {
Groups.isMember(testUid, group, (err, isMember) => { Groups.isMember(testUid, group, (err, isMember) => {
next(err, !isMember); next(err, !isMember);

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const assert = require('assert'); const assert = require('assert');
const nconf = require('nconf'); const nconf = require('nconf');
const request = require('request'); const request = require('request');

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const assert = require('assert'); const assert = require('assert');
const pagination = require('../src/pagination'); const pagination = require('../src/pagination');
describe('Pagination', () => { describe('Pagination', () => {

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const assert = require('assert'); const assert = require('assert');
const async = require('async'); const async = require('async');
const request = require('request'); const request = require('request');
const nconf = require('nconf'); const nconf = require('nconf');

@ -313,7 +313,7 @@ describe('Topic\'s', () => {
}); });
describe('Get methods', () => { describe('Get methods', () => {
let newTopic; let newTopic;
let newPost; let newPost;
before((done) => { before((done) => {

Loading…
Cancel
Save