mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
ESlint quote-props
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
"prefer-rest-params": "off",
|
||||
"space-in-parens": "off",
|
||||
"block-spacing": "off",
|
||||
"quote-props": "off",
|
||||
// "quote-props": "off",
|
||||
// "space-unary-ops": "off",
|
||||
// "no-plusplus": "off",
|
||||
// "no-empty": "off",
|
||||
|
||||
@@ -179,10 +179,10 @@
|
||||
var env = utils.findBootstrapEnvironment();
|
||||
|
||||
var slideout = new Slideout({
|
||||
'panel': document.getElementById('panel'),
|
||||
'menu': document.getElementById('menu'),
|
||||
'padding': 256,
|
||||
'tolerance': 70,
|
||||
panel: document.getElementById('panel'),
|
||||
menu: document.getElementById('menu'),
|
||||
padding: 256,
|
||||
tolerance: 70,
|
||||
});
|
||||
|
||||
if (env === 'md' || env === 'lg') {
|
||||
@@ -205,20 +205,20 @@
|
||||
if (env === 'md' || env === 'lg') {
|
||||
slideout.disableTouch();
|
||||
$('#header').css({
|
||||
'position': 'relative',
|
||||
position: 'relative',
|
||||
});
|
||||
} else {
|
||||
slideout.enableTouch();
|
||||
$('#header').css({
|
||||
'position': 'fixed',
|
||||
position: 'fixed',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function onOpeningMenu() {
|
||||
$('#header').css({
|
||||
'top': $('#panel').position().top * -1 + 'px',
|
||||
'position': 'absolute',
|
||||
top: $('#panel').position().top * -1 + 'px',
|
||||
position: 'absolute',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -226,8 +226,8 @@
|
||||
|
||||
slideout.on('close', function () {
|
||||
$('#header').css({
|
||||
'top': '0px',
|
||||
'position': 'fixed',
|
||||
top: '0px',
|
||||
position: 'fixed',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl
|
||||
},
|
||||
],
|
||||
},
|
||||
'toobusy': {
|
||||
toobusy: {
|
||||
labels: dailyLabels,
|
||||
datasets: [
|
||||
{
|
||||
|
||||
@@ -374,7 +374,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s
|
||||
|
||||
function updateTopicsGraph(topics) {
|
||||
if (!Object.keys(topics).length) {
|
||||
topics = {"0": {
|
||||
topics = {0: {
|
||||
title: "No users browsing",
|
||||
value: 1,
|
||||
}};
|
||||
|
||||
@@ -63,9 +63,9 @@ define('forum/account/edit/password', ['forum/account/header', 'translator'], fu
|
||||
if ((passwordvalid && passwordsmatch) || app.user.isAdmin) {
|
||||
btn.addClass('disabled').find('i').removeClass('hide');
|
||||
socket.emit('user.changePassword', {
|
||||
'currentPassword': currentPassword.val(),
|
||||
'newPassword': password.val(),
|
||||
'uid': ajaxify.data.theirid,
|
||||
currentPassword: currentPassword.val(),
|
||||
newPassword: password.val(),
|
||||
uid: ajaxify.data.theirid,
|
||||
}, function (err) {
|
||||
btn.removeClass('disabled').find('i').addClass('hide');
|
||||
currentPassword.val('');
|
||||
|
||||
@@ -321,7 +321,7 @@ define('forum/chats', [
|
||||
} else {
|
||||
var recentEl = components.get('chat/recent');
|
||||
templates.parse('partials/chats/recent_room', {
|
||||
rooms: { "roomId": data.roomId, "lastUser": data.message.fromUser, "usernames": data.message.fromUser.username, "unread": true },
|
||||
rooms: { roomId: data.roomId, lastUser: data.message.fromUser, usernames: data.message.fromUser.username, unread: true },
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translated) {
|
||||
recentEl.prepend(translated);
|
||||
|
||||
@@ -279,8 +279,8 @@ define('forum/topic', [
|
||||
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) {
|
||||
if (app.user.uid) {
|
||||
socket.emit('topics.bookmark', {
|
||||
'tid': ajaxify.data.tid,
|
||||
'index': index,
|
||||
tid: ajaxify.data.tid,
|
||||
index: index,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -42,7 +42,7 @@ $('document').ready(function () {
|
||||
|
||||
if ($('form .admin .error').length) {
|
||||
ev.preventDefault();
|
||||
$('html, body').animate({'scrollTop': '0px'}, 400);
|
||||
$('html, body').animate({scrollTop: '0px'}, 400);
|
||||
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -10,10 +10,10 @@ define('components', function () {
|
||||
return $('[component="topic/teaser"]');
|
||||
}
|
||||
},
|
||||
'topic': function (name, value) {
|
||||
topic: function (name, value) {
|
||||
return $('[component="topic"][data-' + name + '="' + value + '"]');
|
||||
},
|
||||
'post': function (name, value) {
|
||||
post: function (name, value) {
|
||||
return $('[component="post"][data-' + name + '="' + value + '"]');
|
||||
},
|
||||
'post/content': function (pid) {
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
@@ -12,7 +12,7 @@ define('settings/array', function () {
|
||||
*/
|
||||
function createRemoveButton(elements) {
|
||||
var rm = $(helper.createElement('button', {
|
||||
"class": 'btn btn-xs btn-primary remove',
|
||||
class: 'btn btn-xs btn-primary remove',
|
||||
title: 'Remove Item',
|
||||
}, '-'));
|
||||
rm.click(function (event) {
|
||||
@@ -75,7 +75,7 @@ define('settings/array', function () {
|
||||
var addSpace = $(document.createTextNode(' '));
|
||||
var newValue = element.data('new') || '';
|
||||
var add = $(helper.createElement('button', {
|
||||
"class": 'btn btn-sm btn-primary add',
|
||||
class: 'btn btn-sm btn-primary add',
|
||||
title: 'Expand Array',
|
||||
}, '+'));
|
||||
add.click(function (event) {
|
||||
|
||||
@@ -3,9 +3,9 @@ require.config({
|
||||
waitSeconds: 7,
|
||||
urlArgs: config['cache-buster'],
|
||||
paths: {
|
||||
'forum': '../client',
|
||||
'admin': '../admin',
|
||||
'vendor': '../../vendor',
|
||||
'plugins': '../../plugins',
|
||||
forum: '../client',
|
||||
admin: '../admin',
|
||||
vendor: '../../vendor',
|
||||
plugins: '../../plugins',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -165,29 +165,29 @@
|
||||
},
|
||||
|
||||
extensionMimeTypeMap: {
|
||||
"bmp": "image/bmp",
|
||||
"cmx": "image/x-cmx",
|
||||
"cod": "image/cis-cod",
|
||||
"gif": "image/gif",
|
||||
"ico": "image/x-icon",
|
||||
"ief": "image/ief",
|
||||
"jfif": "image/pipeg",
|
||||
"jpe": "image/jpeg",
|
||||
"jpeg": "image/jpeg",
|
||||
"jpg": "image/jpeg",
|
||||
"png": "image/png",
|
||||
"pbm": "image/x-portable-bitmap",
|
||||
"pgm": "image/x-portable-graymap",
|
||||
"pnm": "image/x-portable-anymap",
|
||||
"ppm": "image/x-portable-pixmap",
|
||||
"ras": "image/x-cmu-raster",
|
||||
"rgb": "image/x-rgb",
|
||||
"svg": "image/svg+xml",
|
||||
"tif": "image/tiff",
|
||||
"tiff": "image/tiff",
|
||||
"xbm": "image/x-xbitmap",
|
||||
"xpm": "image/x-xpixmap",
|
||||
"xwd": "image/x-xwindowdump",
|
||||
bmp: "image/bmp",
|
||||
cmx: "image/x-cmx",
|
||||
cod: "image/cis-cod",
|
||||
gif: "image/gif",
|
||||
ico: "image/x-icon",
|
||||
ief: "image/ief",
|
||||
jfif: "image/pipeg",
|
||||
jpe: "image/jpeg",
|
||||
jpeg: "image/jpeg",
|
||||
jpg: "image/jpeg",
|
||||
png: "image/png",
|
||||
pbm: "image/x-portable-bitmap",
|
||||
pgm: "image/x-portable-graymap",
|
||||
pnm: "image/x-portable-anymap",
|
||||
ppm: "image/x-portable-pixmap",
|
||||
ras: "image/x-cmu-raster",
|
||||
rgb: "image/x-rgb",
|
||||
svg: "image/svg+xml",
|
||||
tif: "image/tiff",
|
||||
tiff: "image/tiff",
|
||||
xbm: "image/x-xbitmap",
|
||||
xpm: "image/x-xpixmap",
|
||||
xwd: "image/x-xwindowdump",
|
||||
},
|
||||
|
||||
fileMimeType: function (path) {
|
||||
|
||||
@@ -194,7 +194,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);
|
||||
};
|
||||
|
||||
|
||||
@@ -51,9 +51,9 @@ settingsController.get = function (req, res, callback) {
|
||||
userData.homePageRoutes = results.homePageRoutes;
|
||||
|
||||
var soundSettings = {
|
||||
'notificationSound': 'notification',
|
||||
'incomingChatSound': 'chat-incoming',
|
||||
'outgoingChatSound': 'chat-outgoing',
|
||||
notificationSound: 'notification',
|
||||
incomingChatSound: 'chat-incoming',
|
||||
outgoingChatSound: 'chat-outgoing',
|
||||
};
|
||||
|
||||
Object.keys(soundSettings).forEach(function (setting) {
|
||||
@@ -83,23 +83,23 @@ settingsController.get = function (req, res, callback) {
|
||||
|
||||
|
||||
userData.bootswatchSkinOptions = [
|
||||
{ "name": "Default", "value": "default" },
|
||||
{ "name": "Cerulean", "value": "cerulean" },
|
||||
{ "name": "Cosmo", "value": "cosmo" },
|
||||
{ "name": "Cyborg", "value": "cyborg" },
|
||||
{ "name": "Darkly", "value": "darkly" },
|
||||
{ "name": "Flatly", "value": "flatly" },
|
||||
{ "name": "Journal", "value": "journal" },
|
||||
{ "name": "Lumen", "value": "lumen" },
|
||||
{ "name": "Paper", "value": "paper" },
|
||||
{ "name": "Readable", "value": "readable" },
|
||||
{ "name": "Sandstone", "value": "sandstone" },
|
||||
{ "name": "Simplex", "value": "simplex" },
|
||||
{ "name": "Slate", "value": "slate" },
|
||||
{ "name": "Spacelab", "value": "spacelab" },
|
||||
{ "name": "Superhero", "value": "superhero" },
|
||||
{ "name": "United", "value": "united" },
|
||||
{ "name": "Yeti", "value": "yeti" },
|
||||
{ name: "Default", value: "default" },
|
||||
{ name: "Cerulean", value: "cerulean" },
|
||||
{ name: "Cosmo", value: "cosmo" },
|
||||
{ name: "Cyborg", value: "cyborg" },
|
||||
{ name: "Darkly", value: "darkly" },
|
||||
{ name: "Flatly", value: "flatly" },
|
||||
{ name: "Journal", value: "journal" },
|
||||
{ name: "Lumen", value: "lumen" },
|
||||
{ name: "Paper", value: "paper" },
|
||||
{ name: "Readable", value: "readable" },
|
||||
{ name: "Sandstone", value: "sandstone" },
|
||||
{ name: "Simplex", value: "simplex" },
|
||||
{ name: "Slate", value: "slate" },
|
||||
{ name: "Spacelab", value: "spacelab" },
|
||||
{ name: "Superhero", value: "superhero" },
|
||||
{ name: "United", value: "united" },
|
||||
{ name: "Yeti", value: "yeti" },
|
||||
];
|
||||
|
||||
var isCustom = true;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -13,7 +13,7 @@ var pagination = require('../pagination');
|
||||
|
||||
var recentController = {};
|
||||
|
||||
var validFilter = {'': true, 'new': true, 'watched': true};
|
||||
var validFilter = {'': true, new: true, watched: true};
|
||||
|
||||
recentController.get = function (req, res, next) {
|
||||
var page = parseInt(req.query.page, 10) || 1;
|
||||
|
||||
@@ -12,7 +12,7 @@ var helpers = require('./helpers');
|
||||
|
||||
var unreadController = {};
|
||||
|
||||
var validFilter = {'': true, 'new': true, 'watched': true};
|
||||
var validFilter = {'': true, new: true, watched: true};
|
||||
|
||||
unreadController.get = function (req, res, next) {
|
||||
var page = parseInt(req.query.page, 10) || 1;
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
{
|
||||
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',
|
||||
@@ -39,7 +39,7 @@
|
||||
{
|
||||
name: "mongo:database",
|
||||
description: "MongoDB database name",
|
||||
'default': nconf.get('mongo:database') || 'nodebb',
|
||||
default: nconf.get('mongo:database') || 'nodebb',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -189,10 +189,10 @@
|
||||
}
|
||||
async.parallel({
|
||||
serverStatus: function (next) {
|
||||
db.command({ 'serverStatus': 1 }, next);
|
||||
db.command({ serverStatus: 1 }, next);
|
||||
},
|
||||
stats: function (next) {
|
||||
db.command({ 'dbStats': 1 }, next);
|
||||
db.command({ dbStats: 1 }, next);
|
||||
},
|
||||
listCollections: function (next) {
|
||||
db.listCollections().toArray(function (err, items) {
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
{
|
||||
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',
|
||||
@@ -31,7 +31,7 @@
|
||||
{
|
||||
name: "redis:database",
|
||||
description: "Which database to use (0..n)",
|
||||
'default': nconf.get('redis:database') || 0,
|
||||
default: nconf.get('redis:database') || 0,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ questions.main = [
|
||||
{
|
||||
name: 'url',
|
||||
description: 'URL used to access this NodeBB',
|
||||
'default':
|
||||
default:
|
||||
nconf.get('url') ||
|
||||
(nconf.get('base_url') ? (nconf.get('base_url') + (nconf.get('use_port') ? ':' + nconf.get('port') : '')) : null) || // backwards compatibility (remove for v0.7.0)
|
||||
'http://localhost:4567',
|
||||
@@ -25,12 +25,12 @@ 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',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ module.exports = function (middleware) {
|
||||
|
||||
middleware.admin.renderHeader = function (req, res, data, next) {
|
||||
var custom_header = {
|
||||
'plugins': [],
|
||||
'authentication': [],
|
||||
plugins: [],
|
||||
authentication: [],
|
||||
};
|
||||
|
||||
user.getUserFields(req.uid, ['username', 'userslug', 'email', 'picture', 'email:confirmed'], function (err, userData) {
|
||||
|
||||
@@ -38,12 +38,12 @@ module.exports = function (Posts) {
|
||||
function (pid, next) {
|
||||
|
||||
postData = {
|
||||
'pid': pid,
|
||||
'uid': uid,
|
||||
'tid': tid,
|
||||
'content': content,
|
||||
'timestamp': timestamp,
|
||||
'deleted': 0,
|
||||
pid: pid,
|
||||
uid: uid,
|
||||
tid: tid,
|
||||
content: content,
|
||||
timestamp: timestamp,
|
||||
deleted: 0,
|
||||
};
|
||||
|
||||
if (data.toPid) {
|
||||
|
||||
@@ -30,19 +30,19 @@ module.exports = function (Topics) {
|
||||
},
|
||||
function (tid, next) {
|
||||
topicData = {
|
||||
'tid': tid,
|
||||
'uid': data.uid,
|
||||
'cid': data.cid,
|
||||
'mainPid': 0,
|
||||
'title': data.title,
|
||||
'slug': tid + '/' + (utils.slugify(data.title) || 'topic'),
|
||||
'timestamp': timestamp,
|
||||
'lastposttime': 0,
|
||||
'postcount': 0,
|
||||
'viewcount': 0,
|
||||
'locked': 0,
|
||||
'deleted': 0,
|
||||
'pinned': 0,
|
||||
tid: tid,
|
||||
uid: data.uid,
|
||||
cid: data.cid,
|
||||
mainPid: 0,
|
||||
title: data.title,
|
||||
slug: tid + '/' + (utils.slugify(data.title) || 'topic'),
|
||||
timestamp: timestamp,
|
||||
lastposttime: 0,
|
||||
postcount: 0,
|
||||
viewcount: 0,
|
||||
locked: 0,
|
||||
deleted: 0,
|
||||
pinned: 0,
|
||||
};
|
||||
|
||||
if (data.thumb) {
|
||||
|
||||
@@ -24,25 +24,25 @@ module.exports = function (User) {
|
||||
var timestamp = data.timestamp || Date.now();
|
||||
|
||||
var userData = {
|
||||
'username': data.username,
|
||||
'userslug': data.userslug,
|
||||
'email': data.email || '',
|
||||
'joindate': timestamp,
|
||||
'lastonline': timestamp,
|
||||
'picture': '',
|
||||
'fullname': data.fullname || '',
|
||||
'location': '',
|
||||
'birthday': '',
|
||||
'website': '',
|
||||
'signature': '',
|
||||
'uploadedpicture': '',
|
||||
'profileviews': 0,
|
||||
'reputation': 0,
|
||||
'postcount': 0,
|
||||
'topiccount': 0,
|
||||
'lastposttime': 0,
|
||||
'banned': 0,
|
||||
'status': 'online',
|
||||
username: data.username,
|
||||
userslug: data.userslug,
|
||||
email: data.email || '',
|
||||
joindate: timestamp,
|
||||
lastonline: timestamp,
|
||||
picture: '',
|
||||
fullname: data.fullname || '',
|
||||
location: '',
|
||||
birthday: '',
|
||||
website: '',
|
||||
signature: '',
|
||||
uploadedpicture: '',
|
||||
profileviews: 0,
|
||||
reputation: 0,
|
||||
postcount: 0,
|
||||
topiccount: 0,
|
||||
lastposttime: 0,
|
||||
banned: 0,
|
||||
status: 'online',
|
||||
};
|
||||
|
||||
async.parallel({
|
||||
|
||||
Reference in New Issue
Block a user